/*
 * Copyright 2020 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/api/servicecontrol/v1/log_entry.proto

package com.google.api.servicecontrol.v1;

/**
 *
 *
 * <pre>
 * An individual log entry.
 * </pre>
 *
 * Protobuf type {@code google.api.servicecontrol.v1.LogEntry}
 */
public final class LogEntry extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.LogEntry)
    LogEntryOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use LogEntry.newBuilder() to construct.
  private LogEntry(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private LogEntry() {
    name_ = "";
    severity_ = 0;
    trace_ = "";
    insertId_ = "";
  }

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

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.api.servicecontrol.v1.LogEntryProto
        .internal_static_google_api_servicecontrol_v1_LogEntry_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(int number) {
    switch (number) {
      case 13:
        return internalGetLabels();
      default:
        throw new RuntimeException("Invalid map field number: " + number);
    }
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.api.servicecontrol.v1.LogEntryProto
        .internal_static_google_api_servicecontrol_v1_LogEntry_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.api.servicecontrol.v1.LogEntry.class,
            com.google.api.servicecontrol.v1.LogEntry.Builder.class);
  }

  private int payloadCase_ = 0;
  private java.lang.Object payload_;

  public enum PayloadCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    PROTO_PAYLOAD(2),
    TEXT_PAYLOAD(3),
    STRUCT_PAYLOAD(6),
    PAYLOAD_NOT_SET(0);
    private final int value;

    private PayloadCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static PayloadCase valueOf(int value) {
      return forNumber(value);
    }

    public static PayloadCase forNumber(int value) {
      switch (value) {
        case 2:
          return PROTO_PAYLOAD;
        case 3:
          return TEXT_PAYLOAD;
        case 6:
          return STRUCT_PAYLOAD;
        case 0:
          return PAYLOAD_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public PayloadCase getPayloadCase() {
    return PayloadCase.forNumber(payloadCase_);
  }

  public static final int NAME_FIELD_NUMBER = 10;

  @SuppressWarnings("serial")
  private volatile java.lang.Object name_ = "";
  /**
   *
   *
   * <pre>
   * Required. The log to which this log entry belongs. Examples: `"syslog"`,
   * `"book_log"`.
   * </pre>
   *
   * <code>string name = 10;</code>
   *
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    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();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The log to which this log entry belongs. Examples: `"syslog"`,
   * `"book_log"`.
   * </pre>
   *
   * <code>string name = 10;</code>
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int TIMESTAMP_FIELD_NUMBER = 11;
  private com.google.protobuf.Timestamp timestamp_;
  /**
   *
   *
   * <pre>
   * The time the event described by the log entry occurred. If
   * omitted, defaults to operation start time.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp timestamp = 11;</code>
   *
   * @return Whether the timestamp field is set.
   */
  @java.lang.Override
  public boolean hasTimestamp() {
    return timestamp_ != null;
  }
  /**
   *
   *
   * <pre>
   * The time the event described by the log entry occurred. If
   * omitted, defaults to operation start time.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp timestamp = 11;</code>
   *
   * @return The timestamp.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getTimestamp() {
    return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_;
  }
  /**
   *
   *
   * <pre>
   * The time the event described by the log entry occurred. If
   * omitted, defaults to operation start time.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp timestamp = 11;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() {
    return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_;
  }

  public static final int SEVERITY_FIELD_NUMBER = 12;
  private int severity_ = 0;
  /**
   *
   *
   * <pre>
   * The severity of the log entry. The default value is
   * `LogSeverity.DEFAULT`.
   * </pre>
   *
   * <code>.google.logging.type.LogSeverity severity = 12;</code>
   *
   * @return The enum numeric value on the wire for severity.
   */
  @java.lang.Override
  public int getSeverityValue() {
    return severity_;
  }
  /**
   *
   *
   * <pre>
   * The severity of the log entry. The default value is
   * `LogSeverity.DEFAULT`.
   * </pre>
   *
   * <code>.google.logging.type.LogSeverity severity = 12;</code>
   *
   * @return The severity.
   */
  @java.lang.Override
  public com.google.logging.type.LogSeverity getSeverity() {
    com.google.logging.type.LogSeverity result =
        com.google.logging.type.LogSeverity.forNumber(severity_);
    return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result;
  }

  public static final int HTTP_REQUEST_FIELD_NUMBER = 14;
  private com.google.api.servicecontrol.v1.HttpRequest httpRequest_;
  /**
   *
   *
   * <pre>
   * Optional. Information about the HTTP request associated with this
   * log entry, if applicable.
   * </pre>
   *
   * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
   *
   * @return Whether the httpRequest field is set.
   */
  @java.lang.Override
  public boolean hasHttpRequest() {
    return httpRequest_ != null;
  }
  /**
   *
   *
   * <pre>
   * Optional. Information about the HTTP request associated with this
   * log entry, if applicable.
   * </pre>
   *
   * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
   *
   * @return The httpRequest.
   */
  @java.lang.Override
  public com.google.api.servicecontrol.v1.HttpRequest getHttpRequest() {
    return httpRequest_ == null
        ? com.google.api.servicecontrol.v1.HttpRequest.getDefaultInstance()
        : httpRequest_;
  }
  /**
   *
   *
   * <pre>
   * Optional. Information about the HTTP request associated with this
   * log entry, if applicable.
   * </pre>
   *
   * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
   */
  @java.lang.Override
  public com.google.api.servicecontrol.v1.HttpRequestOrBuilder getHttpRequestOrBuilder() {
    return httpRequest_ == null
        ? com.google.api.servicecontrol.v1.HttpRequest.getDefaultInstance()
        : httpRequest_;
  }

  public static final int TRACE_FIELD_NUMBER = 15;

  @SuppressWarnings("serial")
  private volatile java.lang.Object trace_ = "";
  /**
   *
   *
   * <pre>
   * Optional. Resource name of the trace associated with the log entry, if any.
   * If this field contains a relative resource name, you can assume the name is
   * relative to `//tracing.googleapis.com`. Example:
   * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
   * </pre>
   *
   * <code>string trace = 15;</code>
   *
   * @return The trace.
   */
  @java.lang.Override
  public java.lang.String getTrace() {
    java.lang.Object ref = trace_;
    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();
      trace_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. Resource name of the trace associated with the log entry, if any.
   * If this field contains a relative resource name, you can assume the name is
   * relative to `//tracing.googleapis.com`. Example:
   * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
   * </pre>
   *
   * <code>string trace = 15;</code>
   *
   * @return The bytes for trace.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getTraceBytes() {
    java.lang.Object ref = trace_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      trace_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int INSERT_ID_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private volatile java.lang.Object insertId_ = "";
  /**
   *
   *
   * <pre>
   * A unique ID for the log entry used for deduplication. If omitted,
   * the implementation will generate one based on operation_id.
   * </pre>
   *
   * <code>string insert_id = 4;</code>
   *
   * @return The insertId.
   */
  @java.lang.Override
  public java.lang.String getInsertId() {
    java.lang.Object ref = insertId_;
    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();
      insertId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * A unique ID for the log entry used for deduplication. If omitted,
   * the implementation will generate one based on operation_id.
   * </pre>
   *
   * <code>string insert_id = 4;</code>
   *
   * @return The bytes for insertId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getInsertIdBytes() {
    java.lang.Object ref = insertId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      insertId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LABELS_FIELD_NUMBER = 13;

  private static final class LabelsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
        com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
            com.google.api.servicecontrol.v1.LogEntryProto
                .internal_static_google_api_servicecontrol_v1_LogEntry_LabelsEntry_descriptor,
            com.google.protobuf.WireFormat.FieldType.STRING,
            "",
            com.google.protobuf.WireFormat.FieldType.STRING,
            "");
  }

  @SuppressWarnings("serial")
  private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
    if (labels_ == null) {
      return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
    }
    return labels_;
  }

  public int getLabelsCount() {
    return internalGetLabels().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * A set of user-defined (key, value) data that provides additional
   * information about the log entry.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 13;</code>
   */
  @java.lang.Override
  public boolean containsLabels(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetLabels().getMap().containsKey(key);
  }
  /** Use {@link #getLabelsMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getLabels() {
    return getLabelsMap();
  }
  /**
   *
   *
   * <pre>
   * A set of user-defined (key, value) data that provides additional
   * information about the log entry.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 13;</code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
    return internalGetLabels().getMap();
  }
  /**
   *
   *
   * <pre>
   * A set of user-defined (key, value) data that provides additional
   * information about the log entry.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 13;</code>
   */
  @java.lang.Override
  public /* nullable */ java.lang.String getLabelsOrDefault(
      java.lang.String key,
      /* nullable */
      java.lang.String defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * A set of user-defined (key, value) data that provides additional
   * information about the log entry.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 13;</code>
   */
  @java.lang.Override
  public java.lang.String getLabelsOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int PROTO_PAYLOAD_FIELD_NUMBER = 2;
  /**
   *
   *
   * <pre>
   * The log entry payload, represented as a protocol buffer that is
   * expressed as a JSON object. The only accepted type currently is
   * [AuditLog][google.cloud.audit.AuditLog].
   * </pre>
   *
   * <code>.google.protobuf.Any proto_payload = 2;</code>
   *
   * @return Whether the protoPayload field is set.
   */
  @java.lang.Override
  public boolean hasProtoPayload() {
    return payloadCase_ == 2;
  }
  /**
   *
   *
   * <pre>
   * The log entry payload, represented as a protocol buffer that is
   * expressed as a JSON object. The only accepted type currently is
   * [AuditLog][google.cloud.audit.AuditLog].
   * </pre>
   *
   * <code>.google.protobuf.Any proto_payload = 2;</code>
   *
   * @return The protoPayload.
   */
  @java.lang.Override
  public com.google.protobuf.Any getProtoPayload() {
    if (payloadCase_ == 2) {
      return (com.google.protobuf.Any) payload_;
    }
    return com.google.protobuf.Any.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The log entry payload, represented as a protocol buffer that is
   * expressed as a JSON object. The only accepted type currently is
   * [AuditLog][google.cloud.audit.AuditLog].
   * </pre>
   *
   * <code>.google.protobuf.Any proto_payload = 2;</code>
   */
  @java.lang.Override
  public com.google.protobuf.AnyOrBuilder getProtoPayloadOrBuilder() {
    if (payloadCase_ == 2) {
      return (com.google.protobuf.Any) payload_;
    }
    return com.google.protobuf.Any.getDefaultInstance();
  }

  public static final int TEXT_PAYLOAD_FIELD_NUMBER = 3;
  /**
   *
   *
   * <pre>
   * The log entry payload, represented as a Unicode string (UTF-8).
   * </pre>
   *
   * <code>string text_payload = 3;</code>
   *
   * @return Whether the textPayload field is set.
   */
  public boolean hasTextPayload() {
    return payloadCase_ == 3;
  }
  /**
   *
   *
   * <pre>
   * The log entry payload, represented as a Unicode string (UTF-8).
   * </pre>
   *
   * <code>string text_payload = 3;</code>
   *
   * @return The textPayload.
   */
  public java.lang.String getTextPayload() {
    java.lang.Object ref = "";
    if (payloadCase_ == 3) {
      ref = payload_;
    }
    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();
      if (payloadCase_ == 3) {
        payload_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The log entry payload, represented as a Unicode string (UTF-8).
   * </pre>
   *
   * <code>string text_payload = 3;</code>
   *
   * @return The bytes for textPayload.
   */
  public com.google.protobuf.ByteString getTextPayloadBytes() {
    java.lang.Object ref = "";
    if (payloadCase_ == 3) {
      ref = payload_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (payloadCase_ == 3) {
        payload_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int STRUCT_PAYLOAD_FIELD_NUMBER = 6;
  /**
   *
   *
   * <pre>
   * The log entry payload, represented as a structure that
   * is expressed as a JSON object.
   * </pre>
   *
   * <code>.google.protobuf.Struct struct_payload = 6;</code>
   *
   * @return Whether the structPayload field is set.
   */
  @java.lang.Override
  public boolean hasStructPayload() {
    return payloadCase_ == 6;
  }
  /**
   *
   *
   * <pre>
   * The log entry payload, represented as a structure that
   * is expressed as a JSON object.
   * </pre>
   *
   * <code>.google.protobuf.Struct struct_payload = 6;</code>
   *
   * @return The structPayload.
   */
  @java.lang.Override
  public com.google.protobuf.Struct getStructPayload() {
    if (payloadCase_ == 6) {
      return (com.google.protobuf.Struct) payload_;
    }
    return com.google.protobuf.Struct.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The log entry payload, represented as a structure that
   * is expressed as a JSON object.
   * </pre>
   *
   * <code>.google.protobuf.Struct struct_payload = 6;</code>
   */
  @java.lang.Override
  public com.google.protobuf.StructOrBuilder getStructPayloadOrBuilder() {
    if (payloadCase_ == 6) {
      return (com.google.protobuf.Struct) payload_;
    }
    return com.google.protobuf.Struct.getDefaultInstance();
  }

  public static final int OPERATION_FIELD_NUMBER = 16;
  private com.google.api.servicecontrol.v1.LogEntryOperation operation_;
  /**
   *
   *
   * <pre>
   * Optional. Information about an operation associated with the log entry, if
   * applicable.
   * </pre>
   *
   * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
   *
   * @return Whether the operation field is set.
   */
  @java.lang.Override
  public boolean hasOperation() {
    return operation_ != null;
  }
  /**
   *
   *
   * <pre>
   * Optional. Information about an operation associated with the log entry, if
   * applicable.
   * </pre>
   *
   * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
   *
   * @return The operation.
   */
  @java.lang.Override
  public com.google.api.servicecontrol.v1.LogEntryOperation getOperation() {
    return operation_ == null
        ? com.google.api.servicecontrol.v1.LogEntryOperation.getDefaultInstance()
        : operation_;
  }
  /**
   *
   *
   * <pre>
   * Optional. Information about an operation associated with the log entry, if
   * applicable.
   * </pre>
   *
   * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
   */
  @java.lang.Override
  public com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder getOperationOrBuilder() {
    return operation_ == null
        ? com.google.api.servicecontrol.v1.LogEntryOperation.getDefaultInstance()
        : operation_;
  }

  public static final int SOURCE_LOCATION_FIELD_NUMBER = 17;
  private com.google.api.servicecontrol.v1.LogEntrySourceLocation sourceLocation_;
  /**
   *
   *
   * <pre>
   * Optional. Source code location information associated with the log entry,
   * if any.
   * </pre>
   *
   * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
   *
   * @return Whether the sourceLocation field is set.
   */
  @java.lang.Override
  public boolean hasSourceLocation() {
    return sourceLocation_ != null;
  }
  /**
   *
   *
   * <pre>
   * Optional. Source code location information associated with the log entry,
   * if any.
   * </pre>
   *
   * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
   *
   * @return The sourceLocation.
   */
  @java.lang.Override
  public com.google.api.servicecontrol.v1.LogEntrySourceLocation getSourceLocation() {
    return sourceLocation_ == null
        ? com.google.api.servicecontrol.v1.LogEntrySourceLocation.getDefaultInstance()
        : sourceLocation_;
  }
  /**
   *
   *
   * <pre>
   * Optional. Source code location information associated with the log entry,
   * if any.
   * </pre>
   *
   * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
   */
  @java.lang.Override
  public com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder
      getSourceLocationOrBuilder() {
    return sourceLocation_ == null
        ? com.google.api.servicecontrol.v1.LogEntrySourceLocation.getDefaultInstance()
        : sourceLocation_;
  }

  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 (payloadCase_ == 2) {
      output.writeMessage(2, (com.google.protobuf.Any) payload_);
    }
    if (payloadCase_ == 3) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, payload_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(insertId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, insertId_);
    }
    if (payloadCase_ == 6) {
      output.writeMessage(6, (com.google.protobuf.Struct) payload_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 10, name_);
    }
    if (timestamp_ != null) {
      output.writeMessage(11, getTimestamp());
    }
    if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) {
      output.writeEnum(12, severity_);
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 13);
    if (httpRequest_ != null) {
      output.writeMessage(14, getHttpRequest());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trace_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 15, trace_);
    }
    if (operation_ != null) {
      output.writeMessage(16, getOperation());
    }
    if (sourceLocation_ != null) {
      output.writeMessage(17, getSourceLocation());
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (payloadCase_ == 2) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              2, (com.google.protobuf.Any) payload_);
    }
    if (payloadCase_ == 3) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, payload_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(insertId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, insertId_);
    }
    if (payloadCase_ == 6) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              6, (com.google.protobuf.Struct) payload_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, name_);
    }
    if (timestamp_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getTimestamp());
    }
    if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, severity_);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetLabels().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
          LabelsDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, labels__);
    }
    if (httpRequest_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getHttpRequest());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trace_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, trace_);
    }
    if (operation_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getOperation());
    }
    if (sourceLocation_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getSourceLocation());
    }
    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.api.servicecontrol.v1.LogEntry)) {
      return super.equals(obj);
    }
    com.google.api.servicecontrol.v1.LogEntry other =
        (com.google.api.servicecontrol.v1.LogEntry) obj;

    if (!getName().equals(other.getName())) return false;
    if (hasTimestamp() != other.hasTimestamp()) return false;
    if (hasTimestamp()) {
      if (!getTimestamp().equals(other.getTimestamp())) return false;
    }
    if (severity_ != other.severity_) return false;
    if (hasHttpRequest() != other.hasHttpRequest()) return false;
    if (hasHttpRequest()) {
      if (!getHttpRequest().equals(other.getHttpRequest())) return false;
    }
    if (!getTrace().equals(other.getTrace())) return false;
    if (!getInsertId().equals(other.getInsertId())) return false;
    if (!internalGetLabels().equals(other.internalGetLabels())) return false;
    if (hasOperation() != other.hasOperation()) return false;
    if (hasOperation()) {
      if (!getOperation().equals(other.getOperation())) return false;
    }
    if (hasSourceLocation() != other.hasSourceLocation()) return false;
    if (hasSourceLocation()) {
      if (!getSourceLocation().equals(other.getSourceLocation())) return false;
    }
    if (!getPayloadCase().equals(other.getPayloadCase())) return false;
    switch (payloadCase_) {
      case 2:
        if (!getProtoPayload().equals(other.getProtoPayload())) return false;
        break;
      case 3:
        if (!getTextPayload().equals(other.getTextPayload())) return false;
        break;
      case 6:
        if (!getStructPayload().equals(other.getStructPayload())) return false;
        break;
      case 0:
      default:
    }
    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) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    if (hasTimestamp()) {
      hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER;
      hash = (53 * hash) + getTimestamp().hashCode();
    }
    hash = (37 * hash) + SEVERITY_FIELD_NUMBER;
    hash = (53 * hash) + severity_;
    if (hasHttpRequest()) {
      hash = (37 * hash) + HTTP_REQUEST_FIELD_NUMBER;
      hash = (53 * hash) + getHttpRequest().hashCode();
    }
    hash = (37 * hash) + TRACE_FIELD_NUMBER;
    hash = (53 * hash) + getTrace().hashCode();
    hash = (37 * hash) + INSERT_ID_FIELD_NUMBER;
    hash = (53 * hash) + getInsertId().hashCode();
    if (!internalGetLabels().getMap().isEmpty()) {
      hash = (37 * hash) + LABELS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetLabels().hashCode();
    }
    if (hasOperation()) {
      hash = (37 * hash) + OPERATION_FIELD_NUMBER;
      hash = (53 * hash) + getOperation().hashCode();
    }
    if (hasSourceLocation()) {
      hash = (37 * hash) + SOURCE_LOCATION_FIELD_NUMBER;
      hash = (53 * hash) + getSourceLocation().hashCode();
    }
    switch (payloadCase_) {
      case 2:
        hash = (37 * hash) + PROTO_PAYLOAD_FIELD_NUMBER;
        hash = (53 * hash) + getProtoPayload().hashCode();
        break;
      case 3:
        hash = (37 * hash) + TEXT_PAYLOAD_FIELD_NUMBER;
        hash = (53 * hash) + getTextPayload().hashCode();
        break;
      case 6:
        hash = (37 * hash) + STRUCT_PAYLOAD_FIELD_NUMBER;
        hash = (53 * hash) + getStructPayload().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.api.servicecontrol.v1.LogEntry parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.api.servicecontrol.v1.LogEntry parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.api.servicecontrol.v1.LogEntry parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

  public static com.google.api.servicecontrol.v1.LogEntry parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.api.servicecontrol.v1.LogEntry parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

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

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

  public static com.google.api.servicecontrol.v1.LogEntry 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.api.servicecontrol.v1.LogEntry 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>
   * An individual log entry.
   * </pre>
   *
   * Protobuf type {@code google.api.servicecontrol.v1.LogEntry}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.LogEntry)
      com.google.api.servicecontrol.v1.LogEntryOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.api.servicecontrol.v1.LogEntryProto
          .internal_static_google_api_servicecontrol_v1_LogEntry_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 13:
          return internalGetLabels();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
      switch (number) {
        case 13:
          return internalGetMutableLabels();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.api.servicecontrol.v1.LogEntryProto
          .internal_static_google_api_servicecontrol_v1_LogEntry_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.api.servicecontrol.v1.LogEntry.class,
              com.google.api.servicecontrol.v1.LogEntry.Builder.class);
    }

    // Construct using com.google.api.servicecontrol.v1.LogEntry.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      name_ = "";
      timestamp_ = null;
      if (timestampBuilder_ != null) {
        timestampBuilder_.dispose();
        timestampBuilder_ = null;
      }
      severity_ = 0;
      httpRequest_ = null;
      if (httpRequestBuilder_ != null) {
        httpRequestBuilder_.dispose();
        httpRequestBuilder_ = null;
      }
      trace_ = "";
      insertId_ = "";
      internalGetMutableLabels().clear();
      if (protoPayloadBuilder_ != null) {
        protoPayloadBuilder_.clear();
      }
      if (structPayloadBuilder_ != null) {
        structPayloadBuilder_.clear();
      }
      operation_ = null;
      if (operationBuilder_ != null) {
        operationBuilder_.dispose();
        operationBuilder_ = null;
      }
      sourceLocation_ = null;
      if (sourceLocationBuilder_ != null) {
        sourceLocationBuilder_.dispose();
        sourceLocationBuilder_ = null;
      }
      payloadCase_ = 0;
      payload_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.api.servicecontrol.v1.LogEntryProto
          .internal_static_google_api_servicecontrol_v1_LogEntry_descriptor;
    }

    @java.lang.Override
    public com.google.api.servicecontrol.v1.LogEntry getDefaultInstanceForType() {
      return com.google.api.servicecontrol.v1.LogEntry.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.api.servicecontrol.v1.LogEntry build() {
      com.google.api.servicecontrol.v1.LogEntry result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.api.servicecontrol.v1.LogEntry buildPartial() {
      com.google.api.servicecontrol.v1.LogEntry result =
          new com.google.api.servicecontrol.v1.LogEntry(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      buildPartialOneofs(result);
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.api.servicecontrol.v1.LogEntry result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.name_ = name_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.timestamp_ = timestampBuilder_ == null ? timestamp_ : timestampBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.severity_ = severity_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.httpRequest_ =
            httpRequestBuilder_ == null ? httpRequest_ : httpRequestBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.trace_ = trace_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.insertId_ = insertId_;
      }
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.labels_ = internalGetLabels();
        result.labels_.makeImmutable();
      }
      if (((from_bitField0_ & 0x00000400) != 0)) {
        result.operation_ = operationBuilder_ == null ? operation_ : operationBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000800) != 0)) {
        result.sourceLocation_ =
            sourceLocationBuilder_ == null ? sourceLocation_ : sourceLocationBuilder_.build();
      }
    }

    private void buildPartialOneofs(com.google.api.servicecontrol.v1.LogEntry result) {
      result.payloadCase_ = payloadCase_;
      result.payload_ = this.payload_;
      if (payloadCase_ == 2 && protoPayloadBuilder_ != null) {
        result.payload_ = protoPayloadBuilder_.build();
      }
      if (payloadCase_ == 6 && structPayloadBuilder_ != null) {
        result.payload_ = structPayloadBuilder_.build();
      }
    }

    @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.api.servicecontrol.v1.LogEntry) {
        return mergeFrom((com.google.api.servicecontrol.v1.LogEntry) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.api.servicecontrol.v1.LogEntry other) {
      if (other == com.google.api.servicecontrol.v1.LogEntry.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (other.hasTimestamp()) {
        mergeTimestamp(other.getTimestamp());
      }
      if (other.severity_ != 0) {
        setSeverityValue(other.getSeverityValue());
      }
      if (other.hasHttpRequest()) {
        mergeHttpRequest(other.getHttpRequest());
      }
      if (!other.getTrace().isEmpty()) {
        trace_ = other.trace_;
        bitField0_ |= 0x00000010;
        onChanged();
      }
      if (!other.getInsertId().isEmpty()) {
        insertId_ = other.insertId_;
        bitField0_ |= 0x00000020;
        onChanged();
      }
      internalGetMutableLabels().mergeFrom(other.internalGetLabels());
      bitField0_ |= 0x00000040;
      if (other.hasOperation()) {
        mergeOperation(other.getOperation());
      }
      if (other.hasSourceLocation()) {
        mergeSourceLocation(other.getSourceLocation());
      }
      switch (other.getPayloadCase()) {
        case PROTO_PAYLOAD:
          {
            mergeProtoPayload(other.getProtoPayload());
            break;
          }
        case TEXT_PAYLOAD:
          {
            payloadCase_ = 3;
            payload_ = other.payload_;
            onChanged();
            break;
          }
        case STRUCT_PAYLOAD:
          {
            mergeStructPayload(other.getStructPayload());
            break;
          }
        case PAYLOAD_NOT_SET:
          {
            break;
          }
      }
      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 18:
              {
                input.readMessage(getProtoPayloadFieldBuilder().getBuilder(), extensionRegistry);
                payloadCase_ = 2;
                break;
              } // case 18
            case 26:
              {
                java.lang.String s = input.readStringRequireUtf8();
                payloadCase_ = 3;
                payload_ = s;
                break;
              } // case 26
            case 34:
              {
                insertId_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000020;
                break;
              } // case 34
            case 50:
              {
                input.readMessage(getStructPayloadFieldBuilder().getBuilder(), extensionRegistry);
                payloadCase_ = 6;
                break;
              } // case 50
            case 82:
              {
                name_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 82
            case 90:
              {
                input.readMessage(getTimestampFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000002;
                break;
              } // case 90
            case 96:
              {
                severity_ = input.readEnum();
                bitField0_ |= 0x00000004;
                break;
              } // case 96
            case 106:
              {
                com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
                    input.readMessage(
                        LabelsDefaultEntryHolder.defaultEntry.getParserForType(),
                        extensionRegistry);
                internalGetMutableLabels()
                    .getMutableMap()
                    .put(labels__.getKey(), labels__.getValue());
                bitField0_ |= 0x00000040;
                break;
              } // case 106
            case 114:
              {
                input.readMessage(getHttpRequestFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000008;
                break;
              } // case 114
            case 122:
              {
                trace_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000010;
                break;
              } // case 122
            case 130:
              {
                input.readMessage(getOperationFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000400;
                break;
              } // case 130
            case 138:
              {
                input.readMessage(getSourceLocationFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000800;
                break;
              } // case 138
            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 payloadCase_ = 0;
    private java.lang.Object payload_;

    public PayloadCase getPayloadCase() {
      return PayloadCase.forNumber(payloadCase_);
    }

    public Builder clearPayload() {
      payloadCase_ = 0;
      payload_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Required. The log to which this log entry belongs. Examples: `"syslog"`,
     * `"book_log"`.
     * </pre>
     *
     * <code>string name = 10;</code>
     *
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The log to which this log entry belongs. Examples: `"syslog"`,
     * `"book_log"`.
     * </pre>
     *
     * <code>string name = 10;</code>
     *
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The log to which this log entry belongs. Examples: `"syslog"`,
     * `"book_log"`.
     * </pre>
     *
     * <code>string name = 10;</code>
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The log to which this log entry belongs. Examples: `"syslog"`,
     * `"book_log"`.
     * </pre>
     *
     * <code>string name = 10;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {
      name_ = getDefaultInstance().getName();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The log to which this log entry belongs. Examples: `"syslog"`,
     * `"book_log"`.
     * </pre>
     *
     * <code>string name = 10;</code>
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private com.google.protobuf.Timestamp timestamp_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        timestampBuilder_;
    /**
     *
     *
     * <pre>
     * The time the event described by the log entry occurred. If
     * omitted, defaults to operation start time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp timestamp = 11;</code>
     *
     * @return Whether the timestamp field is set.
     */
    public boolean hasTimestamp() {
      return ((bitField0_ & 0x00000002) != 0);
    }
    /**
     *
     *
     * <pre>
     * The time the event described by the log entry occurred. If
     * omitted, defaults to operation start time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp timestamp = 11;</code>
     *
     * @return The timestamp.
     */
    public com.google.protobuf.Timestamp getTimestamp() {
      if (timestampBuilder_ == null) {
        return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_;
      } else {
        return timestampBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The time the event described by the log entry occurred. If
     * omitted, defaults to operation start time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp timestamp = 11;</code>
     */
    public Builder setTimestamp(com.google.protobuf.Timestamp value) {
      if (timestampBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        timestamp_ = value;
      } else {
        timestampBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The time the event described by the log entry occurred. If
     * omitted, defaults to operation start time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp timestamp = 11;</code>
     */
    public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (timestampBuilder_ == null) {
        timestamp_ = builderForValue.build();
      } else {
        timestampBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The time the event described by the log entry occurred. If
     * omitted, defaults to operation start time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp timestamp = 11;</code>
     */
    public Builder mergeTimestamp(com.google.protobuf.Timestamp value) {
      if (timestampBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)
            && timestamp_ != null
            && timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getTimestampBuilder().mergeFrom(value);
        } else {
          timestamp_ = value;
        }
      } else {
        timestampBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The time the event described by the log entry occurred. If
     * omitted, defaults to operation start time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp timestamp = 11;</code>
     */
    public Builder clearTimestamp() {
      bitField0_ = (bitField0_ & ~0x00000002);
      timestamp_ = null;
      if (timestampBuilder_ != null) {
        timestampBuilder_.dispose();
        timestampBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The time the event described by the log entry occurred. If
     * omitted, defaults to operation start time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp timestamp = 11;</code>
     */
    public com.google.protobuf.Timestamp.Builder getTimestampBuilder() {
      bitField0_ |= 0x00000002;
      onChanged();
      return getTimestampFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The time the event described by the log entry occurred. If
     * omitted, defaults to operation start time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp timestamp = 11;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() {
      if (timestampBuilder_ != null) {
        return timestampBuilder_.getMessageOrBuilder();
      } else {
        return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_;
      }
    }
    /**
     *
     *
     * <pre>
     * The time the event described by the log entry occurred. If
     * omitted, defaults to operation start time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp timestamp = 11;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getTimestampFieldBuilder() {
      if (timestampBuilder_ == null) {
        timestampBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getTimestamp(), getParentForChildren(), isClean());
        timestamp_ = null;
      }
      return timestampBuilder_;
    }

    private int severity_ = 0;
    /**
     *
     *
     * <pre>
     * The severity of the log entry. The default value is
     * `LogSeverity.DEFAULT`.
     * </pre>
     *
     * <code>.google.logging.type.LogSeverity severity = 12;</code>
     *
     * @return The enum numeric value on the wire for severity.
     */
    @java.lang.Override
    public int getSeverityValue() {
      return severity_;
    }
    /**
     *
     *
     * <pre>
     * The severity of the log entry. The default value is
     * `LogSeverity.DEFAULT`.
     * </pre>
     *
     * <code>.google.logging.type.LogSeverity severity = 12;</code>
     *
     * @param value The enum numeric value on the wire for severity to set.
     * @return This builder for chaining.
     */
    public Builder setSeverityValue(int value) {
      severity_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The severity of the log entry. The default value is
     * `LogSeverity.DEFAULT`.
     * </pre>
     *
     * <code>.google.logging.type.LogSeverity severity = 12;</code>
     *
     * @return The severity.
     */
    @java.lang.Override
    public com.google.logging.type.LogSeverity getSeverity() {
      com.google.logging.type.LogSeverity result =
          com.google.logging.type.LogSeverity.forNumber(severity_);
      return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result;
    }
    /**
     *
     *
     * <pre>
     * The severity of the log entry. The default value is
     * `LogSeverity.DEFAULT`.
     * </pre>
     *
     * <code>.google.logging.type.LogSeverity severity = 12;</code>
     *
     * @param value The severity to set.
     * @return This builder for chaining.
     */
    public Builder setSeverity(com.google.logging.type.LogSeverity value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000004;
      severity_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The severity of the log entry. The default value is
     * `LogSeverity.DEFAULT`.
     * </pre>
     *
     * <code>.google.logging.type.LogSeverity severity = 12;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSeverity() {
      bitField0_ = (bitField0_ & ~0x00000004);
      severity_ = 0;
      onChanged();
      return this;
    }

    private com.google.api.servicecontrol.v1.HttpRequest httpRequest_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.api.servicecontrol.v1.HttpRequest,
            com.google.api.servicecontrol.v1.HttpRequest.Builder,
            com.google.api.servicecontrol.v1.HttpRequestOrBuilder>
        httpRequestBuilder_;
    /**
     *
     *
     * <pre>
     * Optional. Information about the HTTP request associated with this
     * log entry, if applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
     *
     * @return Whether the httpRequest field is set.
     */
    public boolean hasHttpRequest() {
      return ((bitField0_ & 0x00000008) != 0);
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about the HTTP request associated with this
     * log entry, if applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
     *
     * @return The httpRequest.
     */
    public com.google.api.servicecontrol.v1.HttpRequest getHttpRequest() {
      if (httpRequestBuilder_ == null) {
        return httpRequest_ == null
            ? com.google.api.servicecontrol.v1.HttpRequest.getDefaultInstance()
            : httpRequest_;
      } else {
        return httpRequestBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about the HTTP request associated with this
     * log entry, if applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
     */
    public Builder setHttpRequest(com.google.api.servicecontrol.v1.HttpRequest value) {
      if (httpRequestBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        httpRequest_ = value;
      } else {
        httpRequestBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about the HTTP request associated with this
     * log entry, if applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
     */
    public Builder setHttpRequest(
        com.google.api.servicecontrol.v1.HttpRequest.Builder builderForValue) {
      if (httpRequestBuilder_ == null) {
        httpRequest_ = builderForValue.build();
      } else {
        httpRequestBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about the HTTP request associated with this
     * log entry, if applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
     */
    public Builder mergeHttpRequest(com.google.api.servicecontrol.v1.HttpRequest value) {
      if (httpRequestBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)
            && httpRequest_ != null
            && httpRequest_ != com.google.api.servicecontrol.v1.HttpRequest.getDefaultInstance()) {
          getHttpRequestBuilder().mergeFrom(value);
        } else {
          httpRequest_ = value;
        }
      } else {
        httpRequestBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about the HTTP request associated with this
     * log entry, if applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
     */
    public Builder clearHttpRequest() {
      bitField0_ = (bitField0_ & ~0x00000008);
      httpRequest_ = null;
      if (httpRequestBuilder_ != null) {
        httpRequestBuilder_.dispose();
        httpRequestBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about the HTTP request associated with this
     * log entry, if applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
     */
    public com.google.api.servicecontrol.v1.HttpRequest.Builder getHttpRequestBuilder() {
      bitField0_ |= 0x00000008;
      onChanged();
      return getHttpRequestFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about the HTTP request associated with this
     * log entry, if applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
     */
    public com.google.api.servicecontrol.v1.HttpRequestOrBuilder getHttpRequestOrBuilder() {
      if (httpRequestBuilder_ != null) {
        return httpRequestBuilder_.getMessageOrBuilder();
      } else {
        return httpRequest_ == null
            ? com.google.api.servicecontrol.v1.HttpRequest.getDefaultInstance()
            : httpRequest_;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about the HTTP request associated with this
     * log entry, if applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.HttpRequest http_request = 14;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.api.servicecontrol.v1.HttpRequest,
            com.google.api.servicecontrol.v1.HttpRequest.Builder,
            com.google.api.servicecontrol.v1.HttpRequestOrBuilder>
        getHttpRequestFieldBuilder() {
      if (httpRequestBuilder_ == null) {
        httpRequestBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.api.servicecontrol.v1.HttpRequest,
                com.google.api.servicecontrol.v1.HttpRequest.Builder,
                com.google.api.servicecontrol.v1.HttpRequestOrBuilder>(
                getHttpRequest(), getParentForChildren(), isClean());
        httpRequest_ = null;
      }
      return httpRequestBuilder_;
    }

    private java.lang.Object trace_ = "";
    /**
     *
     *
     * <pre>
     * Optional. Resource name of the trace associated with the log entry, if any.
     * If this field contains a relative resource name, you can assume the name is
     * relative to `//tracing.googleapis.com`. Example:
     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
     * </pre>
     *
     * <code>string trace = 15;</code>
     *
     * @return The trace.
     */
    public java.lang.String getTrace() {
      java.lang.Object ref = trace_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        trace_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Resource name of the trace associated with the log entry, if any.
     * If this field contains a relative resource name, you can assume the name is
     * relative to `//tracing.googleapis.com`. Example:
     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
     * </pre>
     *
     * <code>string trace = 15;</code>
     *
     * @return The bytes for trace.
     */
    public com.google.protobuf.ByteString getTraceBytes() {
      java.lang.Object ref = trace_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        trace_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Resource name of the trace associated with the log entry, if any.
     * If this field contains a relative resource name, you can assume the name is
     * relative to `//tracing.googleapis.com`. Example:
     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
     * </pre>
     *
     * <code>string trace = 15;</code>
     *
     * @param value The trace to set.
     * @return This builder for chaining.
     */
    public Builder setTrace(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      trace_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Resource name of the trace associated with the log entry, if any.
     * If this field contains a relative resource name, you can assume the name is
     * relative to `//tracing.googleapis.com`. Example:
     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
     * </pre>
     *
     * <code>string trace = 15;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTrace() {
      trace_ = getDefaultInstance().getTrace();
      bitField0_ = (bitField0_ & ~0x00000010);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Resource name of the trace associated with the log entry, if any.
     * If this field contains a relative resource name, you can assume the name is
     * relative to `//tracing.googleapis.com`. Example:
     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
     * </pre>
     *
     * <code>string trace = 15;</code>
     *
     * @param value The bytes for trace to set.
     * @return This builder for chaining.
     */
    public Builder setTraceBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      trace_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }

    private java.lang.Object insertId_ = "";
    /**
     *
     *
     * <pre>
     * A unique ID for the log entry used for deduplication. If omitted,
     * the implementation will generate one based on operation_id.
     * </pre>
     *
     * <code>string insert_id = 4;</code>
     *
     * @return The insertId.
     */
    public java.lang.String getInsertId() {
      java.lang.Object ref = insertId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        insertId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A unique ID for the log entry used for deduplication. If omitted,
     * the implementation will generate one based on operation_id.
     * </pre>
     *
     * <code>string insert_id = 4;</code>
     *
     * @return The bytes for insertId.
     */
    public com.google.protobuf.ByteString getInsertIdBytes() {
      java.lang.Object ref = insertId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        insertId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A unique ID for the log entry used for deduplication. If omitted,
     * the implementation will generate one based on operation_id.
     * </pre>
     *
     * <code>string insert_id = 4;</code>
     *
     * @param value The insertId to set.
     * @return This builder for chaining.
     */
    public Builder setInsertId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      insertId_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A unique ID for the log entry used for deduplication. If omitted,
     * the implementation will generate one based on operation_id.
     * </pre>
     *
     * <code>string insert_id = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearInsertId() {
      insertId_ = getDefaultInstance().getInsertId();
      bitField0_ = (bitField0_ & ~0x00000020);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A unique ID for the log entry used for deduplication. If omitted,
     * the implementation will generate one based on operation_id.
     * </pre>
     *
     * <code>string insert_id = 4;</code>
     *
     * @param value The bytes for insertId to set.
     * @return This builder for chaining.
     */
    public Builder setInsertIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      insertId_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
      if (labels_ == null) {
        return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      return labels_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableLabels() {
      if (labels_ == null) {
        labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      if (!labels_.isMutable()) {
        labels_ = labels_.copy();
      }
      bitField0_ |= 0x00000040;
      onChanged();
      return labels_;
    }

    public int getLabelsCount() {
      return internalGetLabels().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * A set of user-defined (key, value) data that provides additional
     * information about the log entry.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 13;</code>
     */
    @java.lang.Override
    public boolean containsLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetLabels().getMap().containsKey(key);
    }
    /** Use {@link #getLabelsMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getLabels() {
      return getLabelsMap();
    }
    /**
     *
     *
     * <pre>
     * A set of user-defined (key, value) data that provides additional
     * information about the log entry.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 13;</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
      return internalGetLabels().getMap();
    }
    /**
     *
     *
     * <pre>
     * A set of user-defined (key, value) data that provides additional
     * information about the log entry.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 13;</code>
     */
    @java.lang.Override
    public /* nullable */ java.lang.String getLabelsOrDefault(
        java.lang.String key,
        /* nullable */
        java.lang.String defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * A set of user-defined (key, value) data that provides additional
     * information about the log entry.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 13;</code>
     */
    @java.lang.Override
    public java.lang.String getLabelsOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearLabels() {
      bitField0_ = (bitField0_ & ~0x00000040);
      internalGetMutableLabels().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A set of user-defined (key, value) data that provides additional
     * information about the log entry.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 13;</code>
     */
    public Builder removeLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableLabels().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() {
      bitField0_ |= 0x00000040;
      return internalGetMutableLabels().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * A set of user-defined (key, value) data that provides additional
     * information about the log entry.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 13;</code>
     */
    public Builder putLabels(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }
      internalGetMutableLabels().getMutableMap().put(key, value);
      bitField0_ |= 0x00000040;
      return this;
    }
    /**
     *
     *
     * <pre>
     * A set of user-defined (key, value) data that provides additional
     * information about the log entry.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 13;</code>
     */
    public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableLabels().getMutableMap().putAll(values);
      bitField0_ |= 0x00000040;
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Any,
            com.google.protobuf.Any.Builder,
            com.google.protobuf.AnyOrBuilder>
        protoPayloadBuilder_;
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a protocol buffer that is
     * expressed as a JSON object. The only accepted type currently is
     * [AuditLog][google.cloud.audit.AuditLog].
     * </pre>
     *
     * <code>.google.protobuf.Any proto_payload = 2;</code>
     *
     * @return Whether the protoPayload field is set.
     */
    @java.lang.Override
    public boolean hasProtoPayload() {
      return payloadCase_ == 2;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a protocol buffer that is
     * expressed as a JSON object. The only accepted type currently is
     * [AuditLog][google.cloud.audit.AuditLog].
     * </pre>
     *
     * <code>.google.protobuf.Any proto_payload = 2;</code>
     *
     * @return The protoPayload.
     */
    @java.lang.Override
    public com.google.protobuf.Any getProtoPayload() {
      if (protoPayloadBuilder_ == null) {
        if (payloadCase_ == 2) {
          return (com.google.protobuf.Any) payload_;
        }
        return com.google.protobuf.Any.getDefaultInstance();
      } else {
        if (payloadCase_ == 2) {
          return protoPayloadBuilder_.getMessage();
        }
        return com.google.protobuf.Any.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a protocol buffer that is
     * expressed as a JSON object. The only accepted type currently is
     * [AuditLog][google.cloud.audit.AuditLog].
     * </pre>
     *
     * <code>.google.protobuf.Any proto_payload = 2;</code>
     */
    public Builder setProtoPayload(com.google.protobuf.Any value) {
      if (protoPayloadBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        payload_ = value;
        onChanged();
      } else {
        protoPayloadBuilder_.setMessage(value);
      }
      payloadCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a protocol buffer that is
     * expressed as a JSON object. The only accepted type currently is
     * [AuditLog][google.cloud.audit.AuditLog].
     * </pre>
     *
     * <code>.google.protobuf.Any proto_payload = 2;</code>
     */
    public Builder setProtoPayload(com.google.protobuf.Any.Builder builderForValue) {
      if (protoPayloadBuilder_ == null) {
        payload_ = builderForValue.build();
        onChanged();
      } else {
        protoPayloadBuilder_.setMessage(builderForValue.build());
      }
      payloadCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a protocol buffer that is
     * expressed as a JSON object. The only accepted type currently is
     * [AuditLog][google.cloud.audit.AuditLog].
     * </pre>
     *
     * <code>.google.protobuf.Any proto_payload = 2;</code>
     */
    public Builder mergeProtoPayload(com.google.protobuf.Any value) {
      if (protoPayloadBuilder_ == null) {
        if (payloadCase_ == 2 && payload_ != com.google.protobuf.Any.getDefaultInstance()) {
          payload_ =
              com.google.protobuf.Any.newBuilder((com.google.protobuf.Any) payload_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          payload_ = value;
        }
        onChanged();
      } else {
        if (payloadCase_ == 2) {
          protoPayloadBuilder_.mergeFrom(value);
        } else {
          protoPayloadBuilder_.setMessage(value);
        }
      }
      payloadCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a protocol buffer that is
     * expressed as a JSON object. The only accepted type currently is
     * [AuditLog][google.cloud.audit.AuditLog].
     * </pre>
     *
     * <code>.google.protobuf.Any proto_payload = 2;</code>
     */
    public Builder clearProtoPayload() {
      if (protoPayloadBuilder_ == null) {
        if (payloadCase_ == 2) {
          payloadCase_ = 0;
          payload_ = null;
          onChanged();
        }
      } else {
        if (payloadCase_ == 2) {
          payloadCase_ = 0;
          payload_ = null;
        }
        protoPayloadBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a protocol buffer that is
     * expressed as a JSON object. The only accepted type currently is
     * [AuditLog][google.cloud.audit.AuditLog].
     * </pre>
     *
     * <code>.google.protobuf.Any proto_payload = 2;</code>
     */
    public com.google.protobuf.Any.Builder getProtoPayloadBuilder() {
      return getProtoPayloadFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a protocol buffer that is
     * expressed as a JSON object. The only accepted type currently is
     * [AuditLog][google.cloud.audit.AuditLog].
     * </pre>
     *
     * <code>.google.protobuf.Any proto_payload = 2;</code>
     */
    @java.lang.Override
    public com.google.protobuf.AnyOrBuilder getProtoPayloadOrBuilder() {
      if ((payloadCase_ == 2) && (protoPayloadBuilder_ != null)) {
        return protoPayloadBuilder_.getMessageOrBuilder();
      } else {
        if (payloadCase_ == 2) {
          return (com.google.protobuf.Any) payload_;
        }
        return com.google.protobuf.Any.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a protocol buffer that is
     * expressed as a JSON object. The only accepted type currently is
     * [AuditLog][google.cloud.audit.AuditLog].
     * </pre>
     *
     * <code>.google.protobuf.Any proto_payload = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Any,
            com.google.protobuf.Any.Builder,
            com.google.protobuf.AnyOrBuilder>
        getProtoPayloadFieldBuilder() {
      if (protoPayloadBuilder_ == null) {
        if (!(payloadCase_ == 2)) {
          payload_ = com.google.protobuf.Any.getDefaultInstance();
        }
        protoPayloadBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Any,
                com.google.protobuf.Any.Builder,
                com.google.protobuf.AnyOrBuilder>(
                (com.google.protobuf.Any) payload_, getParentForChildren(), isClean());
        payload_ = null;
      }
      payloadCase_ = 2;
      onChanged();
      return protoPayloadBuilder_;
    }

    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a Unicode string (UTF-8).
     * </pre>
     *
     * <code>string text_payload = 3;</code>
     *
     * @return Whether the textPayload field is set.
     */
    @java.lang.Override
    public boolean hasTextPayload() {
      return payloadCase_ == 3;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a Unicode string (UTF-8).
     * </pre>
     *
     * <code>string text_payload = 3;</code>
     *
     * @return The textPayload.
     */
    @java.lang.Override
    public java.lang.String getTextPayload() {
      java.lang.Object ref = "";
      if (payloadCase_ == 3) {
        ref = payload_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (payloadCase_ == 3) {
          payload_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a Unicode string (UTF-8).
     * </pre>
     *
     * <code>string text_payload = 3;</code>
     *
     * @return The bytes for textPayload.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getTextPayloadBytes() {
      java.lang.Object ref = "";
      if (payloadCase_ == 3) {
        ref = payload_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (payloadCase_ == 3) {
          payload_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a Unicode string (UTF-8).
     * </pre>
     *
     * <code>string text_payload = 3;</code>
     *
     * @param value The textPayload to set.
     * @return This builder for chaining.
     */
    public Builder setTextPayload(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      payloadCase_ = 3;
      payload_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a Unicode string (UTF-8).
     * </pre>
     *
     * <code>string text_payload = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTextPayload() {
      if (payloadCase_ == 3) {
        payloadCase_ = 0;
        payload_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a Unicode string (UTF-8).
     * </pre>
     *
     * <code>string text_payload = 3;</code>
     *
     * @param value The bytes for textPayload to set.
     * @return This builder for chaining.
     */
    public Builder setTextPayloadBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      payloadCase_ = 3;
      payload_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Struct,
            com.google.protobuf.Struct.Builder,
            com.google.protobuf.StructOrBuilder>
        structPayloadBuilder_;
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a structure that
     * is expressed as a JSON object.
     * </pre>
     *
     * <code>.google.protobuf.Struct struct_payload = 6;</code>
     *
     * @return Whether the structPayload field is set.
     */
    @java.lang.Override
    public boolean hasStructPayload() {
      return payloadCase_ == 6;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a structure that
     * is expressed as a JSON object.
     * </pre>
     *
     * <code>.google.protobuf.Struct struct_payload = 6;</code>
     *
     * @return The structPayload.
     */
    @java.lang.Override
    public com.google.protobuf.Struct getStructPayload() {
      if (structPayloadBuilder_ == null) {
        if (payloadCase_ == 6) {
          return (com.google.protobuf.Struct) payload_;
        }
        return com.google.protobuf.Struct.getDefaultInstance();
      } else {
        if (payloadCase_ == 6) {
          return structPayloadBuilder_.getMessage();
        }
        return com.google.protobuf.Struct.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a structure that
     * is expressed as a JSON object.
     * </pre>
     *
     * <code>.google.protobuf.Struct struct_payload = 6;</code>
     */
    public Builder setStructPayload(com.google.protobuf.Struct value) {
      if (structPayloadBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        payload_ = value;
        onChanged();
      } else {
        structPayloadBuilder_.setMessage(value);
      }
      payloadCase_ = 6;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a structure that
     * is expressed as a JSON object.
     * </pre>
     *
     * <code>.google.protobuf.Struct struct_payload = 6;</code>
     */
    public Builder setStructPayload(com.google.protobuf.Struct.Builder builderForValue) {
      if (structPayloadBuilder_ == null) {
        payload_ = builderForValue.build();
        onChanged();
      } else {
        structPayloadBuilder_.setMessage(builderForValue.build());
      }
      payloadCase_ = 6;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a structure that
     * is expressed as a JSON object.
     * </pre>
     *
     * <code>.google.protobuf.Struct struct_payload = 6;</code>
     */
    public Builder mergeStructPayload(com.google.protobuf.Struct value) {
      if (structPayloadBuilder_ == null) {
        if (payloadCase_ == 6 && payload_ != com.google.protobuf.Struct.getDefaultInstance()) {
          payload_ =
              com.google.protobuf.Struct.newBuilder((com.google.protobuf.Struct) payload_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          payload_ = value;
        }
        onChanged();
      } else {
        if (payloadCase_ == 6) {
          structPayloadBuilder_.mergeFrom(value);
        } else {
          structPayloadBuilder_.setMessage(value);
        }
      }
      payloadCase_ = 6;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a structure that
     * is expressed as a JSON object.
     * </pre>
     *
     * <code>.google.protobuf.Struct struct_payload = 6;</code>
     */
    public Builder clearStructPayload() {
      if (structPayloadBuilder_ == null) {
        if (payloadCase_ == 6) {
          payloadCase_ = 0;
          payload_ = null;
          onChanged();
        }
      } else {
        if (payloadCase_ == 6) {
          payloadCase_ = 0;
          payload_ = null;
        }
        structPayloadBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a structure that
     * is expressed as a JSON object.
     * </pre>
     *
     * <code>.google.protobuf.Struct struct_payload = 6;</code>
     */
    public com.google.protobuf.Struct.Builder getStructPayloadBuilder() {
      return getStructPayloadFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a structure that
     * is expressed as a JSON object.
     * </pre>
     *
     * <code>.google.protobuf.Struct struct_payload = 6;</code>
     */
    @java.lang.Override
    public com.google.protobuf.StructOrBuilder getStructPayloadOrBuilder() {
      if ((payloadCase_ == 6) && (structPayloadBuilder_ != null)) {
        return structPayloadBuilder_.getMessageOrBuilder();
      } else {
        if (payloadCase_ == 6) {
          return (com.google.protobuf.Struct) payload_;
        }
        return com.google.protobuf.Struct.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The log entry payload, represented as a structure that
     * is expressed as a JSON object.
     * </pre>
     *
     * <code>.google.protobuf.Struct struct_payload = 6;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Struct,
            com.google.protobuf.Struct.Builder,
            com.google.protobuf.StructOrBuilder>
        getStructPayloadFieldBuilder() {
      if (structPayloadBuilder_ == null) {
        if (!(payloadCase_ == 6)) {
          payload_ = com.google.protobuf.Struct.getDefaultInstance();
        }
        structPayloadBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Struct,
                com.google.protobuf.Struct.Builder,
                com.google.protobuf.StructOrBuilder>(
                (com.google.protobuf.Struct) payload_, getParentForChildren(), isClean());
        payload_ = null;
      }
      payloadCase_ = 6;
      onChanged();
      return structPayloadBuilder_;
    }

    private com.google.api.servicecontrol.v1.LogEntryOperation operation_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.api.servicecontrol.v1.LogEntryOperation,
            com.google.api.servicecontrol.v1.LogEntryOperation.Builder,
            com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder>
        operationBuilder_;
    /**
     *
     *
     * <pre>
     * Optional. Information about an operation associated with the log entry, if
     * applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
     *
     * @return Whether the operation field is set.
     */
    public boolean hasOperation() {
      return ((bitField0_ & 0x00000400) != 0);
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about an operation associated with the log entry, if
     * applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
     *
     * @return The operation.
     */
    public com.google.api.servicecontrol.v1.LogEntryOperation getOperation() {
      if (operationBuilder_ == null) {
        return operation_ == null
            ? com.google.api.servicecontrol.v1.LogEntryOperation.getDefaultInstance()
            : operation_;
      } else {
        return operationBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about an operation associated with the log entry, if
     * applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
     */
    public Builder setOperation(com.google.api.servicecontrol.v1.LogEntryOperation value) {
      if (operationBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        operation_ = value;
      } else {
        operationBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000400;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about an operation associated with the log entry, if
     * applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
     */
    public Builder setOperation(
        com.google.api.servicecontrol.v1.LogEntryOperation.Builder builderForValue) {
      if (operationBuilder_ == null) {
        operation_ = builderForValue.build();
      } else {
        operationBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000400;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about an operation associated with the log entry, if
     * applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
     */
    public Builder mergeOperation(com.google.api.servicecontrol.v1.LogEntryOperation value) {
      if (operationBuilder_ == null) {
        if (((bitField0_ & 0x00000400) != 0)
            && operation_ != null
            && operation_
                != com.google.api.servicecontrol.v1.LogEntryOperation.getDefaultInstance()) {
          getOperationBuilder().mergeFrom(value);
        } else {
          operation_ = value;
        }
      } else {
        operationBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000400;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about an operation associated with the log entry, if
     * applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
     */
    public Builder clearOperation() {
      bitField0_ = (bitField0_ & ~0x00000400);
      operation_ = null;
      if (operationBuilder_ != null) {
        operationBuilder_.dispose();
        operationBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about an operation associated with the log entry, if
     * applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
     */
    public com.google.api.servicecontrol.v1.LogEntryOperation.Builder getOperationBuilder() {
      bitField0_ |= 0x00000400;
      onChanged();
      return getOperationFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about an operation associated with the log entry, if
     * applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
     */
    public com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder getOperationOrBuilder() {
      if (operationBuilder_ != null) {
        return operationBuilder_.getMessageOrBuilder();
      } else {
        return operation_ == null
            ? com.google.api.servicecontrol.v1.LogEntryOperation.getDefaultInstance()
            : operation_;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Information about an operation associated with the log entry, if
     * applicable.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntryOperation operation = 16;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.api.servicecontrol.v1.LogEntryOperation,
            com.google.api.servicecontrol.v1.LogEntryOperation.Builder,
            com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder>
        getOperationFieldBuilder() {
      if (operationBuilder_ == null) {
        operationBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.api.servicecontrol.v1.LogEntryOperation,
                com.google.api.servicecontrol.v1.LogEntryOperation.Builder,
                com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder>(
                getOperation(), getParentForChildren(), isClean());
        operation_ = null;
      }
      return operationBuilder_;
    }

    private com.google.api.servicecontrol.v1.LogEntrySourceLocation sourceLocation_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.api.servicecontrol.v1.LogEntrySourceLocation,
            com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder,
            com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder>
        sourceLocationBuilder_;
    /**
     *
     *
     * <pre>
     * Optional. Source code location information associated with the log entry,
     * if any.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
     *
     * @return Whether the sourceLocation field is set.
     */
    public boolean hasSourceLocation() {
      return ((bitField0_ & 0x00000800) != 0);
    }
    /**
     *
     *
     * <pre>
     * Optional. Source code location information associated with the log entry,
     * if any.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
     *
     * @return The sourceLocation.
     */
    public com.google.api.servicecontrol.v1.LogEntrySourceLocation getSourceLocation() {
      if (sourceLocationBuilder_ == null) {
        return sourceLocation_ == null
            ? com.google.api.servicecontrol.v1.LogEntrySourceLocation.getDefaultInstance()
            : sourceLocation_;
      } else {
        return sourceLocationBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Source code location information associated with the log entry,
     * if any.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
     */
    public Builder setSourceLocation(
        com.google.api.servicecontrol.v1.LogEntrySourceLocation value) {
      if (sourceLocationBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        sourceLocation_ = value;
      } else {
        sourceLocationBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Source code location information associated with the log entry,
     * if any.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
     */
    public Builder setSourceLocation(
        com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder builderForValue) {
      if (sourceLocationBuilder_ == null) {
        sourceLocation_ = builderForValue.build();
      } else {
        sourceLocationBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Source code location information associated with the log entry,
     * if any.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
     */
    public Builder mergeSourceLocation(
        com.google.api.servicecontrol.v1.LogEntrySourceLocation value) {
      if (sourceLocationBuilder_ == null) {
        if (((bitField0_ & 0x00000800) != 0)
            && sourceLocation_ != null
            && sourceLocation_
                != com.google.api.servicecontrol.v1.LogEntrySourceLocation.getDefaultInstance()) {
          getSourceLocationBuilder().mergeFrom(value);
        } else {
          sourceLocation_ = value;
        }
      } else {
        sourceLocationBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Source code location information associated with the log entry,
     * if any.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
     */
    public Builder clearSourceLocation() {
      bitField0_ = (bitField0_ & ~0x00000800);
      sourceLocation_ = null;
      if (sourceLocationBuilder_ != null) {
        sourceLocationBuilder_.dispose();
        sourceLocationBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Source code location information associated with the log entry,
     * if any.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
     */
    public com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder
        getSourceLocationBuilder() {
      bitField0_ |= 0x00000800;
      onChanged();
      return getSourceLocationFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional. Source code location information associated with the log entry,
     * if any.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
     */
    public com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder
        getSourceLocationOrBuilder() {
      if (sourceLocationBuilder_ != null) {
        return sourceLocationBuilder_.getMessageOrBuilder();
      } else {
        return sourceLocation_ == null
            ? com.google.api.servicecontrol.v1.LogEntrySourceLocation.getDefaultInstance()
            : sourceLocation_;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Source code location information associated with the log entry,
     * if any.
     * </pre>
     *
     * <code>.google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.api.servicecontrol.v1.LogEntrySourceLocation,
            com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder,
            com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder>
        getSourceLocationFieldBuilder() {
      if (sourceLocationBuilder_ == null) {
        sourceLocationBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.api.servicecontrol.v1.LogEntrySourceLocation,
                com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder,
                com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder>(
                getSourceLocation(), getParentForChildren(), isClean());
        sourceLocation_ = null;
      }
      return sourceLocationBuilder_;
    }

    @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.api.servicecontrol.v1.LogEntry)
  }

  // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.LogEntry)
  private static final com.google.api.servicecontrol.v1.LogEntry DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.LogEntry();
  }

  public static com.google.api.servicecontrol.v1.LogEntry getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<LogEntry> PARSER =
      new com.google.protobuf.AbstractParser<LogEntry>() {
        @java.lang.Override
        public LogEntry 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<LogEntry> parser() {
    return PARSER;
  }

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

  @java.lang.Override
  public com.google.api.servicecontrol.v1.LogEntry getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
