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

package com.google.rpc;

/**
 * <pre>
 * Describes the cause of the error with structured details.
 * Example of an error when contacting the "pubsub.googleapis.com" API when it
 * is not enabled:
 *     { "reason": "API_DISABLED"
 *       "domain": "googleapis.com"
 *       "metadata": {
 *         "resource": "projects/123",
 *         "service": "pubsub.googleapis.com"
 *       }
 *     }
 * This response indicates that the pubsub.googleapis.com API is not enabled.
 * Example of an error that is returned when attempting to create a Spanner
 * instance in a region that is out of stock:
 *     { "reason": "STOCKOUT"
 *       "domain": "spanner.googleapis.com",
 *       "metadata": {
 *         "availableRegions": "us-central1,us-east2"
 *       }
 *     }
 * </pre>
 *
 * Protobuf type {@code google.rpc.ErrorInfo}
 */
public  final class ErrorInfo extends
    com.google.protobuf.GeneratedMessageLite<
        ErrorInfo, ErrorInfo.Builder> implements
    // @@protoc_insertion_point(message_implements:google.rpc.ErrorInfo)
    ErrorInfoOrBuilder {
  private ErrorInfo() {
    reason_ = "";
    domain_ = "";
  }
  public static final int REASON_FIELD_NUMBER = 1;
  private java.lang.String reason_;
  /**
   * <pre>
   * The reason of the error. This is a constant value that identifies the
   * proximate cause of the error. Error reasons are unique within a particular
   * domain of errors. This should be at most 63 characters and match
   * /[A-Z0-9_]+/.
   * </pre>
   *
   * <code>string reason = 1;</code>
   * @return The reason.
   */
  @java.lang.Override
  public java.lang.String getReason() {
    return reason_;
  }
  /**
   * <pre>
   * The reason of the error. This is a constant value that identifies the
   * proximate cause of the error. Error reasons are unique within a particular
   * domain of errors. This should be at most 63 characters and match
   * /[A-Z0-9_]+/.
   * </pre>
   *
   * <code>string reason = 1;</code>
   * @return The bytes for reason.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getReasonBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(reason_);
  }
  /**
   * <pre>
   * The reason of the error. This is a constant value that identifies the
   * proximate cause of the error. Error reasons are unique within a particular
   * domain of errors. This should be at most 63 characters and match
   * /[A-Z0-9_]+/.
   * </pre>
   *
   * <code>string reason = 1;</code>
   * @param value The reason to set.
   */
  private void setReason(
      java.lang.String value) {
    value.getClass();
  
    reason_ = value;
  }
  /**
   * <pre>
   * The reason of the error. This is a constant value that identifies the
   * proximate cause of the error. Error reasons are unique within a particular
   * domain of errors. This should be at most 63 characters and match
   * /[A-Z0-9_]+/.
   * </pre>
   *
   * <code>string reason = 1;</code>
   */
  private void clearReason() {
    
    reason_ = getDefaultInstance().getReason();
  }
  /**
   * <pre>
   * The reason of the error. This is a constant value that identifies the
   * proximate cause of the error. Error reasons are unique within a particular
   * domain of errors. This should be at most 63 characters and match
   * /[A-Z0-9_]+/.
   * </pre>
   *
   * <code>string reason = 1;</code>
   * @param value The bytes for reason to set.
   */
  private void setReasonBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    reason_ = value.toStringUtf8();
    
  }

  public static final int DOMAIN_FIELD_NUMBER = 2;
  private java.lang.String domain_;
  /**
   * <pre>
   * The logical grouping to which the "reason" belongs. The error domain
   * is typically the registered service name of the tool or product that
   * generates the error. Example: "pubsub.googleapis.com". If the error is
   * generated by some common infrastructure, the error domain must be a
   * globally unique value that identifies the infrastructure. For Google API
   * infrastructure, the error domain is "googleapis.com".
   * </pre>
   *
   * <code>string domain = 2;</code>
   * @return The domain.
   */
  @java.lang.Override
  public java.lang.String getDomain() {
    return domain_;
  }
  /**
   * <pre>
   * The logical grouping to which the "reason" belongs. The error domain
   * is typically the registered service name of the tool or product that
   * generates the error. Example: "pubsub.googleapis.com". If the error is
   * generated by some common infrastructure, the error domain must be a
   * globally unique value that identifies the infrastructure. For Google API
   * infrastructure, the error domain is "googleapis.com".
   * </pre>
   *
   * <code>string domain = 2;</code>
   * @return The bytes for domain.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getDomainBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(domain_);
  }
  /**
   * <pre>
   * The logical grouping to which the "reason" belongs. The error domain
   * is typically the registered service name of the tool or product that
   * generates the error. Example: "pubsub.googleapis.com". If the error is
   * generated by some common infrastructure, the error domain must be a
   * globally unique value that identifies the infrastructure. For Google API
   * infrastructure, the error domain is "googleapis.com".
   * </pre>
   *
   * <code>string domain = 2;</code>
   * @param value The domain to set.
   */
  private void setDomain(
      java.lang.String value) {
    value.getClass();
  
    domain_ = value;
  }
  /**
   * <pre>
   * The logical grouping to which the "reason" belongs. The error domain
   * is typically the registered service name of the tool or product that
   * generates the error. Example: "pubsub.googleapis.com". If the error is
   * generated by some common infrastructure, the error domain must be a
   * globally unique value that identifies the infrastructure. For Google API
   * infrastructure, the error domain is "googleapis.com".
   * </pre>
   *
   * <code>string domain = 2;</code>
   */
  private void clearDomain() {
    
    domain_ = getDefaultInstance().getDomain();
  }
  /**
   * <pre>
   * The logical grouping to which the "reason" belongs. The error domain
   * is typically the registered service name of the tool or product that
   * generates the error. Example: "pubsub.googleapis.com". If the error is
   * generated by some common infrastructure, the error domain must be a
   * globally unique value that identifies the infrastructure. For Google API
   * infrastructure, the error domain is "googleapis.com".
   * </pre>
   *
   * <code>string domain = 2;</code>
   * @param value The bytes for domain to set.
   */
  private void setDomainBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    domain_ = value.toStringUtf8();
    
  }

  public static final int METADATA_FIELD_NUMBER = 3;
  private static final class MetadataDefaultEntryHolder {
    static final com.google.protobuf.MapEntryLite<
        java.lang.String, java.lang.String> defaultEntry =
            com.google.protobuf.MapEntryLite
            .<java.lang.String, java.lang.String>newDefaultInstance(
                com.google.protobuf.WireFormat.FieldType.STRING,
                "",
                com.google.protobuf.WireFormat.FieldType.STRING,
                "");
  }
  private com.google.protobuf.MapFieldLite<
      java.lang.String, java.lang.String> metadata_ =
          com.google.protobuf.MapFieldLite.emptyMapField();
  private com.google.protobuf.MapFieldLite<java.lang.String, java.lang.String>
  internalGetMetadata() {
    return metadata_;
  }
  private com.google.protobuf.MapFieldLite<java.lang.String, java.lang.String>
  internalGetMutableMetadata() {
    if (!metadata_.isMutable()) {
      metadata_ = metadata_.mutableCopy();
    }
    return metadata_;
  }
  @java.lang.Override

  public int getMetadataCount() {
    return internalGetMetadata().size();
  }
  /**
   * <pre>
   * Additional structured details about this error.
   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
   * length. When identifying the current value of an exceeded limit, the units
   * should be contained in the key, not the value.  For example, rather than
   * {"instanceLimit": "100/request"}, should be returned as,
   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
   * instances that can be created in a single (batch) request.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 3;</code>
   */
  @java.lang.Override

  public boolean containsMetadata(
      java.lang.String key) {
    key.getClass();
    return internalGetMetadata().containsKey(key);
  }
  /**
   * Use {@link #getMetadataMap()} instead.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
    return getMetadataMap();
  }
  /**
   * <pre>
   * Additional structured details about this error.
   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
   * length. When identifying the current value of an exceeded limit, the units
   * should be contained in the key, not the value.  For example, rather than
   * {"instanceLimit": "100/request"}, should be returned as,
   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
   * instances that can be created in a single (batch) request.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 3;</code>
   */
  @java.lang.Override

  public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
    return java.util.Collections.unmodifiableMap(
        internalGetMetadata());
  }
  /**
   * <pre>
   * Additional structured details about this error.
   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
   * length. When identifying the current value of an exceeded limit, the units
   * should be contained in the key, not the value.  For example, rather than
   * {"instanceLimit": "100/request"}, should be returned as,
   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
   * instances that can be created in a single (batch) request.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 3;</code>
   */
  @java.lang.Override

  public java.lang.String getMetadataOrDefault(
      java.lang.String key,
      java.lang.String defaultValue) {
    key.getClass();
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetMetadata();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   * <pre>
   * Additional structured details about this error.
   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
   * length. When identifying the current value of an exceeded limit, the units
   * should be contained in the key, not the value.  For example, rather than
   * {"instanceLimit": "100/request"}, should be returned as,
   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
   * instances that can be created in a single (batch) request.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 3;</code>
   */
  @java.lang.Override

  public java.lang.String getMetadataOrThrow(
      java.lang.String key) {
    key.getClass();
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetMetadata();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }
  /**
   * <pre>
   * Additional structured details about this error.
   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
   * length. When identifying the current value of an exceeded limit, the units
   * should be contained in the key, not the value.  For example, rather than
   * {"instanceLimit": "100/request"}, should be returned as,
   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
   * instances that can be created in a single (batch) request.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 3;</code>
   */
  private java.util.Map<java.lang.String, java.lang.String>
  getMutableMetadataMap() {
    return internalGetMutableMetadata();
  }

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

  /**
   * <pre>
   * Describes the cause of the error with structured details.
   * Example of an error when contacting the "pubsub.googleapis.com" API when it
   * is not enabled:
   *     { "reason": "API_DISABLED"
   *       "domain": "googleapis.com"
   *       "metadata": {
   *         "resource": "projects/123",
   *         "service": "pubsub.googleapis.com"
   *       }
   *     }
   * This response indicates that the pubsub.googleapis.com API is not enabled.
   * Example of an error that is returned when attempting to create a Spanner
   * instance in a region that is out of stock:
   *     { "reason": "STOCKOUT"
   *       "domain": "spanner.googleapis.com",
   *       "metadata": {
   *         "availableRegions": "us-central1,us-east2"
   *       }
   *     }
   * </pre>
   *
   * Protobuf type {@code google.rpc.ErrorInfo}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageLite.Builder<
        com.google.rpc.ErrorInfo, Builder> implements
      // @@protoc_insertion_point(builder_implements:google.rpc.ErrorInfo)
      com.google.rpc.ErrorInfoOrBuilder {
    // Construct using com.google.rpc.ErrorInfo.newBuilder()
    private Builder() {
      super(DEFAULT_INSTANCE);
    }


    /**
     * <pre>
     * The reason of the error. This is a constant value that identifies the
     * proximate cause of the error. Error reasons are unique within a particular
     * domain of errors. This should be at most 63 characters and match
     * /[A-Z0-9_]+/.
     * </pre>
     *
     * <code>string reason = 1;</code>
     * @return The reason.
     */
    @java.lang.Override
    public java.lang.String getReason() {
      return instance.getReason();
    }
    /**
     * <pre>
     * The reason of the error. This is a constant value that identifies the
     * proximate cause of the error. Error reasons are unique within a particular
     * domain of errors. This should be at most 63 characters and match
     * /[A-Z0-9_]+/.
     * </pre>
     *
     * <code>string reason = 1;</code>
     * @return The bytes for reason.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getReasonBytes() {
      return instance.getReasonBytes();
    }
    /**
     * <pre>
     * The reason of the error. This is a constant value that identifies the
     * proximate cause of the error. Error reasons are unique within a particular
     * domain of errors. This should be at most 63 characters and match
     * /[A-Z0-9_]+/.
     * </pre>
     *
     * <code>string reason = 1;</code>
     * @param value The reason to set.
     * @return This builder for chaining.
     */
    public Builder setReason(
        java.lang.String value) {
      copyOnWrite();
      instance.setReason(value);
      return this;
    }
    /**
     * <pre>
     * The reason of the error. This is a constant value that identifies the
     * proximate cause of the error. Error reasons are unique within a particular
     * domain of errors. This should be at most 63 characters and match
     * /[A-Z0-9_]+/.
     * </pre>
     *
     * <code>string reason = 1;</code>
     * @return This builder for chaining.
     */
    public Builder clearReason() {
      copyOnWrite();
      instance.clearReason();
      return this;
    }
    /**
     * <pre>
     * The reason of the error. This is a constant value that identifies the
     * proximate cause of the error. Error reasons are unique within a particular
     * domain of errors. This should be at most 63 characters and match
     * /[A-Z0-9_]+/.
     * </pre>
     *
     * <code>string reason = 1;</code>
     * @param value The bytes for reason to set.
     * @return This builder for chaining.
     */
    public Builder setReasonBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setReasonBytes(value);
      return this;
    }

    /**
     * <pre>
     * The logical grouping to which the "reason" belongs. The error domain
     * is typically the registered service name of the tool or product that
     * generates the error. Example: "pubsub.googleapis.com". If the error is
     * generated by some common infrastructure, the error domain must be a
     * globally unique value that identifies the infrastructure. For Google API
     * infrastructure, the error domain is "googleapis.com".
     * </pre>
     *
     * <code>string domain = 2;</code>
     * @return The domain.
     */
    @java.lang.Override
    public java.lang.String getDomain() {
      return instance.getDomain();
    }
    /**
     * <pre>
     * The logical grouping to which the "reason" belongs. The error domain
     * is typically the registered service name of the tool or product that
     * generates the error. Example: "pubsub.googleapis.com". If the error is
     * generated by some common infrastructure, the error domain must be a
     * globally unique value that identifies the infrastructure. For Google API
     * infrastructure, the error domain is "googleapis.com".
     * </pre>
     *
     * <code>string domain = 2;</code>
     * @return The bytes for domain.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDomainBytes() {
      return instance.getDomainBytes();
    }
    /**
     * <pre>
     * The logical grouping to which the "reason" belongs. The error domain
     * is typically the registered service name of the tool or product that
     * generates the error. Example: "pubsub.googleapis.com". If the error is
     * generated by some common infrastructure, the error domain must be a
     * globally unique value that identifies the infrastructure. For Google API
     * infrastructure, the error domain is "googleapis.com".
     * </pre>
     *
     * <code>string domain = 2;</code>
     * @param value The domain to set.
     * @return This builder for chaining.
     */
    public Builder setDomain(
        java.lang.String value) {
      copyOnWrite();
      instance.setDomain(value);
      return this;
    }
    /**
     * <pre>
     * The logical grouping to which the "reason" belongs. The error domain
     * is typically the registered service name of the tool or product that
     * generates the error. Example: "pubsub.googleapis.com". If the error is
     * generated by some common infrastructure, the error domain must be a
     * globally unique value that identifies the infrastructure. For Google API
     * infrastructure, the error domain is "googleapis.com".
     * </pre>
     *
     * <code>string domain = 2;</code>
     * @return This builder for chaining.
     */
    public Builder clearDomain() {
      copyOnWrite();
      instance.clearDomain();
      return this;
    }
    /**
     * <pre>
     * The logical grouping to which the "reason" belongs. The error domain
     * is typically the registered service name of the tool or product that
     * generates the error. Example: "pubsub.googleapis.com". If the error is
     * generated by some common infrastructure, the error domain must be a
     * globally unique value that identifies the infrastructure. For Google API
     * infrastructure, the error domain is "googleapis.com".
     * </pre>
     *
     * <code>string domain = 2;</code>
     * @param value The bytes for domain to set.
     * @return This builder for chaining.
     */
    public Builder setDomainBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setDomainBytes(value);
      return this;
    }

    @java.lang.Override

    public int getMetadataCount() {
      return instance.getMetadataMap().size();
    }
    /**
     * <pre>
     * Additional structured details about this error.
     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
     * length. When identifying the current value of an exceeded limit, the units
     * should be contained in the key, not the value.  For example, rather than
     * {"instanceLimit": "100/request"}, should be returned as,
     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
     * instances that can be created in a single (batch) request.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 3;</code>
     */
    @java.lang.Override

    public boolean containsMetadata(
        java.lang.String key) {
      key.getClass();
      return instance.getMetadataMap().containsKey(key);
    }

    public Builder clearMetadata() {
      copyOnWrite();
      instance.getMutableMetadataMap().clear();
      return this;
    }
    /**
     * <pre>
     * Additional structured details about this error.
     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
     * length. When identifying the current value of an exceeded limit, the units
     * should be contained in the key, not the value.  For example, rather than
     * {"instanceLimit": "100/request"}, should be returned as,
     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
     * instances that can be created in a single (batch) request.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 3;</code>
     */

    public Builder removeMetadata(
        java.lang.String key) {
      key.getClass();
      copyOnWrite();
      instance.getMutableMetadataMap().remove(key);
      return this;
    }
    /**
     * Use {@link #getMetadataMap()} instead.
     */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
      return getMetadataMap();
    }
    /**
     * <pre>
     * Additional structured details about this error.
     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
     * length. When identifying the current value of an exceeded limit, the units
     * should be contained in the key, not the value.  For example, rather than
     * {"instanceLimit": "100/request"}, should be returned as,
     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
     * instances that can be created in a single (batch) request.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 3;</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
      return java.util.Collections.unmodifiableMap(
          instance.getMetadataMap());
    }
    /**
     * <pre>
     * Additional structured details about this error.
     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
     * length. When identifying the current value of an exceeded limit, the units
     * should be contained in the key, not the value.  For example, rather than
     * {"instanceLimit": "100/request"}, should be returned as,
     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
     * instances that can be created in a single (batch) request.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 3;</code>
     */
    @java.lang.Override

    public java.lang.String getMetadataOrDefault(
        java.lang.String key,
        java.lang.String defaultValue) {
      key.getClass();
      java.util.Map<java.lang.String, java.lang.String> map =
          instance.getMetadataMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * Additional structured details about this error.
     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
     * length. When identifying the current value of an exceeded limit, the units
     * should be contained in the key, not the value.  For example, rather than
     * {"instanceLimit": "100/request"}, should be returned as,
     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
     * instances that can be created in a single (batch) request.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 3;</code>
     */
    @java.lang.Override

    public java.lang.String getMetadataOrThrow(
        java.lang.String key) {
      key.getClass();
      java.util.Map<java.lang.String, java.lang.String> map =
          instance.getMetadataMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }
    /**
     * <pre>
     * Additional structured details about this error.
     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
     * length. When identifying the current value of an exceeded limit, the units
     * should be contained in the key, not the value.  For example, rather than
     * {"instanceLimit": "100/request"}, should be returned as,
     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
     * instances that can be created in a single (batch) request.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 3;</code>
     */
    public Builder putMetadata(
        java.lang.String key,
        java.lang.String value) {
      key.getClass();
      value.getClass();
      copyOnWrite();
      instance.getMutableMetadataMap().put(key, value);
      return this;
    }
    /**
     * <pre>
     * Additional structured details about this error.
     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
     * length. When identifying the current value of an exceeded limit, the units
     * should be contained in the key, not the value.  For example, rather than
     * {"instanceLimit": "100/request"}, should be returned as,
     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
     * instances that can be created in a single (batch) request.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 3;</code>
     */
    public Builder putAllMetadata(
        java.util.Map<java.lang.String, java.lang.String> values) {
      copyOnWrite();
      instance.getMutableMetadataMap().putAll(values);
      return this;
    }

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

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

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

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

