Class Secret.Builder (3.37.0)

public static final class Secret.Builder extends GeneratedMessageV3.Builder<Secret.Builder> implements SecretOrBuilder

Pairs a set of secret environment variables containing encrypted values with the Cloud KMS key to use to decrypt the value. Note: Use kmsKeyName with available_secrets instead of using kmsKeyName with secret. For instructions see: https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials.

Protobuf type google.devtools.cloudbuild.v1.Secret

Implements

SecretOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Secret.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Secret.Builder
Overrides

build()

public Secret build()
Returns
TypeDescription
Secret

buildPartial()

public Secret buildPartial()
Returns
TypeDescription
Secret

clear()

public Secret.Builder clear()
Returns
TypeDescription
Secret.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Secret.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Secret.Builder
Overrides

clearKmsKeyName()

public Secret.Builder clearKmsKeyName()

Cloud KMS key name to use to decrypt these envs.

string kms_key_name = 1;

Returns
TypeDescription
Secret.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Secret.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Secret.Builder
Overrides

clearSecretEnv()

public Secret.Builder clearSecretEnv()
Returns
TypeDescription
Secret.Builder

clone()

public Secret.Builder clone()
Returns
TypeDescription
Secret.Builder
Overrides

containsSecretEnv(String key)

public boolean containsSecretEnv(String key)

Map of environment variable name to its encrypted value.

Secret environment variables must be unique across all of a build's secrets, and must be used by at least one build step. Values can be at most 64 KB in size. There can be at most 100 secret values across all of a build's secrets.

map<string, bytes> secret_env = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getDefaultInstanceForType()

public Secret getDefaultInstanceForType()
Returns
TypeDescription
Secret

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getKmsKeyName()

public String getKmsKeyName()

Cloud KMS key name to use to decrypt these envs.

string kms_key_name = 1;

Returns
TypeDescription
String

The kmsKeyName.

getKmsKeyNameBytes()

public ByteString getKmsKeyNameBytes()

Cloud KMS key name to use to decrypt these envs.

string kms_key_name = 1;

Returns
TypeDescription
ByteString

The bytes for kmsKeyName.

getMutableSecretEnv() (deprecated)

public Map<String,ByteString> getMutableSecretEnv()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,ByteString>

getSecretEnv() (deprecated)

public Map<String,ByteString> getSecretEnv()

Use #getSecretEnvMap() instead.

Returns
TypeDescription
Map<String,ByteString>

getSecretEnvCount()

public int getSecretEnvCount()

Map of environment variable name to its encrypted value.

Secret environment variables must be unique across all of a build's secrets, and must be used by at least one build step. Values can be at most 64 KB in size. There can be at most 100 secret values across all of a build's secrets.

map<string, bytes> secret_env = 3;

Returns
TypeDescription
int

getSecretEnvMap()

public Map<String,ByteString> getSecretEnvMap()

Map of environment variable name to its encrypted value.

Secret environment variables must be unique across all of a build's secrets, and must be used by at least one build step. Values can be at most 64 KB in size. There can be at most 100 secret values across all of a build's secrets.

map<string, bytes> secret_env = 3;

Returns
TypeDescription
Map<String,ByteString>

getSecretEnvOrDefault(String key, ByteString defaultValue)

public ByteString getSecretEnvOrDefault(String key, ByteString defaultValue)

Map of environment variable name to its encrypted value.

Secret environment variables must be unique across all of a build's secrets, and must be used by at least one build step. Values can be at most 64 KB in size. There can be at most 100 secret values across all of a build's secrets.

map<string, bytes> secret_env = 3;

Parameters
NameDescription
keyString
defaultValueByteString
Returns
TypeDescription
ByteString

getSecretEnvOrThrow(String key)

public ByteString getSecretEnvOrThrow(String key)

Map of environment variable name to its encrypted value.

Secret environment variables must be unique across all of a build's secrets, and must be used by at least one build step. Values can be at most 64 KB in size. There can be at most 100 secret values across all of a build's secrets.

map<string, bytes> secret_env = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
ByteString

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Secret other)

public Secret.Builder mergeFrom(Secret other)
Parameter
NameDescription
otherSecret
Returns
TypeDescription
Secret.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Secret.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Secret.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Secret.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Secret.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Secret.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Secret.Builder
Overrides

putAllSecretEnv(Map<String,ByteString> values)

public Secret.Builder putAllSecretEnv(Map<String,ByteString> values)

Map of environment variable name to its encrypted value.

Secret environment variables must be unique across all of a build's secrets, and must be used by at least one build step. Values can be at most 64 KB in size. There can be at most 100 secret values across all of a build's secrets.

map<string, bytes> secret_env = 3;

Parameter
NameDescription
valuesMap<String,ByteString>
Returns
TypeDescription
Secret.Builder

putSecretEnv(String key, ByteString value)

public Secret.Builder putSecretEnv(String key, ByteString value)

Map of environment variable name to its encrypted value.

Secret environment variables must be unique across all of a build's secrets, and must be used by at least one build step. Values can be at most 64 KB in size. There can be at most 100 secret values across all of a build's secrets.

map<string, bytes> secret_env = 3;

Parameters
NameDescription
keyString
valueByteString
Returns
TypeDescription
Secret.Builder

removeSecretEnv(String key)

public Secret.Builder removeSecretEnv(String key)

Map of environment variable name to its encrypted value.

Secret environment variables must be unique across all of a build's secrets, and must be used by at least one build step. Values can be at most 64 KB in size. There can be at most 100 secret values across all of a build's secrets.

map<string, bytes> secret_env = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
Secret.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Secret.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Secret.Builder
Overrides

setKmsKeyName(String value)

public Secret.Builder setKmsKeyName(String value)

Cloud KMS key name to use to decrypt these envs.

string kms_key_name = 1;

Parameter
NameDescription
valueString

The kmsKeyName to set.

Returns
TypeDescription
Secret.Builder

This builder for chaining.

setKmsKeyNameBytes(ByteString value)

public Secret.Builder setKmsKeyNameBytes(ByteString value)

Cloud KMS key name to use to decrypt these envs.

string kms_key_name = 1;

Parameter
NameDescription
valueByteString

The bytes for kmsKeyName to set.

Returns
TypeDescription
Secret.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Secret.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Secret.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Secret.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Secret.Builder
Overrides