// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/rpc/status.proto

package com.google.rpc;

/**
 * <pre>
 * The `Status` type defines a logical error model that is suitable for
 * different programming environments, including REST APIs and RPC APIs. It is
 * used by [gRPC](https://github.com/grpc). Each `Status` message contains
 * three pieces of data: error code, error message, and error details.
 * You can find out more about this error model and how to work with it in the
 * [API Design Guide](https://cloud.google.com/apis/design/errors).
 * </pre>
 *
 * Protobuf type {@code google.rpc.Status}
 */
public  final class Status extends
    com.google.protobuf.GeneratedMessageLite<
        Status, Status.Builder> implements
    // @@protoc_insertion_point(message_implements:google.rpc.Status)
    StatusOrBuilder {
  private Status() {
    message_ = "";
    details_ = emptyProtobufList();
  }
  public static final int CODE_FIELD_NUMBER = 1;
  private int code_;
  /**
   * <pre>
   * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
   * </pre>
   *
   * <code>int32 code = 1;</code>
   * @return The code.
   */
  @java.lang.Override
  public int getCode() {
    return code_;
  }
  /**
   * <pre>
   * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
   * </pre>
   *
   * <code>int32 code = 1;</code>
   * @param value The code to set.
   */
  private void setCode(int value) {
    
    code_ = value;
  }
  /**
   * <pre>
   * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
   * </pre>
   *
   * <code>int32 code = 1;</code>
   */
  private void clearCode() {
    
    code_ = 0;
  }

  public static final int MESSAGE_FIELD_NUMBER = 2;
  private java.lang.String message_;
  /**
   * <pre>
   * A developer-facing error message, which should be in English. Any
   * user-facing error message should be localized and sent in the
   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
   * </pre>
   *
   * <code>string message = 2;</code>
   * @return The message.
   */
  @java.lang.Override
  public java.lang.String getMessage() {
    return message_;
  }
  /**
   * <pre>
   * A developer-facing error message, which should be in English. Any
   * user-facing error message should be localized and sent in the
   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
   * </pre>
   *
   * <code>string message = 2;</code>
   * @return The bytes for message.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getMessageBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(message_);
  }
  /**
   * <pre>
   * A developer-facing error message, which should be in English. Any
   * user-facing error message should be localized and sent in the
   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
   * </pre>
   *
   * <code>string message = 2;</code>
   * @param value The message to set.
   */
  private void setMessage(
      java.lang.String value) {
    value.getClass();
  
    message_ = value;
  }
  /**
   * <pre>
   * A developer-facing error message, which should be in English. Any
   * user-facing error message should be localized and sent in the
   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
   * </pre>
   *
   * <code>string message = 2;</code>
   */
  private void clearMessage() {
    
    message_ = getDefaultInstance().getMessage();
  }
  /**
   * <pre>
   * A developer-facing error message, which should be in English. Any
   * user-facing error message should be localized and sent in the
   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
   * </pre>
   *
   * <code>string message = 2;</code>
   * @param value The bytes for message to set.
   */
  private void setMessageBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    message_ = value.toStringUtf8();
    
  }

  public static final int DETAILS_FIELD_NUMBER = 3;
  private com.google.protobuf.Internal.ProtobufList<com.google.protobuf.Any> details_;
  /**
   * <pre>
   * A list of messages that carry the error details.  There is a common set of
   * message types for APIs to use.
   * </pre>
   *
   * <code>repeated .google.protobuf.Any details = 3;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.protobuf.Any> getDetailsList() {
    return details_;
  }
  /**
   * <pre>
   * A list of messages that carry the error details.  There is a common set of
   * message types for APIs to use.
   * </pre>
   *
   * <code>repeated .google.protobuf.Any details = 3;</code>
   */
  public java.util.List<? extends com.google.protobuf.AnyOrBuilder> 
      getDetailsOrBuilderList() {
    return details_;
  }
  /**
   * <pre>
   * A list of messages that carry the error details.  There is a common set of
   * message types for APIs to use.
   * </pre>
   *
   * <code>repeated .google.protobuf.Any details = 3;</code>
   */
  @java.lang.Override
  public int getDetailsCount() {
    return details_.size();
  }
  /**
   * <pre>
   * A list of messages that carry the error details.  There is a common set of
   * message types for APIs to use.
   * </pre>
   *
   * <code>repeated .google.protobuf.Any details = 3;</code>
   */
  @java.lang.Override
  public com.google.protobuf.Any getDetails(int index) {
    return details_.get(index);
  }
  /**
   * <pre>
   * A list of messages that carry the error details.  There is a common set of
   * message types for APIs to use.
   * </pre>
   *
   * <code>repeated .google.protobuf.Any details = 3;</code>
   */
  public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(
      int index) {
    return details_.get(index);
  }
  private void ensureDetailsIsMutable() {
    com.google.protobuf.Internal.ProtobufList<com.google.protobuf.Any> tmp = details_;
    if (!tmp.isModifiable()) {
      details_ =
          com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);
     }
  }

  /**
   * <pre>
   * A list of messages that carry the error details.  There is a common set of
   * message types for APIs to use.
   * </pre>
   *
   * <code>repeated .google.protobuf.Any details = 3;</code>
   */
  private void setDetails(
      int index, com.google.protobuf.Any value) {
    value.getClass();
  ensureDetailsIsMutable();
    details_.set(index, value);
  }
  /**
   * <pre>
   * A list of messages that carry the error details.  There is a common set of
   * message types for APIs to use.
   * </pre>
   *
   * <code>repeated .google.protobuf.Any details = 3;</code>
   */
  private void addDetails(com.google.protobuf.Any value) {
    value.getClass();
  ensureDetailsIsMutable();
    details_.add(value);
  }
  /**
   * <pre>
   * A list of messages that carry the error details.  There is a common set of
   * message types for APIs to use.
   * </pre>
   *
   * <code>repeated .google.protobuf.Any details = 3;</code>
   */
  private void addDetails(
      int index, com.google.protobuf.Any value) {
    value.getClass();
  ensureDetailsIsMutable();
    details_.add(index, value);
  }
  /**
   * <pre>
   * A list of messages that carry the error details.  There is a common set of
   * message types for APIs to use.
   * </pre>
   *
   * <code>repeated .google.protobuf.Any details = 3;</code>
   */
  private void addAllDetails(
      java.lang.Iterable<? extends com.google.protobuf.Any> values) {
    ensureDetailsIsMutable();
    com.google.protobuf.AbstractMessageLite.addAll(
        values, details_);
  }
  /**
   * <pre>
   * A list of messages that carry the error details.  There is a common set of
   * message types for APIs to use.
   * </pre>
   *
   * <code>repeated .google.protobuf.Any details = 3;</code>
   */
  private void clearDetails() {
    details_ = emptyProtobufList();
  }
  /**
   * <pre>
   * A list of messages that carry the error details.  There is a common set of
   * message types for APIs to use.
   * </pre>
   *
   * <code>repeated .google.protobuf.Any details = 3;</code>
   */
  private void removeDetails(int index) {
    ensureDetailsIsMutable();
    details_.remove(index);
  }

  public static com.google.rpc.Status parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.rpc.Status parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data, extensionRegistry);
  }
  public static com.google.rpc.Status parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.rpc.Status parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data, extensionRegistry);
  }
  public static com.google.rpc.Status parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.rpc.Status parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data, extensionRegistry);
  }
  public static com.google.rpc.Status parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input);
  }
  public static com.google.rpc.Status parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input, extensionRegistry);
  }
  public static com.google.rpc.Status parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return parseDelimitedFrom(DEFAULT_INSTANCE, input);
  }
  public static com.google.rpc.Status parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
  }
  public static com.google.rpc.Status parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input);
  }
  public static com.google.rpc.Status parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input, extensionRegistry);
  }

  public static Builder newBuilder() {
    return (Builder) DEFAULT_INSTANCE.createBuilder();
  }
  public static Builder newBuilder(com.google.rpc.Status prototype) {
    return (Builder) DEFAULT_INSTANCE.createBuilder(prototype);
  }

  /**
   * <pre>
   * The `Status` type defines a logical error model that is suitable for
   * different programming environments, including REST APIs and RPC APIs. It is
   * used by [gRPC](https://github.com/grpc). Each `Status` message contains
   * three pieces of data: error code, error message, and error details.
   * You can find out more about this error model and how to work with it in the
   * [API Design Guide](https://cloud.google.com/apis/design/errors).
   * </pre>
   *
   * Protobuf type {@code google.rpc.Status}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageLite.Builder<
        com.google.rpc.Status, Builder> implements
      // @@protoc_insertion_point(builder_implements:google.rpc.Status)
      com.google.rpc.StatusOrBuilder {
    // Construct using com.google.rpc.Status.newBuilder()
    private Builder() {
      super(DEFAULT_INSTANCE);
    }


    /**
     * <pre>
     * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
     * </pre>
     *
     * <code>int32 code = 1;</code>
     * @return The code.
     */
    @java.lang.Override
    public int getCode() {
      return instance.getCode();
    }
    /**
     * <pre>
     * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
     * </pre>
     *
     * <code>int32 code = 1;</code>
     * @param value The code to set.
     * @return This builder for chaining.
     */
    public Builder setCode(int value) {
      copyOnWrite();
      instance.setCode(value);
      return this;
    }
    /**
     * <pre>
     * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
     * </pre>
     *
     * <code>int32 code = 1;</code>
     * @return This builder for chaining.
     */
    public Builder clearCode() {
      copyOnWrite();
      instance.clearCode();
      return this;
    }

    /**
     * <pre>
     * A developer-facing error message, which should be in English. Any
     * user-facing error message should be localized and sent in the
     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
     * </pre>
     *
     * <code>string message = 2;</code>
     * @return The message.
     */
    @java.lang.Override
    public java.lang.String getMessage() {
      return instance.getMessage();
    }
    /**
     * <pre>
     * A developer-facing error message, which should be in English. Any
     * user-facing error message should be localized and sent in the
     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
     * </pre>
     *
     * <code>string message = 2;</code>
     * @return The bytes for message.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getMessageBytes() {
      return instance.getMessageBytes();
    }
    /**
     * <pre>
     * A developer-facing error message, which should be in English. Any
     * user-facing error message should be localized and sent in the
     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
     * </pre>
     *
     * <code>string message = 2;</code>
     * @param value The message to set.
     * @return This builder for chaining.
     */
    public Builder setMessage(
        java.lang.String value) {
      copyOnWrite();
      instance.setMessage(value);
      return this;
    }
    /**
     * <pre>
     * A developer-facing error message, which should be in English. Any
     * user-facing error message should be localized and sent in the
     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
     * </pre>
     *
     * <code>string message = 2;</code>
     * @return This builder for chaining.
     */
    public Builder clearMessage() {
      copyOnWrite();
      instance.clearMessage();
      return this;
    }
    /**
     * <pre>
     * A developer-facing error message, which should be in English. Any
     * user-facing error message should be localized and sent in the
     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
     * </pre>
     *
     * <code>string message = 2;</code>
     * @param value The bytes for message to set.
     * @return This builder for chaining.
     */
    public Builder setMessageBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setMessageBytes(value);
      return this;
    }

    /**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    @java.lang.Override
    public java.util.List<com.google.protobuf.Any> getDetailsList() {
      return java.util.Collections.unmodifiableList(
          instance.getDetailsList());
    }
    /**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    @java.lang.Override
    public int getDetailsCount() {
      return instance.getDetailsCount();
    }/**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    @java.lang.Override
    public com.google.protobuf.Any getDetails(int index) {
      return instance.getDetails(index);
    }
    /**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    public Builder setDetails(
        int index, com.google.protobuf.Any value) {
      copyOnWrite();
      instance.setDetails(index, value);
      return this;
    }
    /**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    public Builder setDetails(
        int index, com.google.protobuf.Any.Builder builderForValue) {
      copyOnWrite();
      instance.setDetails(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    public Builder addDetails(com.google.protobuf.Any value) {
      copyOnWrite();
      instance.addDetails(value);
      return this;
    }
    /**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    public Builder addDetails(
        int index, com.google.protobuf.Any value) {
      copyOnWrite();
      instance.addDetails(index, value);
      return this;
    }
    /**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    public Builder addDetails(
        com.google.protobuf.Any.Builder builderForValue) {
      copyOnWrite();
      instance.addDetails(builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    public Builder addDetails(
        int index, com.google.protobuf.Any.Builder builderForValue) {
      copyOnWrite();
      instance.addDetails(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    public Builder addAllDetails(
        java.lang.Iterable<? extends com.google.protobuf.Any> values) {
      copyOnWrite();
      instance.addAllDetails(values);
      return this;
    }
    /**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    public Builder clearDetails() {
      copyOnWrite();
      instance.clearDetails();
      return this;
    }
    /**
     * <pre>
     * A list of messages that carry the error details.  There is a common set of
     * message types for APIs to use.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 3;</code>
     */
    public Builder removeDetails(int index) {
      copyOnWrite();
      instance.removeDetails(index);
      return this;
    }

    // @@protoc_insertion_point(builder_scope:google.rpc.Status)
  }
  @java.lang.Override
  @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
  protected final java.lang.Object dynamicMethod(
      com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
      java.lang.Object arg0, java.lang.Object arg1) {
    switch (method) {
      case NEW_MUTABLE_INSTANCE: {
        return new com.google.rpc.Status();
      }
      case NEW_BUILDER: {
        return new Builder();
      }
      case BUILD_MESSAGE_INFO: {
          java.lang.Object[] objects = new java.lang.Object[] {
            "code_",
            "message_",
            "details_",
            com.google.protobuf.Any.class,
          };
          java.lang.String info =
              "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0001\u0000\u0001\u0004\u0002\u0208" +
              "\u0003\u001b";
          return newMessageInfo(DEFAULT_INSTANCE, info, objects);
      }
      // fall through
      case GET_DEFAULT_INSTANCE: {
        return DEFAULT_INSTANCE;
      }
      case GET_PARSER: {
        com.google.protobuf.Parser<com.google.rpc.Status> parser = PARSER;
        if (parser == null) {
          synchronized (com.google.rpc.Status.class) {
            parser = PARSER;
            if (parser == null) {
              parser =
                  new DefaultInstanceBasedParser<com.google.rpc.Status>(
                      DEFAULT_INSTANCE);
              PARSER = parser;
            }
          }
        }
        return parser;
    }
    case GET_MEMOIZED_IS_INITIALIZED: {
      return (byte) 1;
    }
    case SET_MEMOIZED_IS_INITIALIZED: {
      return null;
    }
    }
    throw new UnsupportedOperationException();
  }


  // @@protoc_insertion_point(class_scope:google.rpc.Status)
  private static final com.google.rpc.Status DEFAULT_INSTANCE;
  static {
    Status defaultInstance = new Status();
    // New instances are implicitly immutable so no need to make
    // immutable.
    DEFAULT_INSTANCE = defaultInstance;
    com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
      Status.class, defaultInstance);
  }

  public static com.google.rpc.Status getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static volatile com.google.protobuf.Parser<Status> PARSER;

  public static com.google.protobuf.Parser<Status> parser() {
    return DEFAULT_INSTANCE.getParserForType();
  }
}

