public sealed class Environment : IMessage<Environment>, IEquatable<Environment>, IDeepCloneable<Environment>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud Shell v1 API class Environment.
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".
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis document provides reference documentation for the \u003ccode\u003eEnvironment\u003c/code\u003e class within the Google Cloud Shell v1 API, with version 2.5.0 being the latest release.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEnvironment\u003c/code\u003e class represents a Cloud Shell environment, which combines a Docker image and a user's persistent home directory.\u003c/p\u003e\n"],["\u003cp\u003eEach user's Cloud Shell environment can be accessed via SSH and HTTPS/WSS, with the environment's current state, SSH host, port, username, and web host available as properties.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEnvironment\u003c/code\u003e class has properties for the Docker image used, the environment's ID, its full name, associated public keys, and its current execution state.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEnvironment\u003c/code\u003e class has \u003ccode\u003eEnvironment()\u003c/code\u003e and \u003ccode\u003eEnvironment(Environment other)\u003c/code\u003e constructors, one default and the other to create a new \u003ccode\u003eEnvironment\u003c/code\u003e object from an existing \u003ccode\u003eEnvironment\u003c/code\u003e object.\u003c/p\u003e\n"]]],[],null,["# Cloud Shell v1 API - Class Environment (2.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.5.0 (latest)](/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.Environment)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Shell.V1/2.4.0/Google.Cloud.Shell.V1.Environment)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Shell.V1/2.3.0/Google.Cloud.Shell.V1.Environment)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Shell.V1/2.2.0/Google.Cloud.Shell.V1.Environment)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Shell.V1/2.1.0/Google.Cloud.Shell.V1.Environment)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Shell.V1/2.0.0/Google.Cloud.Shell.V1.Environment)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Shell.V1/1.1.0/Google.Cloud.Shell.V1.Environment)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Shell.V1/1.0.0/Google.Cloud.Shell.V1.Environment) \n\n public sealed class Environment : IMessage\u003cEnvironment\u003e, IEquatable\u003cEnvironment\u003e, IDeepCloneable\u003cEnvironment\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Shell v1 API class Environment.\n\nA Cloud Shell environment, which is defined as the combination of a Docker\nimage specifying what is installed on the environment and a home directory\ncontaining the user's data that will remain across sessions. Each user has\nat least an environment with the ID \"default\". \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Environment \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Environment](/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.Environment), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Environment](/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.Environment), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Environment](/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.Environment), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Shell.V1](/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Shell.V1.dll\n\nConstructors\n------------\n\n### Environment()\n\n public Environment()\n\n### Environment(Environment)\n\n public Environment(Environment other)\n\nProperties\n----------\n\n### DockerImage\n\n public string DockerImage { get; set; }\n\nRequired. Immutable. Full path to the Docker image used to run this environment, e.g.\n\"gcr.io/dev-con/cloud-devshell:latest\".\n\n### EnvironmentName\n\n public EnvironmentName EnvironmentName { get; set; }\n\n[EnvironmentName](/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.EnvironmentName)-typed view over the [Name](/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.Environment#Google_Cloud_Shell_V1_Environment_Name) resource name property.\n\n### Id\n\n public string Id { get; set; }\n\nOutput only. The environment's identifier, unique among the user's\nenvironments.\n\n### Name\n\n public string Name { get; set; }\n\nImmutable. Full name of this resource, in the format\n`users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the\nemail address of the user to whom this environment belongs, and\n`{environment_id}` is the identifier of this environment. For example,\n`users/someone@example.com/environments/default`.\n\n### PublicKeys\n\n public RepeatedField\u003cstring\u003e PublicKeys { get; }\n\nOutput only. Public keys associated with the environment. Clients can\nconnect to this environment via SSH only if they possess a private key\ncorresponding to at least one of these public keys. Keys can be added to or\nremoved from the environment using the AddPublicKey and RemovePublicKey\nmethods.\n\n### SshHost\n\n public string SshHost { get; set; }\n\nOutput only. Host to which clients can connect to initiate SSH sessions\nwith the environment.\n\n### SshPort\n\n public int SshPort { get; set; }\n\nOutput only. Port to which clients can connect to initiate SSH sessions\nwith the environment.\n\n### SshUsername\n\n public string SshUsername { get; set; }\n\nOutput only. Username that clients should use when initiating SSH sessions\nwith the environment.\n\n### State\n\n public Environment.Types.State State { get; set; }\n\nOutput only. Current execution state of this environment.\n\n### WebHost\n\n public string WebHost { get; set; }\n\nOutput only. Host to which clients can connect to initiate HTTPS or WSS\nconnections with the environment."]]