/*
 * Copyright 2020 Google LLC
 *
 * 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
 *
 *     https://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.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/shell/v1/cloudshell.proto

package com.google.cloud.shell.v1;

/**
 *
 *
 * <pre>
 * 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".
 * </pre>
 *
 * Protobuf type {@code google.cloud.shell.v1.Environment}
 */
public final class Environment extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.Environment)
    EnvironmentOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Environment.newBuilder() to construct.
  private Environment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Environment() {
    name_ = "";
    id_ = "";
    dockerImage_ = "";
    state_ = 0;
    webHost_ = "";
    sshUsername_ = "";
    sshHost_ = "";
    publicKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new Environment();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.shell.v1.CloudShellProto
        .internal_static_google_cloud_shell_v1_Environment_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.shell.v1.CloudShellProto
        .internal_static_google_cloud_shell_v1_Environment_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.shell.v1.Environment.class,
            com.google.cloud.shell.v1.Environment.Builder.class);
  }

  /**
   *
   *
   * <pre>
   * Possible execution states for an environment.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.shell.v1.Environment.State}
   */
  public enum State implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * The environment's states is unknown.
     * </pre>
     *
     * <code>STATE_UNSPECIFIED = 0;</code>
     */
    STATE_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * The environment is not running and can't be connected to. Starting the
     * environment will transition it to the PENDING state.
     * </pre>
     *
     * <code>SUSPENDED = 1;</code>
     */
    SUSPENDED(1),
    /**
     *
     *
     * <pre>
     * The environment is being started but is not yet ready to accept
     * connections.
     * </pre>
     *
     * <code>PENDING = 2;</code>
     */
    PENDING(2),
    /**
     *
     *
     * <pre>
     * The environment is running and ready to accept connections. It will
     * automatically transition back to DISABLED after a period of inactivity or
     * if another environment is started.
     * </pre>
     *
     * <code>RUNNING = 3;</code>
     */
    RUNNING(3),
    /**
     *
     *
     * <pre>
     * The environment is being deleted and can't be connected to.
     * </pre>
     *
     * <code>DELETING = 4;</code>
     */
    DELETING(4),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * The environment's states is unknown.
     * </pre>
     *
     * <code>STATE_UNSPECIFIED = 0;</code>
     */
    public static final int STATE_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * The environment is not running and can't be connected to. Starting the
     * environment will transition it to the PENDING state.
     * </pre>
     *
     * <code>SUSPENDED = 1;</code>
     */
    public static final int SUSPENDED_VALUE = 1;
    /**
     *
     *
     * <pre>
     * The environment is being started but is not yet ready to accept
     * connections.
     * </pre>
     *
     * <code>PENDING = 2;</code>
     */
    public static final int PENDING_VALUE = 2;
    /**
     *
     *
     * <pre>
     * The environment is running and ready to accept connections. It will
     * automatically transition back to DISABLED after a period of inactivity or
     * if another environment is started.
     * </pre>
     *
     * <code>RUNNING = 3;</code>
     */
    public static final int RUNNING_VALUE = 3;
    /**
     *
     *
     * <pre>
     * The environment is being deleted and can't be connected to.
     * </pre>
     *
     * <code>DELETING = 4;</code>
     */
    public static final int DELETING_VALUE = 4;

    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static State valueOf(int value) {
      return forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     */
    public static State forNumber(int value) {
      switch (value) {
        case 0:
          return STATE_UNSPECIFIED;
        case 1:
          return SUSPENDED;
        case 2:
          return PENDING;
        case 3:
          return RUNNING;
        case 4:
          return DELETING;
        default:
          return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<State> internalGetValueMap() {
      return internalValueMap;
    }

    private static final com.google.protobuf.Internal.EnumLiteMap<State> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<State>() {
          public State findValueByNumber(int number) {
            return State.forNumber(number);
          }
        };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalStateException(
            "Can't get the descriptor of an unrecognized enum value.");
      }
      return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
      return getDescriptor();
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
      return com.google.cloud.shell.v1.Environment.getDescriptor().getEnumTypes().get(0);
    }

    private static final State[] VALUES = values();

    public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private State(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.shell.v1.Environment.State)
  }

  public static final int NAME_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object name_ = "";
  /**
   *
   *
   * <pre>
   * 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&#64;example.com/environments/default`.
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
   *
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * 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&#64;example.com/environments/default`.
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ID_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object id_ = "";
  /**
   *
   *
   * <pre>
   * Output only. The environment's identifier, unique among the user's
   * environments.
   * </pre>
   *
   * <code>string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The id.
   */
  @java.lang.Override
  public java.lang.String getId() {
    java.lang.Object ref = id_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      id_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. The environment's identifier, unique among the user's
   * environments.
   * </pre>
   *
   * <code>string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The bytes for id.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getIdBytes() {
    java.lang.Object ref = id_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      id_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DOCKER_IMAGE_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object dockerImage_ = "";
  /**
   *
   *
   * <pre>
   * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
   * "gcr.io/dev-con/cloud-devshell:latest".
   * </pre>
   *
   * <code>
   * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
   * </code>
   *
   * @return The dockerImage.
   */
  @java.lang.Override
  public java.lang.String getDockerImage() {
    java.lang.Object ref = dockerImage_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      dockerImage_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
   * "gcr.io/dev-con/cloud-devshell:latest".
   * </pre>
   *
   * <code>
   * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
   * </code>
   *
   * @return The bytes for dockerImage.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDockerImageBytes() {
    java.lang.Object ref = dockerImage_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      dockerImage_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int STATE_FIELD_NUMBER = 4;
  private int state_ = 0;
  /**
   *
   *
   * <pre>
   * Output only. Current execution state of this environment.
   * </pre>
   *
   * <code>
   * .google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The enum numeric value on the wire for state.
   */
  @java.lang.Override
  public int getStateValue() {
    return state_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Current execution state of this environment.
   * </pre>
   *
   * <code>
   * .google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The state.
   */
  @java.lang.Override
  public com.google.cloud.shell.v1.Environment.State getState() {
    com.google.cloud.shell.v1.Environment.State result =
        com.google.cloud.shell.v1.Environment.State.forNumber(state_);
    return result == null ? com.google.cloud.shell.v1.Environment.State.UNRECOGNIZED : result;
  }

  public static final int WEB_HOST_FIELD_NUMBER = 12;

  @SuppressWarnings("serial")
  private volatile java.lang.Object webHost_ = "";
  /**
   *
   *
   * <pre>
   * Output only. Host to which clients can connect to initiate HTTPS or WSS
   * connections with the environment.
   * </pre>
   *
   * <code>string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The webHost.
   */
  @java.lang.Override
  public java.lang.String getWebHost() {
    java.lang.Object ref = webHost_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      webHost_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. Host to which clients can connect to initiate HTTPS or WSS
   * connections with the environment.
   * </pre>
   *
   * <code>string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The bytes for webHost.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getWebHostBytes() {
    java.lang.Object ref = webHost_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      webHost_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SSH_USERNAME_FIELD_NUMBER = 5;

  @SuppressWarnings("serial")
  private volatile java.lang.Object sshUsername_ = "";
  /**
   *
   *
   * <pre>
   * Output only. Username that clients should use when initiating SSH sessions
   * with the environment.
   * </pre>
   *
   * <code>string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The sshUsername.
   */
  @java.lang.Override
  public java.lang.String getSshUsername() {
    java.lang.Object ref = sshUsername_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      sshUsername_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. Username that clients should use when initiating SSH sessions
   * with the environment.
   * </pre>
   *
   * <code>string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The bytes for sshUsername.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getSshUsernameBytes() {
    java.lang.Object ref = sshUsername_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      sshUsername_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SSH_HOST_FIELD_NUMBER = 6;

  @SuppressWarnings("serial")
  private volatile java.lang.Object sshHost_ = "";
  /**
   *
   *
   * <pre>
   * Output only. Host to which clients can connect to initiate SSH sessions
   * with the environment.
   * </pre>
   *
   * <code>string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The sshHost.
   */
  @java.lang.Override
  public java.lang.String getSshHost() {
    java.lang.Object ref = sshHost_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      sshHost_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. Host to which clients can connect to initiate SSH sessions
   * with the environment.
   * </pre>
   *
   * <code>string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The bytes for sshHost.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getSshHostBytes() {
    java.lang.Object ref = sshHost_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      sshHost_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SSH_PORT_FIELD_NUMBER = 7;
  private int sshPort_ = 0;
  /**
   *
   *
   * <pre>
   * Output only. Port to which clients can connect to initiate SSH sessions
   * with the environment.
   * </pre>
   *
   * <code>int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The sshPort.
   */
  @java.lang.Override
  public int getSshPort() {
    return sshPort_;
  }

  public static final int PUBLIC_KEYS_FIELD_NUMBER = 8;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringList publicKeys_;
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return A list containing the publicKeys.
   */
  public com.google.protobuf.ProtocolStringList getPublicKeysList() {
    return publicKeys_;
  }
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The count of publicKeys.
   */
  public int getPublicKeysCount() {
    return publicKeys_.size();
  }
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @param index The index of the element to return.
   * @return The publicKeys at the given index.
   */
  public java.lang.String getPublicKeys(int index) {
    return publicKeys_.get(index);
  }
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the publicKeys at the given index.
   */
  public com.google.protobuf.ByteString getPublicKeysBytes(int index) {
    return publicKeys_.getByteString(index);
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dockerImage_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, dockerImage_);
    }
    if (state_ != com.google.cloud.shell.v1.Environment.State.STATE_UNSPECIFIED.getNumber()) {
      output.writeEnum(4, state_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sshUsername_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, sshUsername_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sshHost_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, sshHost_);
    }
    if (sshPort_ != 0) {
      output.writeInt32(7, sshPort_);
    }
    for (int i = 0; i < publicKeys_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 8, publicKeys_.getRaw(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(webHost_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 12, webHost_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dockerImage_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, dockerImage_);
    }
    if (state_ != com.google.cloud.shell.v1.Environment.State.STATE_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sshUsername_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, sshUsername_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sshHost_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, sshHost_);
    }
    if (sshPort_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, sshPort_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < publicKeys_.size(); i++) {
        dataSize += computeStringSizeNoTag(publicKeys_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getPublicKeysList().size();
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(webHost_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, webHost_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.shell.v1.Environment)) {
      return super.equals(obj);
    }
    com.google.cloud.shell.v1.Environment other = (com.google.cloud.shell.v1.Environment) obj;

    if (!getName().equals(other.getName())) return false;
    if (!getId().equals(other.getId())) return false;
    if (!getDockerImage().equals(other.getDockerImage())) return false;
    if (state_ != other.state_) return false;
    if (!getWebHost().equals(other.getWebHost())) return false;
    if (!getSshUsername().equals(other.getSshUsername())) return false;
    if (!getSshHost().equals(other.getSshHost())) return false;
    if (getSshPort() != other.getSshPort()) return false;
    if (!getPublicKeysList().equals(other.getPublicKeysList())) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + ID_FIELD_NUMBER;
    hash = (53 * hash) + getId().hashCode();
    hash = (37 * hash) + DOCKER_IMAGE_FIELD_NUMBER;
    hash = (53 * hash) + getDockerImage().hashCode();
    hash = (37 * hash) + STATE_FIELD_NUMBER;
    hash = (53 * hash) + state_;
    hash = (37 * hash) + WEB_HOST_FIELD_NUMBER;
    hash = (53 * hash) + getWebHost().hashCode();
    hash = (37 * hash) + SSH_USERNAME_FIELD_NUMBER;
    hash = (53 * hash) + getSshUsername().hashCode();
    hash = (37 * hash) + SSH_HOST_FIELD_NUMBER;
    hash = (53 * hash) + getSshHost().hashCode();
    hash = (37 * hash) + SSH_PORT_FIELD_NUMBER;
    hash = (53 * hash) + getSshPort();
    if (getPublicKeysCount() > 0) {
      hash = (37 * hash) + PUBLIC_KEYS_FIELD_NUMBER;
      hash = (53 * hash) + getPublicKeysList().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.shell.v1.Environment parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.shell.v1.Environment parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.shell.v1.Environment parseFrom(com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.shell.v1.Environment parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.shell.v1.Environment parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.shell.v1.Environment parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.shell.v1.Environment parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.shell.v1.Environment parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.shell.v1.Environment parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.shell.v1.Environment parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.shell.v1.Environment parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.shell.v1.Environment parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.shell.v1.Environment prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * 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".
   * </pre>
   *
   * Protobuf type {@code google.cloud.shell.v1.Environment}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.Environment)
      com.google.cloud.shell.v1.EnvironmentOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.shell.v1.CloudShellProto
          .internal_static_google_cloud_shell_v1_Environment_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.shell.v1.CloudShellProto
          .internal_static_google_cloud_shell_v1_Environment_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.shell.v1.Environment.class,
              com.google.cloud.shell.v1.Environment.Builder.class);
    }

    // Construct using com.google.cloud.shell.v1.Environment.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      name_ = "";
      id_ = "";
      dockerImage_ = "";
      state_ = 0;
      webHost_ = "";
      sshUsername_ = "";
      sshHost_ = "";
      sshPort_ = 0;
      publicKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000100);
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.shell.v1.CloudShellProto
          .internal_static_google_cloud_shell_v1_Environment_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.shell.v1.Environment getDefaultInstanceForType() {
      return com.google.cloud.shell.v1.Environment.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.shell.v1.Environment build() {
      com.google.cloud.shell.v1.Environment result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.shell.v1.Environment buildPartial() {
      com.google.cloud.shell.v1.Environment result =
          new com.google.cloud.shell.v1.Environment(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(com.google.cloud.shell.v1.Environment result) {
      if (((bitField0_ & 0x00000100) != 0)) {
        publicKeys_ = publicKeys_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000100);
      }
      result.publicKeys_ = publicKeys_;
    }

    private void buildPartial0(com.google.cloud.shell.v1.Environment result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.name_ = name_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.id_ = id_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.dockerImage_ = dockerImage_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.state_ = state_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.webHost_ = webHost_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.sshUsername_ = sshUsername_;
      }
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.sshHost_ = sshHost_;
      }
      if (((from_bitField0_ & 0x00000080) != 0)) {
        result.sshPort_ = sshPort_;
      }
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.shell.v1.Environment) {
        return mergeFrom((com.google.cloud.shell.v1.Environment) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.shell.v1.Environment other) {
      if (other == com.google.cloud.shell.v1.Environment.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getId().isEmpty()) {
        id_ = other.id_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (!other.getDockerImage().isEmpty()) {
        dockerImage_ = other.dockerImage_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (other.state_ != 0) {
        setStateValue(other.getStateValue());
      }
      if (!other.getWebHost().isEmpty()) {
        webHost_ = other.webHost_;
        bitField0_ |= 0x00000010;
        onChanged();
      }
      if (!other.getSshUsername().isEmpty()) {
        sshUsername_ = other.sshUsername_;
        bitField0_ |= 0x00000020;
        onChanged();
      }
      if (!other.getSshHost().isEmpty()) {
        sshHost_ = other.sshHost_;
        bitField0_ |= 0x00000040;
        onChanged();
      }
      if (other.getSshPort() != 0) {
        setSshPort(other.getSshPort());
      }
      if (!other.publicKeys_.isEmpty()) {
        if (publicKeys_.isEmpty()) {
          publicKeys_ = other.publicKeys_;
          bitField0_ = (bitField0_ & ~0x00000100);
        } else {
          ensurePublicKeysIsMutable();
          publicKeys_.addAll(other.publicKeys_);
        }
        onChanged();
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                name_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                id_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                dockerImage_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 32:
              {
                state_ = input.readEnum();
                bitField0_ |= 0x00000008;
                break;
              } // case 32
            case 42:
              {
                sshUsername_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000020;
                break;
              } // case 42
            case 50:
              {
                sshHost_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000040;
                break;
              } // case 50
            case 56:
              {
                sshPort_ = input.readInt32();
                bitField0_ |= 0x00000080;
                break;
              } // case 56
            case 66:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensurePublicKeysIsMutable();
                publicKeys_.add(s);
                break;
              } // case 66
            case 98:
              {
                webHost_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000010;
                break;
              } // case 98
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * 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&#64;example.com/environments/default`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * 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&#64;example.com/environments/default`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * 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&#64;example.com/environments/default`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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&#64;example.com/environments/default`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {
      name_ = getDefaultInstance().getName();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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&#64;example.com/environments/default`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object id_ = "";
    /**
     *
     *
     * <pre>
     * Output only. The environment's identifier, unique among the user's
     * environments.
     * </pre>
     *
     * <code>string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The id.
     */
    public java.lang.String getId() {
      java.lang.Object ref = id_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        id_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The environment's identifier, unique among the user's
     * environments.
     * </pre>
     *
     * <code>string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The bytes for id.
     */
    public com.google.protobuf.ByteString getIdBytes() {
      java.lang.Object ref = id_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        id_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The environment's identifier, unique among the user's
     * environments.
     * </pre>
     *
     * <code>string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The id to set.
     * @return This builder for chaining.
     */
    public Builder setId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      id_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The environment's identifier, unique among the user's
     * environments.
     * </pre>
     *
     * <code>string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearId() {
      id_ = getDefaultInstance().getId();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The environment's identifier, unique among the user's
     * environments.
     * </pre>
     *
     * <code>string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The bytes for id to set.
     * @return This builder for chaining.
     */
    public Builder setIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      id_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private java.lang.Object dockerImage_ = "";
    /**
     *
     *
     * <pre>
     * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
     * "gcr.io/dev-con/cloud-devshell:latest".
     * </pre>
     *
     * <code>
     * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @return The dockerImage.
     */
    public java.lang.String getDockerImage() {
      java.lang.Object ref = dockerImage_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        dockerImage_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
     * "gcr.io/dev-con/cloud-devshell:latest".
     * </pre>
     *
     * <code>
     * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @return The bytes for dockerImage.
     */
    public com.google.protobuf.ByteString getDockerImageBytes() {
      java.lang.Object ref = dockerImage_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        dockerImage_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
     * "gcr.io/dev-con/cloud-devshell:latest".
     * </pre>
     *
     * <code>
     * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @param value The dockerImage to set.
     * @return This builder for chaining.
     */
    public Builder setDockerImage(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      dockerImage_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
     * "gcr.io/dev-con/cloud-devshell:latest".
     * </pre>
     *
     * <code>
     * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDockerImage() {
      dockerImage_ = getDefaultInstance().getDockerImage();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
     * "gcr.io/dev-con/cloud-devshell:latest".
     * </pre>
     *
     * <code>
     * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @param value The bytes for dockerImage to set.
     * @return This builder for chaining.
     */
    public Builder setDockerImageBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      dockerImage_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private int state_ = 0;
    /**
     *
     *
     * <pre>
     * Output only. Current execution state of this environment.
     * </pre>
     *
     * <code>
     * .google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The enum numeric value on the wire for state.
     */
    @java.lang.Override
    public int getStateValue() {
      return state_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Current execution state of this environment.
     * </pre>
     *
     * <code>
     * .google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The enum numeric value on the wire for state to set.
     * @return This builder for chaining.
     */
    public Builder setStateValue(int value) {
      state_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Current execution state of this environment.
     * </pre>
     *
     * <code>
     * .google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The state.
     */
    @java.lang.Override
    public com.google.cloud.shell.v1.Environment.State getState() {
      com.google.cloud.shell.v1.Environment.State result =
          com.google.cloud.shell.v1.Environment.State.forNumber(state_);
      return result == null ? com.google.cloud.shell.v1.Environment.State.UNRECOGNIZED : result;
    }
    /**
     *
     *
     * <pre>
     * Output only. Current execution state of this environment.
     * </pre>
     *
     * <code>
     * .google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The state to set.
     * @return This builder for chaining.
     */
    public Builder setState(com.google.cloud.shell.v1.Environment.State value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000008;
      state_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Current execution state of this environment.
     * </pre>
     *
     * <code>
     * .google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearState() {
      bitField0_ = (bitField0_ & ~0x00000008);
      state_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object webHost_ = "";
    /**
     *
     *
     * <pre>
     * Output only. Host to which clients can connect to initiate HTTPS or WSS
     * connections with the environment.
     * </pre>
     *
     * <code>string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The webHost.
     */
    public java.lang.String getWebHost() {
      java.lang.Object ref = webHost_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        webHost_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Host to which clients can connect to initiate HTTPS or WSS
     * connections with the environment.
     * </pre>
     *
     * <code>string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The bytes for webHost.
     */
    public com.google.protobuf.ByteString getWebHostBytes() {
      java.lang.Object ref = webHost_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        webHost_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Host to which clients can connect to initiate HTTPS or WSS
     * connections with the environment.
     * </pre>
     *
     * <code>string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The webHost to set.
     * @return This builder for chaining.
     */
    public Builder setWebHost(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      webHost_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Host to which clients can connect to initiate HTTPS or WSS
     * connections with the environment.
     * </pre>
     *
     * <code>string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearWebHost() {
      webHost_ = getDefaultInstance().getWebHost();
      bitField0_ = (bitField0_ & ~0x00000010);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Host to which clients can connect to initiate HTTPS or WSS
     * connections with the environment.
     * </pre>
     *
     * <code>string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The bytes for webHost to set.
     * @return This builder for chaining.
     */
    public Builder setWebHostBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      webHost_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }

    private java.lang.Object sshUsername_ = "";
    /**
     *
     *
     * <pre>
     * Output only. Username that clients should use when initiating SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The sshUsername.
     */
    public java.lang.String getSshUsername() {
      java.lang.Object ref = sshUsername_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        sshUsername_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Username that clients should use when initiating SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The bytes for sshUsername.
     */
    public com.google.protobuf.ByteString getSshUsernameBytes() {
      java.lang.Object ref = sshUsername_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        sshUsername_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Username that clients should use when initiating SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The sshUsername to set.
     * @return This builder for chaining.
     */
    public Builder setSshUsername(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      sshUsername_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Username that clients should use when initiating SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSshUsername() {
      sshUsername_ = getDefaultInstance().getSshUsername();
      bitField0_ = (bitField0_ & ~0x00000020);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Username that clients should use when initiating SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The bytes for sshUsername to set.
     * @return This builder for chaining.
     */
    public Builder setSshUsernameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      sshUsername_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }

    private java.lang.Object sshHost_ = "";
    /**
     *
     *
     * <pre>
     * Output only. Host to which clients can connect to initiate SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The sshHost.
     */
    public java.lang.String getSshHost() {
      java.lang.Object ref = sshHost_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        sshHost_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Host to which clients can connect to initiate SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The bytes for sshHost.
     */
    public com.google.protobuf.ByteString getSshHostBytes() {
      java.lang.Object ref = sshHost_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        sshHost_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Host to which clients can connect to initiate SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The sshHost to set.
     * @return This builder for chaining.
     */
    public Builder setSshHost(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      sshHost_ = value;
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Host to which clients can connect to initiate SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSshHost() {
      sshHost_ = getDefaultInstance().getSshHost();
      bitField0_ = (bitField0_ & ~0x00000040);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Host to which clients can connect to initiate SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The bytes for sshHost to set.
     * @return This builder for chaining.
     */
    public Builder setSshHostBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      sshHost_ = value;
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }

    private int sshPort_;
    /**
     *
     *
     * <pre>
     * Output only. Port to which clients can connect to initiate SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The sshPort.
     */
    @java.lang.Override
    public int getSshPort() {
      return sshPort_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Port to which clients can connect to initiate SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The sshPort to set.
     * @return This builder for chaining.
     */
    public Builder setSshPort(int value) {

      sshPort_ = value;
      bitField0_ |= 0x00000080;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Port to which clients can connect to initiate SSH sessions
     * with the environment.
     * </pre>
     *
     * <code>int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSshPort() {
      bitField0_ = (bitField0_ & ~0x00000080);
      sshPort_ = 0;
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList publicKeys_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensurePublicKeysIsMutable() {
      if (!((bitField0_ & 0x00000100) != 0)) {
        publicKeys_ = new com.google.protobuf.LazyStringArrayList(publicKeys_);
        bitField0_ |= 0x00000100;
      }
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return A list containing the publicKeys.
     */
    public com.google.protobuf.ProtocolStringList getPublicKeysList() {
      return publicKeys_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The count of publicKeys.
     */
    public int getPublicKeysCount() {
      return publicKeys_.size();
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param index The index of the element to return.
     * @return The publicKeys at the given index.
     */
    public java.lang.String getPublicKeys(int index) {
      return publicKeys_.get(index);
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the publicKeys at the given index.
     */
    public com.google.protobuf.ByteString getPublicKeysBytes(int index) {
      return publicKeys_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param index The index to set the value at.
     * @param value The publicKeys to set.
     * @return This builder for chaining.
     */
    public Builder setPublicKeys(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensurePublicKeysIsMutable();
      publicKeys_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The publicKeys to add.
     * @return This builder for chaining.
     */
    public Builder addPublicKeys(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensurePublicKeysIsMutable();
      publicKeys_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param values The publicKeys to add.
     * @return This builder for chaining.
     */
    public Builder addAllPublicKeys(java.lang.Iterable<java.lang.String> values) {
      ensurePublicKeysIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, publicKeys_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPublicKeys() {
      publicKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000100);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The bytes of the publicKeys to add.
     * @return This builder for chaining.
     */
    public Builder addPublicKeysBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensurePublicKeysIsMutable();
      publicKeys_.add(value);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.shell.v1.Environment)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.Environment)
  private static final com.google.cloud.shell.v1.Environment DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.shell.v1.Environment();
  }

  public static com.google.cloud.shell.v1.Environment getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<Environment> PARSER =
      new com.google.protobuf.AbstractParser<Environment>() {
        @java.lang.Override
        public Environment parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<Environment> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<Environment> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.shell.v1.Environment getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
