/*
 * Copyright 2025 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: schema/google/showcase/v1beta1/rest_error.proto

package com.google.showcase.v1beta1;

/**
 *
 *
 * <pre>
 * HTTP/JSON error representation as defined in
 * https://google.aip.dev/193#http11json-representation,
 * </pre>
 *
 * Protobuf type {@code google.showcase.v1beta1.RestError}
 */
public final class RestError extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RestError)
    RestErrorOrBuilder {
  private static final long serialVersionUID = 0L;

  // Use RestError.newBuilder() to construct.
  private RestError(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private RestError() {}

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

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

  private RestError(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              com.google.showcase.v1beta1.RestError.Status.Builder subBuilder = null;
              if (error_ != null) {
                subBuilder = error_.toBuilder();
              }
              error_ =
                  input.readMessage(
                      com.google.showcase.v1beta1.RestError.Status.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(error_);
                error_ = subBuilder.buildPartial();
              }

              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (com.google.protobuf.UninitializedMessageException e) {
      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.showcase.v1beta1.RestErrorOuterClass
        .internal_static_google_showcase_v1beta1_RestError_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.showcase.v1beta1.RestErrorOuterClass
        .internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.showcase.v1beta1.RestError.class,
            com.google.showcase.v1beta1.RestError.Builder.class);
  }

  public interface StatusOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RestError.Status)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * The HTTP status code that corresponds to `google.rpc.Status.code`.
     * </pre>
     *
     * <code>int32 code = 1;</code>
     *
     * @return The code.
     */
    int getCode();

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.message`.
     * </pre>
     *
     * <code>string message = 2;</code>
     *
     * @return The message.
     */
    java.lang.String getMessage();

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.message`.
     * </pre>
     *
     * <code>string message = 2;</code>
     *
     * @return The bytes for message.
     */
    com.google.protobuf.ByteString getMessageBytes();

    /**
     *
     *
     * <pre>
     * This is the enum version for `google.rpc.Status.code`.
     * </pre>
     *
     * <code>.google.rpc.Code status = 4;</code>
     *
     * @return The enum numeric value on the wire for status.
     */
    int getStatusValue();

    /**
     *
     *
     * <pre>
     * This is the enum version for `google.rpc.Status.code`.
     * </pre>
     *
     * <code>.google.rpc.Code status = 4;</code>
     *
     * @return The status.
     */
    com.google.rpc.Code getStatus();

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.details`.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 5;</code>
     */
    java.util.List<com.google.protobuf.Any> getDetailsList();

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.details`.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 5;</code>
     */
    com.google.protobuf.Any getDetails(int index);

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.details`.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 5;</code>
     */
    int getDetailsCount();

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.details`.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 5;</code>
     */
    java.util.List<? extends com.google.protobuf.AnyOrBuilder> getDetailsOrBuilderList();

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.details`.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 5;</code>
     */
    com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index);
  }

  /** Protobuf type {@code google.showcase.v1beta1.RestError.Status} */
  public static final class Status extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RestError.Status)
      StatusOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use Status.newBuilder() to construct.
    private Status(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private Status() {
      message_ = "";
      status_ = 0;
      details_ = java.util.Collections.emptyList();
    }

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

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

    private Status(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 8:
              {
                code_ = input.readInt32();
                break;
              }
            case 18:
              {
                java.lang.String s = input.readStringRequireUtf8();

                message_ = s;
                break;
              }
            case 32:
              {
                int rawValue = input.readEnum();

                status_ = rawValue;
                break;
              }
            case 42:
              {
                if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                  details_ = new java.util.ArrayList<com.google.protobuf.Any>();
                  mutable_bitField0_ |= 0x00000001;
                }
                details_.add(
                    input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry));
                break;
              }
            default:
              {
                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                  done = true;
                }
                break;
              }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (com.google.protobuf.UninitializedMessageException e) {
        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000001) != 0)) {
          details_ = java.util.Collections.unmodifiableList(details_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.showcase.v1beta1.RestErrorOuterClass
          .internal_static_google_showcase_v1beta1_RestError_Status_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.showcase.v1beta1.RestErrorOuterClass
          .internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.showcase.v1beta1.RestError.Status.class,
              com.google.showcase.v1beta1.RestError.Status.Builder.class);
    }

    public static final int CODE_FIELD_NUMBER = 1;
    private int code_;

    /**
     *
     *
     * <pre>
     * The HTTP status code that corresponds to `google.rpc.Status.code`.
     * </pre>
     *
     * <code>int32 code = 1;</code>
     *
     * @return The code.
     */
    @java.lang.Override
    public int getCode() {
      return code_;
    }

    public static final int MESSAGE_FIELD_NUMBER = 2;
    private volatile java.lang.Object message_;

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.message`.
     * </pre>
     *
     * <code>string message = 2;</code>
     *
     * @return The message.
     */
    @java.lang.Override
    public java.lang.String getMessage() {
      java.lang.Object ref = message_;
      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();
        message_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.message`.
     * </pre>
     *
     * <code>string message = 2;</code>
     *
     * @return The bytes for message.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getMessageBytes() {
      java.lang.Object ref = message_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        message_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int STATUS_FIELD_NUMBER = 4;
    private int status_;

    /**
     *
     *
     * <pre>
     * This is the enum version for `google.rpc.Status.code`.
     * </pre>
     *
     * <code>.google.rpc.Code status = 4;</code>
     *
     * @return The enum numeric value on the wire for status.
     */
    @java.lang.Override
    public int getStatusValue() {
      return status_;
    }

    /**
     *
     *
     * <pre>
     * This is the enum version for `google.rpc.Status.code`.
     * </pre>
     *
     * <code>.google.rpc.Code status = 4;</code>
     *
     * @return The status.
     */
    @java.lang.Override
    public com.google.rpc.Code getStatus() {
      @SuppressWarnings("deprecation")
      com.google.rpc.Code result = com.google.rpc.Code.valueOf(status_);
      return result == null ? com.google.rpc.Code.UNRECOGNIZED : result;
    }

    public static final int DETAILS_FIELD_NUMBER = 5;
    private java.util.List<com.google.protobuf.Any> details_;

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.details`.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 5;</code>
     */
    @java.lang.Override
    public java.util.List<com.google.protobuf.Any> getDetailsList() {
      return details_;
    }

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.details`.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 5;</code>
     */
    @java.lang.Override
    public java.util.List<? extends com.google.protobuf.AnyOrBuilder> getDetailsOrBuilderList() {
      return details_;
    }

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.details`.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 5;</code>
     */
    @java.lang.Override
    public int getDetailsCount() {
      return details_.size();
    }

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.details`.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 5;</code>
     */
    @java.lang.Override
    public com.google.protobuf.Any getDetails(int index) {
      return details_.get(index);
    }

    /**
     *
     *
     * <pre>
     * This corresponds to `google.rpc.Status.details`.
     * </pre>
     *
     * <code>repeated .google.protobuf.Any details = 5;</code>
     */
    @java.lang.Override
    public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) {
      return details_.get(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 (code_ != 0) {
        output.writeInt32(1, code_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_);
      }
      if (status_ != com.google.rpc.Code.OK.getNumber()) {
        output.writeEnum(4, status_);
      }
      for (int i = 0; i < details_.size(); i++) {
        output.writeMessage(5, details_.get(i));
      }
      unknownFields.writeTo(output);
    }

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

      size = 0;
      if (code_ != 0) {
        size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, code_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_);
      }
      if (status_ != com.google.rpc.Code.OK.getNumber()) {
        size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, status_);
      }
      for (int i = 0; i < details_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, details_.get(i));
      }
      size += unknownFields.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.showcase.v1beta1.RestError.Status)) {
        return super.equals(obj);
      }
      com.google.showcase.v1beta1.RestError.Status other =
          (com.google.showcase.v1beta1.RestError.Status) obj;

      if (getCode() != other.getCode()) return false;
      if (!getMessage().equals(other.getMessage())) return false;
      if (status_ != other.status_) return false;
      if (!getDetailsList().equals(other.getDetailsList())) return false;
      if (!unknownFields.equals(other.unknownFields)) 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) + CODE_FIELD_NUMBER;
      hash = (53 * hash) + getCode();
      hash = (37 * hash) + MESSAGE_FIELD_NUMBER;
      hash = (53 * hash) + getMessage().hashCode();
      hash = (37 * hash) + STATUS_FIELD_NUMBER;
      hash = (53 * hash) + status_;
      if (getDetailsCount() > 0) {
        hash = (37 * hash) + DETAILS_FIELD_NUMBER;
        hash = (53 * hash) + getDetailsList().hashCode();
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.showcase.v1beta1.RestError.Status parseFrom(java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.showcase.v1beta1.RestError.Status parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.showcase.v1beta1.RestError.Status parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.showcase.v1beta1.RestError.Status parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.showcase.v1beta1.RestError.Status parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status 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;
    }

    /** Protobuf type {@code google.showcase.v1beta1.RestError.Status} */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RestError.Status)
        com.google.showcase.v1beta1.RestError.StatusOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.showcase.v1beta1.RestErrorOuterClass
            .internal_static_google_showcase_v1beta1_RestError_Status_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.showcase.v1beta1.RestErrorOuterClass
            .internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.showcase.v1beta1.RestError.Status.class,
                com.google.showcase.v1beta1.RestError.Status.Builder.class);
      }

      // Construct using com.google.showcase.v1beta1.RestError.Status.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

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

      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
          getDetailsFieldBuilder();
        }
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        code_ = 0;

        message_ = "";

        status_ = 0;

        if (detailsBuilder_ == null) {
          details_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          detailsBuilder_.clear();
        }
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.showcase.v1beta1.RestErrorOuterClass
            .internal_static_google_showcase_v1beta1_RestError_Status_descriptor;
      }

      @java.lang.Override
      public com.google.showcase.v1beta1.RestError.Status getDefaultInstanceForType() {
        return com.google.showcase.v1beta1.RestError.Status.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.showcase.v1beta1.RestError.Status build() {
        com.google.showcase.v1beta1.RestError.Status result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.showcase.v1beta1.RestError.Status buildPartial() {
        com.google.showcase.v1beta1.RestError.Status result =
            new com.google.showcase.v1beta1.RestError.Status(this);
        int from_bitField0_ = bitField0_;
        result.code_ = code_;
        result.message_ = message_;
        result.status_ = status_;
        if (detailsBuilder_ == null) {
          if (((bitField0_ & 0x00000001) != 0)) {
            details_ = java.util.Collections.unmodifiableList(details_);
            bitField0_ = (bitField0_ & ~0x00000001);
          }
          result.details_ = details_;
        } else {
          result.details_ = detailsBuilder_.build();
        }
        onBuilt();
        return result;
      }

      @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.showcase.v1beta1.RestError.Status) {
          return mergeFrom((com.google.showcase.v1beta1.RestError.Status) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.showcase.v1beta1.RestError.Status other) {
        if (other == com.google.showcase.v1beta1.RestError.Status.getDefaultInstance()) return this;
        if (other.getCode() != 0) {
          setCode(other.getCode());
        }
        if (!other.getMessage().isEmpty()) {
          message_ = other.message_;
          onChanged();
        }
        if (other.status_ != 0) {
          setStatusValue(other.getStatusValue());
        }
        if (detailsBuilder_ == null) {
          if (!other.details_.isEmpty()) {
            if (details_.isEmpty()) {
              details_ = other.details_;
              bitField0_ = (bitField0_ & ~0x00000001);
            } else {
              ensureDetailsIsMutable();
              details_.addAll(other.details_);
            }
            onChanged();
          }
        } else {
          if (!other.details_.isEmpty()) {
            if (detailsBuilder_.isEmpty()) {
              detailsBuilder_.dispose();
              detailsBuilder_ = null;
              details_ = other.details_;
              bitField0_ = (bitField0_ & ~0x00000001);
              detailsBuilder_ =
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                      ? getDetailsFieldBuilder()
                      : null;
            } else {
              detailsBuilder_.addAllMessages(other.details_);
            }
          }
        }
        this.mergeUnknownFields(other.unknownFields);
        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 {
        com.google.showcase.v1beta1.RestError.Status parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (com.google.showcase.v1beta1.RestError.Status) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private int bitField0_;

      private int code_;

      /**
       *
       *
       * <pre>
       * The HTTP status code that corresponds to `google.rpc.Status.code`.
       * </pre>
       *
       * <code>int32 code = 1;</code>
       *
       * @return The code.
       */
      @java.lang.Override
      public int getCode() {
        return code_;
      }

      /**
       *
       *
       * <pre>
       * The HTTP status code that corresponds to `google.rpc.Status.code`.
       * </pre>
       *
       * <code>int32 code = 1;</code>
       *
       * @param value The code to set.
       * @return This builder for chaining.
       */
      public Builder setCode(int value) {

        code_ = value;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * The HTTP status code that corresponds to `google.rpc.Status.code`.
       * </pre>
       *
       * <code>int32 code = 1;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearCode() {

        code_ = 0;
        onChanged();
        return this;
      }

      private java.lang.Object message_ = "";

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.message`.
       * </pre>
       *
       * <code>string message = 2;</code>
       *
       * @return The message.
       */
      public java.lang.String getMessage() {
        java.lang.Object ref = message_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          message_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.message`.
       * </pre>
       *
       * <code>string message = 2;</code>
       *
       * @return The bytes for message.
       */
      public com.google.protobuf.ByteString getMessageBytes() {
        java.lang.Object ref = message_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          message_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.message`.
       * </pre>
       *
       * <code>string message = 2;</code>
       *
       * @param value The message to set.
       * @return This builder for chaining.
       */
      public Builder setMessage(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }

        message_ = value;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.message`.
       * </pre>
       *
       * <code>string message = 2;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearMessage() {

        message_ = getDefaultInstance().getMessage();
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.message`.
       * </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) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);

        message_ = value;
        onChanged();
        return this;
      }

      private int status_ = 0;

      /**
       *
       *
       * <pre>
       * This is the enum version for `google.rpc.Status.code`.
       * </pre>
       *
       * <code>.google.rpc.Code status = 4;</code>
       *
       * @return The enum numeric value on the wire for status.
       */
      @java.lang.Override
      public int getStatusValue() {
        return status_;
      }

      /**
       *
       *
       * <pre>
       * This is the enum version for `google.rpc.Status.code`.
       * </pre>
       *
       * <code>.google.rpc.Code status = 4;</code>
       *
       * @param value The enum numeric value on the wire for status to set.
       * @return This builder for chaining.
       */
      public Builder setStatusValue(int value) {

        status_ = value;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * This is the enum version for `google.rpc.Status.code`.
       * </pre>
       *
       * <code>.google.rpc.Code status = 4;</code>
       *
       * @return The status.
       */
      @java.lang.Override
      public com.google.rpc.Code getStatus() {
        @SuppressWarnings("deprecation")
        com.google.rpc.Code result = com.google.rpc.Code.valueOf(status_);
        return result == null ? com.google.rpc.Code.UNRECOGNIZED : result;
      }

      /**
       *
       *
       * <pre>
       * This is the enum version for `google.rpc.Status.code`.
       * </pre>
       *
       * <code>.google.rpc.Code status = 4;</code>
       *
       * @param value The status to set.
       * @return This builder for chaining.
       */
      public Builder setStatus(com.google.rpc.Code value) {
        if (value == null) {
          throw new NullPointerException();
        }

        status_ = value.getNumber();
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * This is the enum version for `google.rpc.Status.code`.
       * </pre>
       *
       * <code>.google.rpc.Code status = 4;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearStatus() {

        status_ = 0;
        onChanged();
        return this;
      }

      private java.util.List<com.google.protobuf.Any> details_ = java.util.Collections.emptyList();

      private void ensureDetailsIsMutable() {
        if (!((bitField0_ & 0x00000001) != 0)) {
          details_ = new java.util.ArrayList<com.google.protobuf.Any>(details_);
          bitField0_ |= 0x00000001;
        }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.protobuf.Any,
              com.google.protobuf.Any.Builder,
              com.google.protobuf.AnyOrBuilder>
          detailsBuilder_;

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public java.util.List<com.google.protobuf.Any> getDetailsList() {
        if (detailsBuilder_ == null) {
          return java.util.Collections.unmodifiableList(details_);
        } else {
          return detailsBuilder_.getMessageList();
        }
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public int getDetailsCount() {
        if (detailsBuilder_ == null) {
          return details_.size();
        } else {
          return detailsBuilder_.getCount();
        }
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public com.google.protobuf.Any getDetails(int index) {
        if (detailsBuilder_ == null) {
          return details_.get(index);
        } else {
          return detailsBuilder_.getMessage(index);
        }
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public Builder setDetails(int index, com.google.protobuf.Any value) {
        if (detailsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureDetailsIsMutable();
          details_.set(index, value);
          onChanged();
        } else {
          detailsBuilder_.setMessage(index, value);
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public Builder setDetails(int index, com.google.protobuf.Any.Builder builderForValue) {
        if (detailsBuilder_ == null) {
          ensureDetailsIsMutable();
          details_.set(index, builderForValue.build());
          onChanged();
        } else {
          detailsBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public Builder addDetails(com.google.protobuf.Any value) {
        if (detailsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureDetailsIsMutable();
          details_.add(value);
          onChanged();
        } else {
          detailsBuilder_.addMessage(value);
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public Builder addDetails(int index, com.google.protobuf.Any value) {
        if (detailsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureDetailsIsMutable();
          details_.add(index, value);
          onChanged();
        } else {
          detailsBuilder_.addMessage(index, value);
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public Builder addDetails(com.google.protobuf.Any.Builder builderForValue) {
        if (detailsBuilder_ == null) {
          ensureDetailsIsMutable();
          details_.add(builderForValue.build());
          onChanged();
        } else {
          detailsBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public Builder addDetails(int index, com.google.protobuf.Any.Builder builderForValue) {
        if (detailsBuilder_ == null) {
          ensureDetailsIsMutable();
          details_.add(index, builderForValue.build());
          onChanged();
        } else {
          detailsBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public Builder addAllDetails(java.lang.Iterable<? extends com.google.protobuf.Any> values) {
        if (detailsBuilder_ == null) {
          ensureDetailsIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(values, details_);
          onChanged();
        } else {
          detailsBuilder_.addAllMessages(values);
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public Builder clearDetails() {
        if (detailsBuilder_ == null) {
          details_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
        } else {
          detailsBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public Builder removeDetails(int index) {
        if (detailsBuilder_ == null) {
          ensureDetailsIsMutable();
          details_.remove(index);
          onChanged();
        } else {
          detailsBuilder_.remove(index);
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public com.google.protobuf.Any.Builder getDetailsBuilder(int index) {
        return getDetailsFieldBuilder().getBuilder(index);
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) {
        if (detailsBuilder_ == null) {
          return details_.get(index);
        } else {
          return detailsBuilder_.getMessageOrBuilder(index);
        }
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public java.util.List<? extends com.google.protobuf.AnyOrBuilder> getDetailsOrBuilderList() {
        if (detailsBuilder_ != null) {
          return detailsBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(details_);
        }
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public com.google.protobuf.Any.Builder addDetailsBuilder() {
        return getDetailsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance());
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public com.google.protobuf.Any.Builder addDetailsBuilder(int index) {
        return getDetailsFieldBuilder()
            .addBuilder(index, com.google.protobuf.Any.getDefaultInstance());
      }

      /**
       *
       *
       * <pre>
       * This corresponds to `google.rpc.Status.details`.
       * </pre>
       *
       * <code>repeated .google.protobuf.Any details = 5;</code>
       */
      public java.util.List<com.google.protobuf.Any.Builder> getDetailsBuilderList() {
        return getDetailsFieldBuilder().getBuilderList();
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.protobuf.Any,
              com.google.protobuf.Any.Builder,
              com.google.protobuf.AnyOrBuilder>
          getDetailsFieldBuilder() {
        if (detailsBuilder_ == null) {
          detailsBuilder_ =
              new com.google.protobuf.RepeatedFieldBuilderV3<
                  com.google.protobuf.Any,
                  com.google.protobuf.Any.Builder,
                  com.google.protobuf.AnyOrBuilder>(
                  details_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
          details_ = null;
        }
        return detailsBuilder_;
      }

      @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.showcase.v1beta1.RestError.Status)
    }

    // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RestError.Status)
    private static final com.google.showcase.v1beta1.RestError.Status DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RestError.Status();
    }

    public static com.google.showcase.v1beta1.RestError.Status getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<Status> PARSER =
        new com.google.protobuf.AbstractParser<Status>() {
          @java.lang.Override
          public Status parsePartialFrom(
              com.google.protobuf.CodedInputStream input,
              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws com.google.protobuf.InvalidProtocolBufferException {
            return new Status(input, extensionRegistry);
          }
        };

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

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

    @java.lang.Override
    public com.google.showcase.v1beta1.RestError.Status getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public static final int ERROR_FIELD_NUMBER = 1;
  private com.google.showcase.v1beta1.RestError.Status error_;

  /**
   * <code>.google.showcase.v1beta1.RestError.Status error = 1;</code>
   *
   * @return Whether the error field is set.
   */
  @java.lang.Override
  public boolean hasError() {
    return error_ != null;
  }

  /**
   * <code>.google.showcase.v1beta1.RestError.Status error = 1;</code>
   *
   * @return The error.
   */
  @java.lang.Override
  public com.google.showcase.v1beta1.RestError.Status getError() {
    return error_ == null
        ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance()
        : error_;
  }

  /** <code>.google.showcase.v1beta1.RestError.Status error = 1;</code> */
  @java.lang.Override
  public com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder() {
    return getError();
  }

  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 (error_ != null) {
      output.writeMessage(1, getError());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (error_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getError());
    }
    size += unknownFields.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.showcase.v1beta1.RestError)) {
      return super.equals(obj);
    }
    com.google.showcase.v1beta1.RestError other = (com.google.showcase.v1beta1.RestError) obj;

    if (hasError() != other.hasError()) return false;
    if (hasError()) {
      if (!getError().equals(other.getError())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasError()) {
      hash = (37 * hash) + ERROR_FIELD_NUMBER;
      hash = (53 * hash) + getError().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.showcase.v1beta1.RestError parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.showcase.v1beta1.RestError parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.showcase.v1beta1.RestError parseFrom(com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.showcase.v1beta1.RestError parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.showcase.v1beta1.RestError parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError 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>
   * HTTP/JSON error representation as defined in
   * https://google.aip.dev/193#http11json-representation,
   * </pre>
   *
   * Protobuf type {@code google.showcase.v1beta1.RestError}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RestError)
      com.google.showcase.v1beta1.RestErrorOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.showcase.v1beta1.RestErrorOuterClass
          .internal_static_google_showcase_v1beta1_RestError_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.showcase.v1beta1.RestErrorOuterClass
          .internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.showcase.v1beta1.RestError.class,
              com.google.showcase.v1beta1.RestError.Builder.class);
    }

    // Construct using com.google.showcase.v1beta1.RestError.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (errorBuilder_ == null) {
        error_ = null;
      } else {
        error_ = null;
        errorBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.showcase.v1beta1.RestErrorOuterClass
          .internal_static_google_showcase_v1beta1_RestError_descriptor;
    }

    @java.lang.Override
    public com.google.showcase.v1beta1.RestError getDefaultInstanceForType() {
      return com.google.showcase.v1beta1.RestError.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.showcase.v1beta1.RestError build() {
      com.google.showcase.v1beta1.RestError result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.showcase.v1beta1.RestError buildPartial() {
      com.google.showcase.v1beta1.RestError result =
          new com.google.showcase.v1beta1.RestError(this);
      if (errorBuilder_ == null) {
        result.error_ = error_;
      } else {
        result.error_ = errorBuilder_.build();
      }
      onBuilt();
      return result;
    }

    @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.showcase.v1beta1.RestError) {
        return mergeFrom((com.google.showcase.v1beta1.RestError) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.showcase.v1beta1.RestError other) {
      if (other == com.google.showcase.v1beta1.RestError.getDefaultInstance()) return this;
      if (other.hasError()) {
        mergeError(other.getError());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.showcase.v1beta1.RestError parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.showcase.v1beta1.RestError) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private com.google.showcase.v1beta1.RestError.Status error_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.showcase.v1beta1.RestError.Status,
            com.google.showcase.v1beta1.RestError.Status.Builder,
            com.google.showcase.v1beta1.RestError.StatusOrBuilder>
        errorBuilder_;

    /**
     * <code>.google.showcase.v1beta1.RestError.Status error = 1;</code>
     *
     * @return Whether the error field is set.
     */
    public boolean hasError() {
      return errorBuilder_ != null || error_ != null;
    }

    /**
     * <code>.google.showcase.v1beta1.RestError.Status error = 1;</code>
     *
     * @return The error.
     */
    public com.google.showcase.v1beta1.RestError.Status getError() {
      if (errorBuilder_ == null) {
        return error_ == null
            ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance()
            : error_;
      } else {
        return errorBuilder_.getMessage();
      }
    }

    /** <code>.google.showcase.v1beta1.RestError.Status error = 1;</code> */
    public Builder setError(com.google.showcase.v1beta1.RestError.Status value) {
      if (errorBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        error_ = value;
        onChanged();
      } else {
        errorBuilder_.setMessage(value);
      }

      return this;
    }

    /** <code>.google.showcase.v1beta1.RestError.Status error = 1;</code> */
    public Builder setError(com.google.showcase.v1beta1.RestError.Status.Builder builderForValue) {
      if (errorBuilder_ == null) {
        error_ = builderForValue.build();
        onChanged();
      } else {
        errorBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }

    /** <code>.google.showcase.v1beta1.RestError.Status error = 1;</code> */
    public Builder mergeError(com.google.showcase.v1beta1.RestError.Status value) {
      if (errorBuilder_ == null) {
        if (error_ != null) {
          error_ =
              com.google.showcase.v1beta1.RestError.Status.newBuilder(error_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          error_ = value;
        }
        onChanged();
      } else {
        errorBuilder_.mergeFrom(value);
      }

      return this;
    }

    /** <code>.google.showcase.v1beta1.RestError.Status error = 1;</code> */
    public Builder clearError() {
      if (errorBuilder_ == null) {
        error_ = null;
        onChanged();
      } else {
        error_ = null;
        errorBuilder_ = null;
      }

      return this;
    }

    /** <code>.google.showcase.v1beta1.RestError.Status error = 1;</code> */
    public com.google.showcase.v1beta1.RestError.Status.Builder getErrorBuilder() {

      onChanged();
      return getErrorFieldBuilder().getBuilder();
    }

    /** <code>.google.showcase.v1beta1.RestError.Status error = 1;</code> */
    public com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder() {
      if (errorBuilder_ != null) {
        return errorBuilder_.getMessageOrBuilder();
      } else {
        return error_ == null
            ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance()
            : error_;
      }
    }

    /** <code>.google.showcase.v1beta1.RestError.Status error = 1;</code> */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.showcase.v1beta1.RestError.Status,
            com.google.showcase.v1beta1.RestError.Status.Builder,
            com.google.showcase.v1beta1.RestError.StatusOrBuilder>
        getErrorFieldBuilder() {
      if (errorBuilder_ == null) {
        errorBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.showcase.v1beta1.RestError.Status,
                com.google.showcase.v1beta1.RestError.Status.Builder,
                com.google.showcase.v1beta1.RestError.StatusOrBuilder>(
                getError(), getParentForChildren(), isClean());
        error_ = null;
      }
      return errorBuilder_;
    }

    @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.showcase.v1beta1.RestError)
  }

  // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RestError)
  private static final com.google.showcase.v1beta1.RestError DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RestError();
  }

  public static com.google.showcase.v1beta1.RestError getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<RestError> PARSER =
      new com.google.protobuf.AbstractParser<RestError>() {
        @java.lang.Override
        public RestError parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new RestError(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.showcase.v1beta1.RestError getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
