Class Environment.Builder (2.26.0)

public static final class Environment.Builder extends GeneratedMessageV3.Builder<Environment.Builder> implements EnvironmentOrBuilder

A Cloud Shell environment, which is defined as the combination of a Docker image specifying what is installed on the environment and a home directory containing the user's data that will remain across sessions. Each user has at least an environment with the ID "default".

Protobuf type google.cloud.shell.v1.Environment

Static Methods

getDescriptor()

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

Methods

addAllPublicKeys(Iterable<String> values)

public Environment.Builder addAllPublicKeys(Iterable<String> values)

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valuesIterable<String>

The publicKeys to add.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

addPublicKeys(String value)

public Environment.Builder addPublicKeys(String value)

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueString

The publicKeys to add.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

addPublicKeysBytes(ByteString value)

public Environment.Builder addPublicKeysBytes(ByteString value)

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueByteString

The bytes of the publicKeys to add.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Environment build()
Returns
TypeDescription
Environment

buildPartial()

public Environment buildPartial()
Returns
TypeDescription
Environment

clear()

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

clearDockerImage()

public Environment.Builder clearDockerImage()

Required. Immutable. Full path to the Docker image used to run this environment, e.g. "gcr.io/dev-con/cloud-devshell:latest".

string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
Environment.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearId()

public Environment.Builder clearId()

Output only. The environment's identifier, unique among the user's environments.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Environment.Builder

This builder for chaining.

clearName()

public Environment.Builder clearName()

Immutable. Full name of this resource, in the format users/{owner_email}/environments/{environment_id}. {owner_email} is the email address of the user to whom this environment belongs, and {environment_id} is the identifier of this environment. For example, users/someone@example.com/environments/default.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
Environment.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPublicKeys()

public Environment.Builder clearPublicKeys()

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Environment.Builder

This builder for chaining.

clearSshHost()

public Environment.Builder clearSshHost()

Output only. Host to which clients can connect to initiate SSH sessions with the environment.

string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Environment.Builder

This builder for chaining.

clearSshPort()

public Environment.Builder clearSshPort()

Output only. Port to which clients can connect to initiate SSH sessions with the environment.

int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Environment.Builder

This builder for chaining.

clearSshUsername()

public Environment.Builder clearSshUsername()

Output only. Username that clients should use when initiating SSH sessions with the environment.

string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Environment.Builder

This builder for chaining.

clearState()

public Environment.Builder clearState()

Output only. Current execution state of this environment.

.google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Environment.Builder

This builder for chaining.

clearWebHost()

public Environment.Builder clearWebHost()

Output only. Host to which clients can connect to initiate HTTPS or WSS connections with the environment.

string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Environment.Builder

This builder for chaining.

clone()

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

getDefaultInstanceForType()

public Environment getDefaultInstanceForType()
Returns
TypeDescription
Environment

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDockerImage()

public String getDockerImage()

Required. Immutable. Full path to the Docker image used to run this environment, e.g. "gcr.io/dev-con/cloud-devshell:latest".

string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
String

The dockerImage.

getDockerImageBytes()

public ByteString getDockerImageBytes()

Required. Immutable. Full path to the Docker image used to run this environment, e.g. "gcr.io/dev-con/cloud-devshell:latest".

string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
ByteString

The bytes for dockerImage.

getId()

public String getId()

Output only. The environment's identifier, unique among the user's environments.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The id.

getIdBytes()

public ByteString getIdBytes()

Output only. The environment's identifier, unique among the user's environments.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for id.

getName()

public String getName()

Immutable. Full name of this resource, in the format users/{owner_email}/environments/{environment_id}. {owner_email} is the email address of the user to whom this environment belongs, and {environment_id} is the identifier of this environment. For example, users/someone@example.com/environments/default.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Immutable. Full name of this resource, in the format users/{owner_email}/environments/{environment_id}. {owner_email} is the email address of the user to whom this environment belongs, and {environment_id} is the identifier of this environment. For example, users/someone@example.com/environments/default.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
ByteString

The bytes for name.

getPublicKeys(int index)

public String getPublicKeys(int index)

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The publicKeys at the given index.

getPublicKeysBytes(int index)

public ByteString getPublicKeysBytes(int index)

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the publicKeys at the given index.

getPublicKeysCount()

public int getPublicKeysCount()

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The count of publicKeys.

getPublicKeysList()

public ProtocolStringList getPublicKeysList()

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ProtocolStringList

A list containing the publicKeys.

getSshHost()

public String getSshHost()

Output only. Host to which clients can connect to initiate SSH sessions with the environment.

string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The sshHost.

getSshHostBytes()

public ByteString getSshHostBytes()

Output only. Host to which clients can connect to initiate SSH sessions with the environment.

string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for sshHost.

getSshPort()

public int getSshPort()

Output only. Port to which clients can connect to initiate SSH sessions with the environment.

int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The sshPort.

getSshUsername()

public String getSshUsername()

Output only. Username that clients should use when initiating SSH sessions with the environment.

string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The sshUsername.

getSshUsernameBytes()

public ByteString getSshUsernameBytes()

Output only. Username that clients should use when initiating SSH sessions with the environment.

string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for sshUsername.

getState()

public Environment.State getState()

Output only. Current execution state of this environment.

.google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Environment.State

The state.

getStateValue()

public int getStateValue()

Output only. Current execution state of this environment.

.google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The enum numeric value on the wire for state.

getWebHost()

public String getWebHost()

Output only. Host to which clients can connect to initiate HTTPS or WSS connections with the environment.

string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The webHost.

getWebHostBytes()

public ByteString getWebHostBytes()

Output only. Host to which clients can connect to initiate HTTPS or WSS connections with the environment.

string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for webHost.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Environment other)

public Environment.Builder mergeFrom(Environment other)
Parameter
NameDescription
otherEnvironment
Returns
TypeDescription
Environment.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setDockerImage(String value)

public Environment.Builder setDockerImage(String value)

Required. Immutable. Full path to the Docker image used to run this environment, e.g. "gcr.io/dev-con/cloud-devshell:latest".

string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueString

The dockerImage to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setDockerImageBytes(ByteString value)

public Environment.Builder setDockerImageBytes(ByteString value)

Required. Immutable. Full path to the Docker image used to run this environment, e.g. "gcr.io/dev-con/cloud-devshell:latest".

string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueByteString

The bytes for dockerImage to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setId(String value)

public Environment.Builder setId(String value)

Output only. The environment's identifier, unique among the user's environments.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueString

The id to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setIdBytes(ByteString value)

public Environment.Builder setIdBytes(ByteString value)

Output only. The environment's identifier, unique among the user's environments.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueByteString

The bytes for id to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setName(String value)

public Environment.Builder setName(String value)

Immutable. Full name of this resource, in the format users/{owner_email}/environments/{environment_id}. {owner_email} is the email address of the user to whom this environment belongs, and {environment_id} is the identifier of this environment. For example, users/someone@example.com/environments/default.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Environment.Builder setNameBytes(ByteString value)

Immutable. Full name of this resource, in the format users/{owner_email}/environments/{environment_id}. {owner_email} is the email address of the user to whom this environment belongs, and {environment_id} is the identifier of this environment. For example, users/someone@example.com/environments/default.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setPublicKeys(int index, String value)

public Environment.Builder setPublicKeys(int index, String value)

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The publicKeys to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

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

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

setSshHost(String value)

public Environment.Builder setSshHost(String value)

Output only. Host to which clients can connect to initiate SSH sessions with the environment.

string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueString

The sshHost to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setSshHostBytes(ByteString value)

public Environment.Builder setSshHostBytes(ByteString value)

Output only. Host to which clients can connect to initiate SSH sessions with the environment.

string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueByteString

The bytes for sshHost to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setSshPort(int value)

public Environment.Builder setSshPort(int value)

Output only. Port to which clients can connect to initiate SSH sessions with the environment.

int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueint

The sshPort to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setSshUsername(String value)

public Environment.Builder setSshUsername(String value)

Output only. Username that clients should use when initiating SSH sessions with the environment.

string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueString

The sshUsername to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setSshUsernameBytes(ByteString value)

public Environment.Builder setSshUsernameBytes(ByteString value)

Output only. Username that clients should use when initiating SSH sessions with the environment.

string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueByteString

The bytes for sshUsername to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setState(Environment.State value)

public Environment.Builder setState(Environment.State value)

Output only. Current execution state of this environment.

.google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueEnvironment.State

The state to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setStateValue(int value)

public Environment.Builder setStateValue(int value)

Output only. Current execution state of this environment.

.google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueint

The enum numeric value on the wire for state to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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

setWebHost(String value)

public Environment.Builder setWebHost(String value)

Output only. Host to which clients can connect to initiate HTTPS or WSS connections with the environment.

string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueString

The webHost to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.

setWebHostBytes(ByteString value)

public Environment.Builder setWebHostBytes(ByteString value)

Output only. Host to which clients can connect to initiate HTTPS or WSS connections with the environment.

string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueByteString

The bytes for webHost to set.

Returns
TypeDescription
Environment.Builder

This builder for chaining.