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

package com.google.rpc;

/**
 * <pre>
 * Describes what preconditions have failed.
 * For example, if an RPC failed because it required the Terms of Service to be
 * acknowledged, it could list the terms of service violation in the
 * PreconditionFailure message.
 * </pre>
 *
 * Protobuf type {@code google.rpc.PreconditionFailure}
 */
public  final class PreconditionFailure extends
    com.google.protobuf.GeneratedMessageLite<
        PreconditionFailure, PreconditionFailure.Builder> implements
    // @@protoc_insertion_point(message_implements:google.rpc.PreconditionFailure)
    PreconditionFailureOrBuilder {
  private PreconditionFailure() {
    violations_ = emptyProtobufList();
  }
  public interface ViolationOrBuilder extends
      // @@protoc_insertion_point(interface_extends:google.rpc.PreconditionFailure.Violation)
      com.google.protobuf.MessageLiteOrBuilder {

    /**
     * <pre>
     * The type of PreconditionFailure. We recommend using a service-specific
     * enum type to define the supported precondition violation subjects. For
     * example, "TOS" for "Terms of Service violation".
     * </pre>
     *
     * <code>string type = 1;</code>
     * @return The type.
     */
    java.lang.String getType();
    /**
     * <pre>
     * The type of PreconditionFailure. We recommend using a service-specific
     * enum type to define the supported precondition violation subjects. For
     * example, "TOS" for "Terms of Service violation".
     * </pre>
     *
     * <code>string type = 1;</code>
     * @return The bytes for type.
     */
    com.google.protobuf.ByteString
        getTypeBytes();

    /**
     * <pre>
     * The subject, relative to the type, that failed.
     * For example, "google.com/cloud" relative to the "TOS" type would indicate
     * which terms of service is being referenced.
     * </pre>
     *
     * <code>string subject = 2;</code>
     * @return The subject.
     */
    java.lang.String getSubject();
    /**
     * <pre>
     * The subject, relative to the type, that failed.
     * For example, "google.com/cloud" relative to the "TOS" type would indicate
     * which terms of service is being referenced.
     * </pre>
     *
     * <code>string subject = 2;</code>
     * @return The bytes for subject.
     */
    com.google.protobuf.ByteString
        getSubjectBytes();

    /**
     * <pre>
     * A description of how the precondition failed. Developers can use this
     * description to understand how to fix the failure.
     * For example: "Terms of service not accepted".
     * </pre>
     *
     * <code>string description = 3;</code>
     * @return The description.
     */
    java.lang.String getDescription();
    /**
     * <pre>
     * A description of how the precondition failed. Developers can use this
     * description to understand how to fix the failure.
     * For example: "Terms of service not accepted".
     * </pre>
     *
     * <code>string description = 3;</code>
     * @return The bytes for description.
     */
    com.google.protobuf.ByteString
        getDescriptionBytes();
  }
  /**
   * <pre>
   * A message type used to describe a single precondition failure.
   * </pre>
   *
   * Protobuf type {@code google.rpc.PreconditionFailure.Violation}
   */
  public  static final class Violation extends
      com.google.protobuf.GeneratedMessageLite<
          Violation, Violation.Builder> implements
      // @@protoc_insertion_point(message_implements:google.rpc.PreconditionFailure.Violation)
      ViolationOrBuilder {
    private Violation() {
      type_ = "";
      subject_ = "";
      description_ = "";
    }
    public static final int TYPE_FIELD_NUMBER = 1;
    private java.lang.String type_;
    /**
     * <pre>
     * The type of PreconditionFailure. We recommend using a service-specific
     * enum type to define the supported precondition violation subjects. For
     * example, "TOS" for "Terms of Service violation".
     * </pre>
     *
     * <code>string type = 1;</code>
     * @return The type.
     */
    @java.lang.Override
    public java.lang.String getType() {
      return type_;
    }
    /**
     * <pre>
     * The type of PreconditionFailure. We recommend using a service-specific
     * enum type to define the supported precondition violation subjects. For
     * example, "TOS" for "Terms of Service violation".
     * </pre>
     *
     * <code>string type = 1;</code>
     * @return The bytes for type.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getTypeBytes() {
      return com.google.protobuf.ByteString.copyFromUtf8(type_);
    }
    /**
     * <pre>
     * The type of PreconditionFailure. We recommend using a service-specific
     * enum type to define the supported precondition violation subjects. For
     * example, "TOS" for "Terms of Service violation".
     * </pre>
     *
     * <code>string type = 1;</code>
     * @param value The type to set.
     */
    private void setType(
        java.lang.String value) {
      value.getClass();
  
      type_ = value;
    }
    /**
     * <pre>
     * The type of PreconditionFailure. We recommend using a service-specific
     * enum type to define the supported precondition violation subjects. For
     * example, "TOS" for "Terms of Service violation".
     * </pre>
     *
     * <code>string type = 1;</code>
     */
    private void clearType() {
      
      type_ = getDefaultInstance().getType();
    }
    /**
     * <pre>
     * The type of PreconditionFailure. We recommend using a service-specific
     * enum type to define the supported precondition violation subjects. For
     * example, "TOS" for "Terms of Service violation".
     * </pre>
     *
     * <code>string type = 1;</code>
     * @param value The bytes for type to set.
     */
    private void setTypeBytes(
        com.google.protobuf.ByteString value) {
      checkByteStringIsUtf8(value);
      type_ = value.toStringUtf8();
      
    }

    public static final int SUBJECT_FIELD_NUMBER = 2;
    private java.lang.String subject_;
    /**
     * <pre>
     * The subject, relative to the type, that failed.
     * For example, "google.com/cloud" relative to the "TOS" type would indicate
     * which terms of service is being referenced.
     * </pre>
     *
     * <code>string subject = 2;</code>
     * @return The subject.
     */
    @java.lang.Override
    public java.lang.String getSubject() {
      return subject_;
    }
    /**
     * <pre>
     * The subject, relative to the type, that failed.
     * For example, "google.com/cloud" relative to the "TOS" type would indicate
     * which terms of service is being referenced.
     * </pre>
     *
     * <code>string subject = 2;</code>
     * @return The bytes for subject.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getSubjectBytes() {
      return com.google.protobuf.ByteString.copyFromUtf8(subject_);
    }
    /**
     * <pre>
     * The subject, relative to the type, that failed.
     * For example, "google.com/cloud" relative to the "TOS" type would indicate
     * which terms of service is being referenced.
     * </pre>
     *
     * <code>string subject = 2;</code>
     * @param value The subject to set.
     */
    private void setSubject(
        java.lang.String value) {
      value.getClass();
  
      subject_ = value;
    }
    /**
     * <pre>
     * The subject, relative to the type, that failed.
     * For example, "google.com/cloud" relative to the "TOS" type would indicate
     * which terms of service is being referenced.
     * </pre>
     *
     * <code>string subject = 2;</code>
     */
    private void clearSubject() {
      
      subject_ = getDefaultInstance().getSubject();
    }
    /**
     * <pre>
     * The subject, relative to the type, that failed.
     * For example, "google.com/cloud" relative to the "TOS" type would indicate
     * which terms of service is being referenced.
     * </pre>
     *
     * <code>string subject = 2;</code>
     * @param value The bytes for subject to set.
     */
    private void setSubjectBytes(
        com.google.protobuf.ByteString value) {
      checkByteStringIsUtf8(value);
      subject_ = value.toStringUtf8();
      
    }

    public static final int DESCRIPTION_FIELD_NUMBER = 3;
    private java.lang.String description_;
    /**
     * <pre>
     * A description of how the precondition failed. Developers can use this
     * description to understand how to fix the failure.
     * For example: "Terms of service not accepted".
     * </pre>
     *
     * <code>string description = 3;</code>
     * @return The description.
     */
    @java.lang.Override
    public java.lang.String getDescription() {
      return description_;
    }
    /**
     * <pre>
     * A description of how the precondition failed. Developers can use this
     * description to understand how to fix the failure.
     * For example: "Terms of service not accepted".
     * </pre>
     *
     * <code>string description = 3;</code>
     * @return The bytes for description.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDescriptionBytes() {
      return com.google.protobuf.ByteString.copyFromUtf8(description_);
    }
    /**
     * <pre>
     * A description of how the precondition failed. Developers can use this
     * description to understand how to fix the failure.
     * For example: "Terms of service not accepted".
     * </pre>
     *
     * <code>string description = 3;</code>
     * @param value The description to set.
     */
    private void setDescription(
        java.lang.String value) {
      value.getClass();
  
      description_ = value;
    }
    /**
     * <pre>
     * A description of how the precondition failed. Developers can use this
     * description to understand how to fix the failure.
     * For example: "Terms of service not accepted".
     * </pre>
     *
     * <code>string description = 3;</code>
     */
    private void clearDescription() {
      
      description_ = getDefaultInstance().getDescription();
    }
    /**
     * <pre>
     * A description of how the precondition failed. Developers can use this
     * description to understand how to fix the failure.
     * For example: "Terms of service not accepted".
     * </pre>
     *
     * <code>string description = 3;</code>
     * @param value The bytes for description to set.
     */
    private void setDescriptionBytes(
        com.google.protobuf.ByteString value) {
      checkByteStringIsUtf8(value);
      description_ = value.toStringUtf8();
      
    }

    public static com.google.rpc.PreconditionFailure.Violation parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return com.google.protobuf.GeneratedMessageLite.parseFrom(
          DEFAULT_INSTANCE, data);
    }
    public static com.google.rpc.PreconditionFailure.Violation 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.PreconditionFailure.Violation 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.PreconditionFailure.Violation 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.PreconditionFailure.Violation parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return com.google.protobuf.GeneratedMessageLite.parseFrom(
          DEFAULT_INSTANCE, data);
    }
    public static com.google.rpc.PreconditionFailure.Violation 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.PreconditionFailure.Violation parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageLite.parseFrom(
          DEFAULT_INSTANCE, input);
    }
    public static com.google.rpc.PreconditionFailure.Violation 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.PreconditionFailure.Violation parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
    }
    public static com.google.rpc.PreconditionFailure.Violation 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.PreconditionFailure.Violation parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageLite.parseFrom(
          DEFAULT_INSTANCE, input);
    }
    public static com.google.rpc.PreconditionFailure.Violation 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.PreconditionFailure.Violation prototype) {
      return (Builder) DEFAULT_INSTANCE.createBuilder(prototype);
    }

    /**
     * <pre>
     * A message type used to describe a single precondition failure.
     * </pre>
     *
     * Protobuf type {@code google.rpc.PreconditionFailure.Violation}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageLite.Builder<
          com.google.rpc.PreconditionFailure.Violation, Builder> implements
        // @@protoc_insertion_point(builder_implements:google.rpc.PreconditionFailure.Violation)
        com.google.rpc.PreconditionFailure.ViolationOrBuilder {
      // Construct using com.google.rpc.PreconditionFailure.Violation.newBuilder()
      private Builder() {
        super(DEFAULT_INSTANCE);
      }


      /**
       * <pre>
       * The type of PreconditionFailure. We recommend using a service-specific
       * enum type to define the supported precondition violation subjects. For
       * example, "TOS" for "Terms of Service violation".
       * </pre>
       *
       * <code>string type = 1;</code>
       * @return The type.
       */
      @java.lang.Override
      public java.lang.String getType() {
        return instance.getType();
      }
      /**
       * <pre>
       * The type of PreconditionFailure. We recommend using a service-specific
       * enum type to define the supported precondition violation subjects. For
       * example, "TOS" for "Terms of Service violation".
       * </pre>
       *
       * <code>string type = 1;</code>
       * @return The bytes for type.
       */
      @java.lang.Override
      public com.google.protobuf.ByteString
          getTypeBytes() {
        return instance.getTypeBytes();
      }
      /**
       * <pre>
       * The type of PreconditionFailure. We recommend using a service-specific
       * enum type to define the supported precondition violation subjects. For
       * example, "TOS" for "Terms of Service violation".
       * </pre>
       *
       * <code>string type = 1;</code>
       * @param value The type to set.
       * @return This builder for chaining.
       */
      public Builder setType(
          java.lang.String value) {
        copyOnWrite();
        instance.setType(value);
        return this;
      }
      /**
       * <pre>
       * The type of PreconditionFailure. We recommend using a service-specific
       * enum type to define the supported precondition violation subjects. For
       * example, "TOS" for "Terms of Service violation".
       * </pre>
       *
       * <code>string type = 1;</code>
       * @return This builder for chaining.
       */
      public Builder clearType() {
        copyOnWrite();
        instance.clearType();
        return this;
      }
      /**
       * <pre>
       * The type of PreconditionFailure. We recommend using a service-specific
       * enum type to define the supported precondition violation subjects. For
       * example, "TOS" for "Terms of Service violation".
       * </pre>
       *
       * <code>string type = 1;</code>
       * @param value The bytes for type to set.
       * @return This builder for chaining.
       */
      public Builder setTypeBytes(
          com.google.protobuf.ByteString value) {
        copyOnWrite();
        instance.setTypeBytes(value);
        return this;
      }

      /**
       * <pre>
       * The subject, relative to the type, that failed.
       * For example, "google.com/cloud" relative to the "TOS" type would indicate
       * which terms of service is being referenced.
       * </pre>
       *
       * <code>string subject = 2;</code>
       * @return The subject.
       */
      @java.lang.Override
      public java.lang.String getSubject() {
        return instance.getSubject();
      }
      /**
       * <pre>
       * The subject, relative to the type, that failed.
       * For example, "google.com/cloud" relative to the "TOS" type would indicate
       * which terms of service is being referenced.
       * </pre>
       *
       * <code>string subject = 2;</code>
       * @return The bytes for subject.
       */
      @java.lang.Override
      public com.google.protobuf.ByteString
          getSubjectBytes() {
        return instance.getSubjectBytes();
      }
      /**
       * <pre>
       * The subject, relative to the type, that failed.
       * For example, "google.com/cloud" relative to the "TOS" type would indicate
       * which terms of service is being referenced.
       * </pre>
       *
       * <code>string subject = 2;</code>
       * @param value The subject to set.
       * @return This builder for chaining.
       */
      public Builder setSubject(
          java.lang.String value) {
        copyOnWrite();
        instance.setSubject(value);
        return this;
      }
      /**
       * <pre>
       * The subject, relative to the type, that failed.
       * For example, "google.com/cloud" relative to the "TOS" type would indicate
       * which terms of service is being referenced.
       * </pre>
       *
       * <code>string subject = 2;</code>
       * @return This builder for chaining.
       */
      public Builder clearSubject() {
        copyOnWrite();
        instance.clearSubject();
        return this;
      }
      /**
       * <pre>
       * The subject, relative to the type, that failed.
       * For example, "google.com/cloud" relative to the "TOS" type would indicate
       * which terms of service is being referenced.
       * </pre>
       *
       * <code>string subject = 2;</code>
       * @param value The bytes for subject to set.
       * @return This builder for chaining.
       */
      public Builder setSubjectBytes(
          com.google.protobuf.ByteString value) {
        copyOnWrite();
        instance.setSubjectBytes(value);
        return this;
      }

      /**
       * <pre>
       * A description of how the precondition failed. Developers can use this
       * description to understand how to fix the failure.
       * For example: "Terms of service not accepted".
       * </pre>
       *
       * <code>string description = 3;</code>
       * @return The description.
       */
      @java.lang.Override
      public java.lang.String getDescription() {
        return instance.getDescription();
      }
      /**
       * <pre>
       * A description of how the precondition failed. Developers can use this
       * description to understand how to fix the failure.
       * For example: "Terms of service not accepted".
       * </pre>
       *
       * <code>string description = 3;</code>
       * @return The bytes for description.
       */
      @java.lang.Override
      public com.google.protobuf.ByteString
          getDescriptionBytes() {
        return instance.getDescriptionBytes();
      }
      /**
       * <pre>
       * A description of how the precondition failed. Developers can use this
       * description to understand how to fix the failure.
       * For example: "Terms of service not accepted".
       * </pre>
       *
       * <code>string description = 3;</code>
       * @param value The description to set.
       * @return This builder for chaining.
       */
      public Builder setDescription(
          java.lang.String value) {
        copyOnWrite();
        instance.setDescription(value);
        return this;
      }
      /**
       * <pre>
       * A description of how the precondition failed. Developers can use this
       * description to understand how to fix the failure.
       * For example: "Terms of service not accepted".
       * </pre>
       *
       * <code>string description = 3;</code>
       * @return This builder for chaining.
       */
      public Builder clearDescription() {
        copyOnWrite();
        instance.clearDescription();
        return this;
      }
      /**
       * <pre>
       * A description of how the precondition failed. Developers can use this
       * description to understand how to fix the failure.
       * For example: "Terms of service not accepted".
       * </pre>
       *
       * <code>string description = 3;</code>
       * @param value The bytes for description to set.
       * @return This builder for chaining.
       */
      public Builder setDescriptionBytes(
          com.google.protobuf.ByteString value) {
        copyOnWrite();
        instance.setDescriptionBytes(value);
        return this;
      }

      // @@protoc_insertion_point(builder_scope:google.rpc.PreconditionFailure.Violation)
    }
    @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.PreconditionFailure.Violation();
        }
        case NEW_BUILDER: {
          return new Builder();
        }
        case BUILD_MESSAGE_INFO: {
            java.lang.Object[] objects = new java.lang.Object[] {
              "type_",
              "subject_",
              "description_",
            };
            java.lang.String info =
                "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\u0208\u0002\u0208" +
                "\u0003\u0208";
            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.PreconditionFailure.Violation> parser = PARSER;
          if (parser == null) {
            synchronized (com.google.rpc.PreconditionFailure.Violation.class) {
              parser = PARSER;
              if (parser == null) {
                parser =
                    new DefaultInstanceBasedParser<com.google.rpc.PreconditionFailure.Violation>(
                        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.PreconditionFailure.Violation)
    private static final com.google.rpc.PreconditionFailure.Violation DEFAULT_INSTANCE;
    static {
      Violation defaultInstance = new Violation();
      // New instances are implicitly immutable so no need to make
      // immutable.
      DEFAULT_INSTANCE = defaultInstance;
      com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
        Violation.class, defaultInstance);
    }

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

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

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

  public static final int VIOLATIONS_FIELD_NUMBER = 1;
  private com.google.protobuf.Internal.ProtobufList<com.google.rpc.PreconditionFailure.Violation> violations_;
  /**
   * <pre>
   * Describes all precondition violations.
   * </pre>
   *
   * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.rpc.PreconditionFailure.Violation> getViolationsList() {
    return violations_;
  }
  /**
   * <pre>
   * Describes all precondition violations.
   * </pre>
   *
   * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
   */
  public java.util.List<? extends com.google.rpc.PreconditionFailure.ViolationOrBuilder> 
      getViolationsOrBuilderList() {
    return violations_;
  }
  /**
   * <pre>
   * Describes all precondition violations.
   * </pre>
   *
   * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
   */
  @java.lang.Override
  public int getViolationsCount() {
    return violations_.size();
  }
  /**
   * <pre>
   * Describes all precondition violations.
   * </pre>
   *
   * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
   */
  @java.lang.Override
  public com.google.rpc.PreconditionFailure.Violation getViolations(int index) {
    return violations_.get(index);
  }
  /**
   * <pre>
   * Describes all precondition violations.
   * </pre>
   *
   * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
   */
  public com.google.rpc.PreconditionFailure.ViolationOrBuilder getViolationsOrBuilder(
      int index) {
    return violations_.get(index);
  }
  private void ensureViolationsIsMutable() {
    com.google.protobuf.Internal.ProtobufList<com.google.rpc.PreconditionFailure.Violation> tmp = violations_;
    if (!tmp.isModifiable()) {
      violations_ =
          com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);
     }
  }

  /**
   * <pre>
   * Describes all precondition violations.
   * </pre>
   *
   * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
   */
  private void setViolations(
      int index, com.google.rpc.PreconditionFailure.Violation value) {
    value.getClass();
  ensureViolationsIsMutable();
    violations_.set(index, value);
  }
  /**
   * <pre>
   * Describes all precondition violations.
   * </pre>
   *
   * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
   */
  private void addViolations(com.google.rpc.PreconditionFailure.Violation value) {
    value.getClass();
  ensureViolationsIsMutable();
    violations_.add(value);
  }
  /**
   * <pre>
   * Describes all precondition violations.
   * </pre>
   *
   * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
   */
  private void addViolations(
      int index, com.google.rpc.PreconditionFailure.Violation value) {
    value.getClass();
  ensureViolationsIsMutable();
    violations_.add(index, value);
  }
  /**
   * <pre>
   * Describes all precondition violations.
   * </pre>
   *
   * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
   */
  private void addAllViolations(
      java.lang.Iterable<? extends com.google.rpc.PreconditionFailure.Violation> values) {
    ensureViolationsIsMutable();
    com.google.protobuf.AbstractMessageLite.addAll(
        values, violations_);
  }
  /**
   * <pre>
   * Describes all precondition violations.
   * </pre>
   *
   * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
   */
  private void clearViolations() {
    violations_ = emptyProtobufList();
  }
  /**
   * <pre>
   * Describes all precondition violations.
   * </pre>
   *
   * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
   */
  private void removeViolations(int index) {
    ensureViolationsIsMutable();
    violations_.remove(index);
  }

  public static com.google.rpc.PreconditionFailure parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.rpc.PreconditionFailure 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.PreconditionFailure 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.PreconditionFailure 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.PreconditionFailure parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.rpc.PreconditionFailure 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.PreconditionFailure parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input);
  }
  public static com.google.rpc.PreconditionFailure 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.PreconditionFailure parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return parseDelimitedFrom(DEFAULT_INSTANCE, input);
  }
  public static com.google.rpc.PreconditionFailure 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.PreconditionFailure parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input);
  }
  public static com.google.rpc.PreconditionFailure 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.PreconditionFailure prototype) {
    return (Builder) DEFAULT_INSTANCE.createBuilder(prototype);
  }

  /**
   * <pre>
   * Describes what preconditions have failed.
   * For example, if an RPC failed because it required the Terms of Service to be
   * acknowledged, it could list the terms of service violation in the
   * PreconditionFailure message.
   * </pre>
   *
   * Protobuf type {@code google.rpc.PreconditionFailure}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageLite.Builder<
        com.google.rpc.PreconditionFailure, Builder> implements
      // @@protoc_insertion_point(builder_implements:google.rpc.PreconditionFailure)
      com.google.rpc.PreconditionFailureOrBuilder {
    // Construct using com.google.rpc.PreconditionFailure.newBuilder()
    private Builder() {
      super(DEFAULT_INSTANCE);
    }


    /**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    @java.lang.Override
    public java.util.List<com.google.rpc.PreconditionFailure.Violation> getViolationsList() {
      return java.util.Collections.unmodifiableList(
          instance.getViolationsList());
    }
    /**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    @java.lang.Override
    public int getViolationsCount() {
      return instance.getViolationsCount();
    }/**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    @java.lang.Override
    public com.google.rpc.PreconditionFailure.Violation getViolations(int index) {
      return instance.getViolations(index);
    }
    /**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    public Builder setViolations(
        int index, com.google.rpc.PreconditionFailure.Violation value) {
      copyOnWrite();
      instance.setViolations(index, value);
      return this;
    }
    /**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    public Builder setViolations(
        int index, com.google.rpc.PreconditionFailure.Violation.Builder builderForValue) {
      copyOnWrite();
      instance.setViolations(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    public Builder addViolations(com.google.rpc.PreconditionFailure.Violation value) {
      copyOnWrite();
      instance.addViolations(value);
      return this;
    }
    /**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    public Builder addViolations(
        int index, com.google.rpc.PreconditionFailure.Violation value) {
      copyOnWrite();
      instance.addViolations(index, value);
      return this;
    }
    /**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    public Builder addViolations(
        com.google.rpc.PreconditionFailure.Violation.Builder builderForValue) {
      copyOnWrite();
      instance.addViolations(builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    public Builder addViolations(
        int index, com.google.rpc.PreconditionFailure.Violation.Builder builderForValue) {
      copyOnWrite();
      instance.addViolations(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    public Builder addAllViolations(
        java.lang.Iterable<? extends com.google.rpc.PreconditionFailure.Violation> values) {
      copyOnWrite();
      instance.addAllViolations(values);
      return this;
    }
    /**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    public Builder clearViolations() {
      copyOnWrite();
      instance.clearViolations();
      return this;
    }
    /**
     * <pre>
     * Describes all precondition violations.
     * </pre>
     *
     * <code>repeated .google.rpc.PreconditionFailure.Violation violations = 1;</code>
     */
    public Builder removeViolations(int index) {
      copyOnWrite();
      instance.removeViolations(index);
      return this;
    }

    // @@protoc_insertion_point(builder_scope:google.rpc.PreconditionFailure)
  }
  @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.PreconditionFailure();
      }
      case NEW_BUILDER: {
        return new Builder();
      }
      case BUILD_MESSAGE_INFO: {
          java.lang.Object[] objects = new java.lang.Object[] {
            "violations_",
            com.google.rpc.PreconditionFailure.Violation.class,
          };
          java.lang.String info =
              "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\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.PreconditionFailure> parser = PARSER;
        if (parser == null) {
          synchronized (com.google.rpc.PreconditionFailure.class) {
            parser = PARSER;
            if (parser == null) {
              parser =
                  new DefaultInstanceBasedParser<com.google.rpc.PreconditionFailure>(
                      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.PreconditionFailure)
  private static final com.google.rpc.PreconditionFailure DEFAULT_INSTANCE;
  static {
    PreconditionFailure defaultInstance = new PreconditionFailure();
    // New instances are implicitly immutable so no need to make
    // immutable.
    DEFAULT_INSTANCE = defaultInstance;
    com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
      PreconditionFailure.class, defaultInstance);
  }

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

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

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

