/*
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/devtools/clouderrorreporting/v1beta1/common.proto

package com.google.devtools.clouderrorreporting.v1beta1;

/**
 *
 *
 * <pre>
 * HTTP request data that is related to a reported error.
 * This data should be provided by the application when reporting an error,
 * unless the
 * error report has been generated automatically from Google App Engine logs.
 * </pre>
 *
 * Protobuf type {@code google.devtools.clouderrorreporting.v1beta1.HttpRequestContext}
 */
public final class HttpRequestContext extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.devtools.clouderrorreporting.v1beta1.HttpRequestContext)
    HttpRequestContextOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use HttpRequestContext.newBuilder() to construct.
  private HttpRequestContext(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private HttpRequestContext() {
    method_ = "";
    url_ = "";
    userAgent_ = "";
    referrer_ = "";
    remoteIp_ = "";
  }

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.devtools.clouderrorreporting.v1beta1.CommonProto
        .internal_static_google_devtools_clouderrorreporting_v1beta1_HttpRequestContext_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.devtools.clouderrorreporting.v1beta1.CommonProto
        .internal_static_google_devtools_clouderrorreporting_v1beta1_HttpRequestContext_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext.class,
            com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext.Builder.class);
  }

  public static final int METHOD_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object method_ = "";
  /**
   *
   *
   * <pre>
   * The type of HTTP request, such as `GET`, `POST`, etc.
   * </pre>
   *
   * <code>string method = 1;</code>
   *
   * @return The method.
   */
  @java.lang.Override
  public java.lang.String getMethod() {
    java.lang.Object ref = method_;
    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();
      method_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The type of HTTP request, such as `GET`, `POST`, etc.
   * </pre>
   *
   * <code>string method = 1;</code>
   *
   * @return The bytes for method.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getMethodBytes() {
    java.lang.Object ref = method_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      method_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int URL_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object url_ = "";
  /**
   *
   *
   * <pre>
   * The URL of the request.
   * </pre>
   *
   * <code>string url = 2;</code>
   *
   * @return The url.
   */
  @java.lang.Override
  public java.lang.String getUrl() {
    java.lang.Object ref = url_;
    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();
      url_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The URL of the request.
   * </pre>
   *
   * <code>string url = 2;</code>
   *
   * @return The bytes for url.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getUrlBytes() {
    java.lang.Object ref = url_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      url_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int USER_AGENT_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object userAgent_ = "";
  /**
   *
   *
   * <pre>
   * The user agent information that is provided with the request.
   * </pre>
   *
   * <code>string user_agent = 3;</code>
   *
   * @return The userAgent.
   */
  @java.lang.Override
  public java.lang.String getUserAgent() {
    java.lang.Object ref = userAgent_;
    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();
      userAgent_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The user agent information that is provided with the request.
   * </pre>
   *
   * <code>string user_agent = 3;</code>
   *
   * @return The bytes for userAgent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getUserAgentBytes() {
    java.lang.Object ref = userAgent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      userAgent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int REFERRER_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private volatile java.lang.Object referrer_ = "";
  /**
   *
   *
   * <pre>
   * The referrer information that is provided with the request.
   * </pre>
   *
   * <code>string referrer = 4;</code>
   *
   * @return The referrer.
   */
  @java.lang.Override
  public java.lang.String getReferrer() {
    java.lang.Object ref = referrer_;
    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();
      referrer_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The referrer information that is provided with the request.
   * </pre>
   *
   * <code>string referrer = 4;</code>
   *
   * @return The bytes for referrer.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getReferrerBytes() {
    java.lang.Object ref = referrer_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      referrer_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int RESPONSE_STATUS_CODE_FIELD_NUMBER = 5;
  private int responseStatusCode_ = 0;
  /**
   *
   *
   * <pre>
   * The HTTP response status code for the request.
   * </pre>
   *
   * <code>int32 response_status_code = 5;</code>
   *
   * @return The responseStatusCode.
   */
  @java.lang.Override
  public int getResponseStatusCode() {
    return responseStatusCode_;
  }

  public static final int REMOTE_IP_FIELD_NUMBER = 6;

  @SuppressWarnings("serial")
  private volatile java.lang.Object remoteIp_ = "";
  /**
   *
   *
   * <pre>
   * The IP address from which the request originated.
   * This can be IPv4, IPv6, or a token which is derived from the
   * IP address, depending on the data that has been provided
   * in the error report.
   * </pre>
   *
   * <code>string remote_ip = 6;</code>
   *
   * @return The remoteIp.
   */
  @java.lang.Override
  public java.lang.String getRemoteIp() {
    java.lang.Object ref = remoteIp_;
    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();
      remoteIp_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The IP address from which the request originated.
   * This can be IPv4, IPv6, or a token which is derived from the
   * IP address, depending on the data that has been provided
   * in the error report.
   * </pre>
   *
   * <code>string remote_ip = 6;</code>
   *
   * @return The bytes for remoteIp.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getRemoteIpBytes() {
    java.lang.Object ref = remoteIp_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      remoteIp_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(method_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, method_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, url_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userAgent_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, userAgent_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referrer_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, referrer_);
    }
    if (responseStatusCode_ != 0) {
      output.writeInt32(5, responseStatusCode_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remoteIp_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, remoteIp_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(method_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, method_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, url_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userAgent_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, userAgent_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referrer_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, referrer_);
    }
    if (responseStatusCode_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, responseStatusCode_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remoteIp_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, remoteIp_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext)) {
      return super.equals(obj);
    }
    com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext other =
        (com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext) obj;

    if (!getMethod().equals(other.getMethod())) return false;
    if (!getUrl().equals(other.getUrl())) return false;
    if (!getUserAgent().equals(other.getUserAgent())) return false;
    if (!getReferrer().equals(other.getReferrer())) return false;
    if (getResponseStatusCode() != other.getResponseStatusCode()) return false;
    if (!getRemoteIp().equals(other.getRemoteIp())) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + METHOD_FIELD_NUMBER;
    hash = (53 * hash) + getMethod().hashCode();
    hash = (37 * hash) + URL_FIELD_NUMBER;
    hash = (53 * hash) + getUrl().hashCode();
    hash = (37 * hash) + USER_AGENT_FIELD_NUMBER;
    hash = (53 * hash) + getUserAgent().hashCode();
    hash = (37 * hash) + REFERRER_FIELD_NUMBER;
    hash = (53 * hash) + getReferrer().hashCode();
    hash = (37 * hash) + RESPONSE_STATUS_CODE_FIELD_NUMBER;
    hash = (53 * hash) + getResponseStatusCode();
    hash = (37 * hash) + REMOTE_IP_FIELD_NUMBER;
    hash = (53 * hash) + getRemoteIp().hashCode();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

  public static com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

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

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

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

  public static com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext 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.devtools.clouderrorreporting.v1beta1.HttpRequestContext 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 request data that is related to a reported error.
   * This data should be provided by the application when reporting an error,
   * unless the
   * error report has been generated automatically from Google App Engine logs.
   * </pre>
   *
   * Protobuf type {@code google.devtools.clouderrorreporting.v1beta1.HttpRequestContext}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.devtools.clouderrorreporting.v1beta1.HttpRequestContext)
      com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContextOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.devtools.clouderrorreporting.v1beta1.CommonProto
          .internal_static_google_devtools_clouderrorreporting_v1beta1_HttpRequestContext_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.devtools.clouderrorreporting.v1beta1.CommonProto
          .internal_static_google_devtools_clouderrorreporting_v1beta1_HttpRequestContext_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext.class,
              com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext.Builder.class);
    }

    // Construct using
    // com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      method_ = "";
      url_ = "";
      userAgent_ = "";
      referrer_ = "";
      responseStatusCode_ = 0;
      remoteIp_ = "";
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.devtools.clouderrorreporting.v1beta1.CommonProto
          .internal_static_google_devtools_clouderrorreporting_v1beta1_HttpRequestContext_descriptor;
    }

    @java.lang.Override
    public com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext
        getDefaultInstanceForType() {
      return com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext
          .getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext buildPartial() {
      com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext result =
          new com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(
        com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.method_ = method_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.url_ = url_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.userAgent_ = userAgent_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.referrer_ = referrer_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.responseStatusCode_ = responseStatusCode_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.remoteIp_ = remoteIp_;
      }
    }

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

    public Builder mergeFrom(
        com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext other) {
      if (other
          == com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext
              .getDefaultInstance()) return this;
      if (!other.getMethod().isEmpty()) {
        method_ = other.method_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getUrl().isEmpty()) {
        url_ = other.url_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (!other.getUserAgent().isEmpty()) {
        userAgent_ = other.userAgent_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (!other.getReferrer().isEmpty()) {
        referrer_ = other.referrer_;
        bitField0_ |= 0x00000008;
        onChanged();
      }
      if (other.getResponseStatusCode() != 0) {
        setResponseStatusCode(other.getResponseStatusCode());
      }
      if (!other.getRemoteIp().isEmpty()) {
        remoteIp_ = other.remoteIp_;
        bitField0_ |= 0x00000020;
        onChanged();
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                method_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                url_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                userAgent_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                referrer_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 40:
              {
                responseStatusCode_ = input.readInt32();
                bitField0_ |= 0x00000010;
                break;
              } // case 40
            case 50:
              {
                remoteIp_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000020;
                break;
              } // case 50
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object method_ = "";
    /**
     *
     *
     * <pre>
     * The type of HTTP request, such as `GET`, `POST`, etc.
     * </pre>
     *
     * <code>string method = 1;</code>
     *
     * @return The method.
     */
    public java.lang.String getMethod() {
      java.lang.Object ref = method_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        method_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The type of HTTP request, such as `GET`, `POST`, etc.
     * </pre>
     *
     * <code>string method = 1;</code>
     *
     * @return The bytes for method.
     */
    public com.google.protobuf.ByteString getMethodBytes() {
      java.lang.Object ref = method_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        method_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The type of HTTP request, such as `GET`, `POST`, etc.
     * </pre>
     *
     * <code>string method = 1;</code>
     *
     * @param value The method to set.
     * @return This builder for chaining.
     */
    public Builder setMethod(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      method_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The type of HTTP request, such as `GET`, `POST`, etc.
     * </pre>
     *
     * <code>string method = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearMethod() {
      method_ = getDefaultInstance().getMethod();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The type of HTTP request, such as `GET`, `POST`, etc.
     * </pre>
     *
     * <code>string method = 1;</code>
     *
     * @param value The bytes for method to set.
     * @return This builder for chaining.
     */
    public Builder setMethodBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      method_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object url_ = "";
    /**
     *
     *
     * <pre>
     * The URL of the request.
     * </pre>
     *
     * <code>string url = 2;</code>
     *
     * @return The url.
     */
    public java.lang.String getUrl() {
      java.lang.Object ref = url_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        url_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The URL of the request.
     * </pre>
     *
     * <code>string url = 2;</code>
     *
     * @return The bytes for url.
     */
    public com.google.protobuf.ByteString getUrlBytes() {
      java.lang.Object ref = url_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        url_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The URL of the request.
     * </pre>
     *
     * <code>string url = 2;</code>
     *
     * @param value The url to set.
     * @return This builder for chaining.
     */
    public Builder setUrl(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      url_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The URL of the request.
     * </pre>
     *
     * <code>string url = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearUrl() {
      url_ = getDefaultInstance().getUrl();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The URL of the request.
     * </pre>
     *
     * <code>string url = 2;</code>
     *
     * @param value The bytes for url to set.
     * @return This builder for chaining.
     */
    public Builder setUrlBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      url_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private java.lang.Object userAgent_ = "";
    /**
     *
     *
     * <pre>
     * The user agent information that is provided with the request.
     * </pre>
     *
     * <code>string user_agent = 3;</code>
     *
     * @return The userAgent.
     */
    public java.lang.String getUserAgent() {
      java.lang.Object ref = userAgent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        userAgent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The user agent information that is provided with the request.
     * </pre>
     *
     * <code>string user_agent = 3;</code>
     *
     * @return The bytes for userAgent.
     */
    public com.google.protobuf.ByteString getUserAgentBytes() {
      java.lang.Object ref = userAgent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        userAgent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The user agent information that is provided with the request.
     * </pre>
     *
     * <code>string user_agent = 3;</code>
     *
     * @param value The userAgent to set.
     * @return This builder for chaining.
     */
    public Builder setUserAgent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      userAgent_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The user agent information that is provided with the request.
     * </pre>
     *
     * <code>string user_agent = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearUserAgent() {
      userAgent_ = getDefaultInstance().getUserAgent();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The user agent information that is provided with the request.
     * </pre>
     *
     * <code>string user_agent = 3;</code>
     *
     * @param value The bytes for userAgent to set.
     * @return This builder for chaining.
     */
    public Builder setUserAgentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      userAgent_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private java.lang.Object referrer_ = "";
    /**
     *
     *
     * <pre>
     * The referrer information that is provided with the request.
     * </pre>
     *
     * <code>string referrer = 4;</code>
     *
     * @return The referrer.
     */
    public java.lang.String getReferrer() {
      java.lang.Object ref = referrer_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        referrer_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The referrer information that is provided with the request.
     * </pre>
     *
     * <code>string referrer = 4;</code>
     *
     * @return The bytes for referrer.
     */
    public com.google.protobuf.ByteString getReferrerBytes() {
      java.lang.Object ref = referrer_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        referrer_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The referrer information that is provided with the request.
     * </pre>
     *
     * <code>string referrer = 4;</code>
     *
     * @param value The referrer to set.
     * @return This builder for chaining.
     */
    public Builder setReferrer(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      referrer_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The referrer information that is provided with the request.
     * </pre>
     *
     * <code>string referrer = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearReferrer() {
      referrer_ = getDefaultInstance().getReferrer();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The referrer information that is provided with the request.
     * </pre>
     *
     * <code>string referrer = 4;</code>
     *
     * @param value The bytes for referrer to set.
     * @return This builder for chaining.
     */
    public Builder setReferrerBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      referrer_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    private int responseStatusCode_;
    /**
     *
     *
     * <pre>
     * The HTTP response status code for the request.
     * </pre>
     *
     * <code>int32 response_status_code = 5;</code>
     *
     * @return The responseStatusCode.
     */
    @java.lang.Override
    public int getResponseStatusCode() {
      return responseStatusCode_;
    }
    /**
     *
     *
     * <pre>
     * The HTTP response status code for the request.
     * </pre>
     *
     * <code>int32 response_status_code = 5;</code>
     *
     * @param value The responseStatusCode to set.
     * @return This builder for chaining.
     */
    public Builder setResponseStatusCode(int value) {

      responseStatusCode_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The HTTP response status code for the request.
     * </pre>
     *
     * <code>int32 response_status_code = 5;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearResponseStatusCode() {
      bitField0_ = (bitField0_ & ~0x00000010);
      responseStatusCode_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object remoteIp_ = "";
    /**
     *
     *
     * <pre>
     * The IP address from which the request originated.
     * This can be IPv4, IPv6, or a token which is derived from the
     * IP address, depending on the data that has been provided
     * in the error report.
     * </pre>
     *
     * <code>string remote_ip = 6;</code>
     *
     * @return The remoteIp.
     */
    public java.lang.String getRemoteIp() {
      java.lang.Object ref = remoteIp_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        remoteIp_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The IP address from which the request originated.
     * This can be IPv4, IPv6, or a token which is derived from the
     * IP address, depending on the data that has been provided
     * in the error report.
     * </pre>
     *
     * <code>string remote_ip = 6;</code>
     *
     * @return The bytes for remoteIp.
     */
    public com.google.protobuf.ByteString getRemoteIpBytes() {
      java.lang.Object ref = remoteIp_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        remoteIp_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The IP address from which the request originated.
     * This can be IPv4, IPv6, or a token which is derived from the
     * IP address, depending on the data that has been provided
     * in the error report.
     * </pre>
     *
     * <code>string remote_ip = 6;</code>
     *
     * @param value The remoteIp to set.
     * @return This builder for chaining.
     */
    public Builder setRemoteIp(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      remoteIp_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The IP address from which the request originated.
     * This can be IPv4, IPv6, or a token which is derived from the
     * IP address, depending on the data that has been provided
     * in the error report.
     * </pre>
     *
     * <code>string remote_ip = 6;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearRemoteIp() {
      remoteIp_ = getDefaultInstance().getRemoteIp();
      bitField0_ = (bitField0_ & ~0x00000020);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The IP address from which the request originated.
     * This can be IPv4, IPv6, or a token which is derived from the
     * IP address, depending on the data that has been provided
     * in the error report.
     * </pre>
     *
     * <code>string remote_ip = 6;</code>
     *
     * @param value The bytes for remoteIp to set.
     * @return This builder for chaining.
     */
    public Builder setRemoteIpBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      remoteIp_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }

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

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

    // @@protoc_insertion_point(builder_scope:google.devtools.clouderrorreporting.v1beta1.HttpRequestContext)
  }

  // @@protoc_insertion_point(class_scope:google.devtools.clouderrorreporting.v1beta1.HttpRequestContext)
  private static final com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext
      DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext();
  }

  public static com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext
      getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext
      getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
