com.google.api.services.secretmanager.v1.model.SecretPayload Maven / Gradle / Ivy
The newest version!
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.secretmanager.v1.model;
/**
* A secret payload resource in the Secret Manager API. This contains the sensitive secret payload
* that is associated with a SecretVersion.
*
* This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Secret Manager API. For a detailed explanation see:
* https://developers.google.com/api-client-library/java/google-http-java-client/json
*
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class SecretPayload extends com.google.api.client.json.GenericJson {
/**
* The secret data. Must be no larger than 64KiB.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String data;
/**
* Optional. If specified, SecretManagerService will verify the integrity of the received data on
* SecretManagerService.AddSecretVersion calls using the crc32c checksum and store it to include
* in future SecretManagerService.AccessSecretVersion responses. If a checksum is not provided in
* the SecretManagerService.AddSecretVersion request, the SecretManagerService will generate and
* store one for you. The CRC32C value is encoded as a Int64 for compatibility, and can be safely
* downconverted to uint32 in languages that support this type.
* https://cloud.google.com/apis/design/design_patterns#integer_types
* The value may be {@code null}.
*/
@com.google.api.client.util.Key @com.google.api.client.json.JsonString
private java.lang.Long dataCrc32c;
/**
* The secret data. Must be no larger than 64KiB.
* @see #decodeData()
* @return value or {@code null} for none
*/
public java.lang.String getData() {
return data;
}
/**
* The secret data. Must be no larger than 64KiB.
* @see #getData()
* @return Base64 decoded value or {@code null} for none
*
* @since 1.14
*/
public byte[] decodeData() {
return com.google.api.client.util.Base64.decodeBase64(data);
}
/**
* The secret data. Must be no larger than 64KiB.
* @see #encodeData()
* @param data data or {@code null} for none
*/
public SecretPayload setData(java.lang.String data) {
this.data = data;
return this;
}
/**
* The secret data. Must be no larger than 64KiB.
* @see #setData()
*
*
* The value is encoded Base64 or {@code null} for none.
*
*
* @since 1.14
*/
public SecretPayload encodeData(byte[] data) {
this.data = com.google.api.client.util.Base64.encodeBase64URLSafeString(data);
return this;
}
/**
* Optional. If specified, SecretManagerService will verify the integrity of the received data on
* SecretManagerService.AddSecretVersion calls using the crc32c checksum and store it to include
* in future SecretManagerService.AccessSecretVersion responses. If a checksum is not provided in
* the SecretManagerService.AddSecretVersion request, the SecretManagerService will generate and
* store one for you. The CRC32C value is encoded as a Int64 for compatibility, and can be safely
* downconverted to uint32 in languages that support this type.
* https://cloud.google.com/apis/design/design_patterns#integer_types
* @return value or {@code null} for none
*/
public java.lang.Long getDataCrc32c() {
return dataCrc32c;
}
/**
* Optional. If specified, SecretManagerService will verify the integrity of the received data on
* SecretManagerService.AddSecretVersion calls using the crc32c checksum and store it to include
* in future SecretManagerService.AccessSecretVersion responses. If a checksum is not provided in
* the SecretManagerService.AddSecretVersion request, the SecretManagerService will generate and
* store one for you. The CRC32C value is encoded as a Int64 for compatibility, and can be safely
* downconverted to uint32 in languages that support this type.
* https://cloud.google.com/apis/design/design_patterns#integer_types
* @param dataCrc32c dataCrc32c or {@code null} for none
*/
public SecretPayload setDataCrc32c(java.lang.Long dataCrc32c) {
this.dataCrc32c = dataCrc32c;
return this;
}
@Override
public SecretPayload set(String fieldName, Object value) {
return (SecretPayload) super.set(fieldName, value);
}
@Override
public SecretPayload clone() {
return (SecretPayload) super.clone();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy