/*
 * 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/dataflow/v1beta3/streaming.proto

package com.google.dataflow.v1beta3;

/**
 *
 *
 * <pre>
 * Identifies a pubsub location to use for transferring data into or
 * out of a streaming Dataflow job.
 * </pre>
 *
 * Protobuf type {@code google.dataflow.v1beta3.PubsubLocation}
 */
public final class PubsubLocation extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.dataflow.v1beta3.PubsubLocation)
    PubsubLocationOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use PubsubLocation.newBuilder() to construct.
  private PubsubLocation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private PubsubLocation() {
    topic_ = "";
    subscription_ = "";
    timestampLabel_ = "";
    idLabel_ = "";
    trackingSubscription_ = "";
  }

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

  @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.dataflow.v1beta3.StreamingProto
        .internal_static_google_dataflow_v1beta3_PubsubLocation_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.dataflow.v1beta3.StreamingProto
        .internal_static_google_dataflow_v1beta3_PubsubLocation_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.dataflow.v1beta3.PubsubLocation.class,
            com.google.dataflow.v1beta3.PubsubLocation.Builder.class);
  }

  public static final int TOPIC_FIELD_NUMBER = 1;
  private volatile java.lang.Object topic_;
  /**
   *
   *
   * <pre>
   * A pubsub topic, in the form of
   * "pubsub.googleapis.com/topics/&lt;project-id&gt;/&lt;topic-name&gt;"
   * </pre>
   *
   * <code>string topic = 1;</code>
   *
   * @return The topic.
   */
  @java.lang.Override
  public java.lang.String getTopic() {
    java.lang.Object ref = topic_;
    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();
      topic_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * A pubsub topic, in the form of
   * "pubsub.googleapis.com/topics/&lt;project-id&gt;/&lt;topic-name&gt;"
   * </pre>
   *
   * <code>string topic = 1;</code>
   *
   * @return The bytes for topic.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getTopicBytes() {
    java.lang.Object ref = topic_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      topic_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SUBSCRIPTION_FIELD_NUMBER = 2;
  private volatile java.lang.Object subscription_;
  /**
   *
   *
   * <pre>
   * A pubsub subscription, in the form of
   * "pubsub.googleapis.com/subscriptions/&lt;project-id&gt;/&lt;subscription-name&gt;"
   * </pre>
   *
   * <code>string subscription = 2;</code>
   *
   * @return The subscription.
   */
  @java.lang.Override
  public java.lang.String getSubscription() {
    java.lang.Object ref = subscription_;
    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();
      subscription_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * A pubsub subscription, in the form of
   * "pubsub.googleapis.com/subscriptions/&lt;project-id&gt;/&lt;subscription-name&gt;"
   * </pre>
   *
   * <code>string subscription = 2;</code>
   *
   * @return The bytes for subscription.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getSubscriptionBytes() {
    java.lang.Object ref = subscription_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      subscription_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int TIMESTAMP_LABEL_FIELD_NUMBER = 3;
  private volatile java.lang.Object timestampLabel_;
  /**
   *
   *
   * <pre>
   * If set, contains a pubsub label from which to extract record timestamps.
   * If left empty, record timestamps will be generated upon arrival.
   * </pre>
   *
   * <code>string timestamp_label = 3;</code>
   *
   * @return The timestampLabel.
   */
  @java.lang.Override
  public java.lang.String getTimestampLabel() {
    java.lang.Object ref = timestampLabel_;
    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();
      timestampLabel_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * If set, contains a pubsub label from which to extract record timestamps.
   * If left empty, record timestamps will be generated upon arrival.
   * </pre>
   *
   * <code>string timestamp_label = 3;</code>
   *
   * @return The bytes for timestampLabel.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getTimestampLabelBytes() {
    java.lang.Object ref = timestampLabel_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      timestampLabel_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ID_LABEL_FIELD_NUMBER = 4;
  private volatile java.lang.Object idLabel_;
  /**
   *
   *
   * <pre>
   * If set, contains a pubsub label from which to extract record ids.
   * If left empty, record deduplication will be strictly best effort.
   * </pre>
   *
   * <code>string id_label = 4;</code>
   *
   * @return The idLabel.
   */
  @java.lang.Override
  public java.lang.String getIdLabel() {
    java.lang.Object ref = idLabel_;
    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();
      idLabel_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * If set, contains a pubsub label from which to extract record ids.
   * If left empty, record deduplication will be strictly best effort.
   * </pre>
   *
   * <code>string id_label = 4;</code>
   *
   * @return The bytes for idLabel.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getIdLabelBytes() {
    java.lang.Object ref = idLabel_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      idLabel_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DROP_LATE_DATA_FIELD_NUMBER = 5;
  private boolean dropLateData_;
  /**
   *
   *
   * <pre>
   * Indicates whether the pipeline allows late-arriving data.
   * </pre>
   *
   * <code>bool drop_late_data = 5;</code>
   *
   * @return The dropLateData.
   */
  @java.lang.Override
  public boolean getDropLateData() {
    return dropLateData_;
  }

  public static final int TRACKING_SUBSCRIPTION_FIELD_NUMBER = 6;
  private volatile java.lang.Object trackingSubscription_;
  /**
   *
   *
   * <pre>
   * If set, specifies the pubsub subscription that will be used for tracking
   * custom time timestamps for watermark estimation.
   * </pre>
   *
   * <code>string tracking_subscription = 6;</code>
   *
   * @return The trackingSubscription.
   */
  @java.lang.Override
  public java.lang.String getTrackingSubscription() {
    java.lang.Object ref = trackingSubscription_;
    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();
      trackingSubscription_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * If set, specifies the pubsub subscription that will be used for tracking
   * custom time timestamps for watermark estimation.
   * </pre>
   *
   * <code>string tracking_subscription = 6;</code>
   *
   * @return The bytes for trackingSubscription.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getTrackingSubscriptionBytes() {
    java.lang.Object ref = trackingSubscription_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      trackingSubscription_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int WITH_ATTRIBUTES_FIELD_NUMBER = 7;
  private boolean withAttributes_;
  /**
   *
   *
   * <pre>
   * If true, then the client has requested to get pubsub attributes.
   * </pre>
   *
   * <code>bool with_attributes = 7;</code>
   *
   * @return The withAttributes.
   */
  @java.lang.Override
  public boolean getWithAttributes() {
    return withAttributes_;
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subscription_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timestampLabel_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, timestampLabel_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(idLabel_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, idLabel_);
    }
    if (dropLateData_ != false) {
      output.writeBool(5, dropLateData_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trackingSubscription_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, trackingSubscription_);
    }
    if (withAttributes_ != false) {
      output.writeBool(7, withAttributes_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, subscription_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timestampLabel_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, timestampLabel_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(idLabel_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, idLabel_);
    }
    if (dropLateData_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, dropLateData_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trackingSubscription_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, trackingSubscription_);
    }
    if (withAttributes_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, withAttributes_);
    }
    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.dataflow.v1beta3.PubsubLocation)) {
      return super.equals(obj);
    }
    com.google.dataflow.v1beta3.PubsubLocation other =
        (com.google.dataflow.v1beta3.PubsubLocation) obj;

    if (!getTopic().equals(other.getTopic())) return false;
    if (!getSubscription().equals(other.getSubscription())) return false;
    if (!getTimestampLabel().equals(other.getTimestampLabel())) return false;
    if (!getIdLabel().equals(other.getIdLabel())) return false;
    if (getDropLateData() != other.getDropLateData()) return false;
    if (!getTrackingSubscription().equals(other.getTrackingSubscription())) return false;
    if (getWithAttributes() != other.getWithAttributes()) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + TOPIC_FIELD_NUMBER;
    hash = (53 * hash) + getTopic().hashCode();
    hash = (37 * hash) + SUBSCRIPTION_FIELD_NUMBER;
    hash = (53 * hash) + getSubscription().hashCode();
    hash = (37 * hash) + TIMESTAMP_LABEL_FIELD_NUMBER;
    hash = (53 * hash) + getTimestampLabel().hashCode();
    hash = (37 * hash) + ID_LABEL_FIELD_NUMBER;
    hash = (53 * hash) + getIdLabel().hashCode();
    hash = (37 * hash) + DROP_LATE_DATA_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDropLateData());
    hash = (37 * hash) + TRACKING_SUBSCRIPTION_FIELD_NUMBER;
    hash = (53 * hash) + getTrackingSubscription().hashCode();
    hash = (37 * hash) + WITH_ATTRIBUTES_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getWithAttributes());
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.dataflow.v1beta3.PubsubLocation parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.dataflow.v1beta3.PubsubLocation parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.PubsubLocation parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

  public static com.google.dataflow.v1beta3.PubsubLocation parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.PubsubLocation parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

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

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

  public static com.google.dataflow.v1beta3.PubsubLocation 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.dataflow.v1beta3.PubsubLocation 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>
   * Identifies a pubsub location to use for transferring data into or
   * out of a streaming Dataflow job.
   * </pre>
   *
   * Protobuf type {@code google.dataflow.v1beta3.PubsubLocation}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.dataflow.v1beta3.PubsubLocation)
      com.google.dataflow.v1beta3.PubsubLocationOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.dataflow.v1beta3.StreamingProto
          .internal_static_google_dataflow_v1beta3_PubsubLocation_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.dataflow.v1beta3.StreamingProto
          .internal_static_google_dataflow_v1beta3_PubsubLocation_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.dataflow.v1beta3.PubsubLocation.class,
              com.google.dataflow.v1beta3.PubsubLocation.Builder.class);
    }

    // Construct using com.google.dataflow.v1beta3.PubsubLocation.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      topic_ = "";

      subscription_ = "";

      timestampLabel_ = "";

      idLabel_ = "";

      dropLateData_ = false;

      trackingSubscription_ = "";

      withAttributes_ = false;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.dataflow.v1beta3.StreamingProto
          .internal_static_google_dataflow_v1beta3_PubsubLocation_descriptor;
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.PubsubLocation getDefaultInstanceForType() {
      return com.google.dataflow.v1beta3.PubsubLocation.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.PubsubLocation build() {
      com.google.dataflow.v1beta3.PubsubLocation result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.PubsubLocation buildPartial() {
      com.google.dataflow.v1beta3.PubsubLocation result =
          new com.google.dataflow.v1beta3.PubsubLocation(this);
      result.topic_ = topic_;
      result.subscription_ = subscription_;
      result.timestampLabel_ = timestampLabel_;
      result.idLabel_ = idLabel_;
      result.dropLateData_ = dropLateData_;
      result.trackingSubscription_ = trackingSubscription_;
      result.withAttributes_ = withAttributes_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.dataflow.v1beta3.PubsubLocation) {
        return mergeFrom((com.google.dataflow.v1beta3.PubsubLocation) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.dataflow.v1beta3.PubsubLocation other) {
      if (other == com.google.dataflow.v1beta3.PubsubLocation.getDefaultInstance()) return this;
      if (!other.getTopic().isEmpty()) {
        topic_ = other.topic_;
        onChanged();
      }
      if (!other.getSubscription().isEmpty()) {
        subscription_ = other.subscription_;
        onChanged();
      }
      if (!other.getTimestampLabel().isEmpty()) {
        timestampLabel_ = other.timestampLabel_;
        onChanged();
      }
      if (!other.getIdLabel().isEmpty()) {
        idLabel_ = other.idLabel_;
        onChanged();
      }
      if (other.getDropLateData() != false) {
        setDropLateData(other.getDropLateData());
      }
      if (!other.getTrackingSubscription().isEmpty()) {
        trackingSubscription_ = other.trackingSubscription_;
        onChanged();
      }
      if (other.getWithAttributes() != false) {
        setWithAttributes(other.getWithAttributes());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                topic_ = input.readStringRequireUtf8();

                break;
              } // case 10
            case 18:
              {
                subscription_ = input.readStringRequireUtf8();

                break;
              } // case 18
            case 26:
              {
                timestampLabel_ = input.readStringRequireUtf8();

                break;
              } // case 26
            case 34:
              {
                idLabel_ = input.readStringRequireUtf8();

                break;
              } // case 34
            case 40:
              {
                dropLateData_ = input.readBool();

                break;
              } // case 40
            case 50:
              {
                trackingSubscription_ = input.readStringRequireUtf8();

                break;
              } // case 50
            case 56:
              {
                withAttributes_ = input.readBool();

                break;
              } // case 56
            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 java.lang.Object topic_ = "";
    /**
     *
     *
     * <pre>
     * A pubsub topic, in the form of
     * "pubsub.googleapis.com/topics/&lt;project-id&gt;/&lt;topic-name&gt;"
     * </pre>
     *
     * <code>string topic = 1;</code>
     *
     * @return The topic.
     */
    public java.lang.String getTopic() {
      java.lang.Object ref = topic_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        topic_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A pubsub topic, in the form of
     * "pubsub.googleapis.com/topics/&lt;project-id&gt;/&lt;topic-name&gt;"
     * </pre>
     *
     * <code>string topic = 1;</code>
     *
     * @return The bytes for topic.
     */
    public com.google.protobuf.ByteString getTopicBytes() {
      java.lang.Object ref = topic_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        topic_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A pubsub topic, in the form of
     * "pubsub.googleapis.com/topics/&lt;project-id&gt;/&lt;topic-name&gt;"
     * </pre>
     *
     * <code>string topic = 1;</code>
     *
     * @param value The topic to set.
     * @return This builder for chaining.
     */
    public Builder setTopic(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      topic_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A pubsub topic, in the form of
     * "pubsub.googleapis.com/topics/&lt;project-id&gt;/&lt;topic-name&gt;"
     * </pre>
     *
     * <code>string topic = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTopic() {

      topic_ = getDefaultInstance().getTopic();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A pubsub topic, in the form of
     * "pubsub.googleapis.com/topics/&lt;project-id&gt;/&lt;topic-name&gt;"
     * </pre>
     *
     * <code>string topic = 1;</code>
     *
     * @param value The bytes for topic to set.
     * @return This builder for chaining.
     */
    public Builder setTopicBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object subscription_ = "";
    /**
     *
     *
     * <pre>
     * A pubsub subscription, in the form of
     * "pubsub.googleapis.com/subscriptions/&lt;project-id&gt;/&lt;subscription-name&gt;"
     * </pre>
     *
     * <code>string subscription = 2;</code>
     *
     * @return The subscription.
     */
    public java.lang.String getSubscription() {
      java.lang.Object ref = subscription_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        subscription_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A pubsub subscription, in the form of
     * "pubsub.googleapis.com/subscriptions/&lt;project-id&gt;/&lt;subscription-name&gt;"
     * </pre>
     *
     * <code>string subscription = 2;</code>
     *
     * @return The bytes for subscription.
     */
    public com.google.protobuf.ByteString getSubscriptionBytes() {
      java.lang.Object ref = subscription_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        subscription_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A pubsub subscription, in the form of
     * "pubsub.googleapis.com/subscriptions/&lt;project-id&gt;/&lt;subscription-name&gt;"
     * </pre>
     *
     * <code>string subscription = 2;</code>
     *
     * @param value The subscription to set.
     * @return This builder for chaining.
     */
    public Builder setSubscription(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      subscription_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A pubsub subscription, in the form of
     * "pubsub.googleapis.com/subscriptions/&lt;project-id&gt;/&lt;subscription-name&gt;"
     * </pre>
     *
     * <code>string subscription = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSubscription() {

      subscription_ = getDefaultInstance().getSubscription();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A pubsub subscription, in the form of
     * "pubsub.googleapis.com/subscriptions/&lt;project-id&gt;/&lt;subscription-name&gt;"
     * </pre>
     *
     * <code>string subscription = 2;</code>
     *
     * @param value The bytes for subscription to set.
     * @return This builder for chaining.
     */
    public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object timestampLabel_ = "";
    /**
     *
     *
     * <pre>
     * If set, contains a pubsub label from which to extract record timestamps.
     * If left empty, record timestamps will be generated upon arrival.
     * </pre>
     *
     * <code>string timestamp_label = 3;</code>
     *
     * @return The timestampLabel.
     */
    public java.lang.String getTimestampLabel() {
      java.lang.Object ref = timestampLabel_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        timestampLabel_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * If set, contains a pubsub label from which to extract record timestamps.
     * If left empty, record timestamps will be generated upon arrival.
     * </pre>
     *
     * <code>string timestamp_label = 3;</code>
     *
     * @return The bytes for timestampLabel.
     */
    public com.google.protobuf.ByteString getTimestampLabelBytes() {
      java.lang.Object ref = timestampLabel_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        timestampLabel_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * If set, contains a pubsub label from which to extract record timestamps.
     * If left empty, record timestamps will be generated upon arrival.
     * </pre>
     *
     * <code>string timestamp_label = 3;</code>
     *
     * @param value The timestampLabel to set.
     * @return This builder for chaining.
     */
    public Builder setTimestampLabel(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      timestampLabel_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If set, contains a pubsub label from which to extract record timestamps.
     * If left empty, record timestamps will be generated upon arrival.
     * </pre>
     *
     * <code>string timestamp_label = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTimestampLabel() {

      timestampLabel_ = getDefaultInstance().getTimestampLabel();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If set, contains a pubsub label from which to extract record timestamps.
     * If left empty, record timestamps will be generated upon arrival.
     * </pre>
     *
     * <code>string timestamp_label = 3;</code>
     *
     * @param value The bytes for timestampLabel to set.
     * @return This builder for chaining.
     */
    public Builder setTimestampLabelBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object idLabel_ = "";
    /**
     *
     *
     * <pre>
     * If set, contains a pubsub label from which to extract record ids.
     * If left empty, record deduplication will be strictly best effort.
     * </pre>
     *
     * <code>string id_label = 4;</code>
     *
     * @return The idLabel.
     */
    public java.lang.String getIdLabel() {
      java.lang.Object ref = idLabel_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        idLabel_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * If set, contains a pubsub label from which to extract record ids.
     * If left empty, record deduplication will be strictly best effort.
     * </pre>
     *
     * <code>string id_label = 4;</code>
     *
     * @return The bytes for idLabel.
     */
    public com.google.protobuf.ByteString getIdLabelBytes() {
      java.lang.Object ref = idLabel_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        idLabel_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * If set, contains a pubsub label from which to extract record ids.
     * If left empty, record deduplication will be strictly best effort.
     * </pre>
     *
     * <code>string id_label = 4;</code>
     *
     * @param value The idLabel to set.
     * @return This builder for chaining.
     */
    public Builder setIdLabel(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      idLabel_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If set, contains a pubsub label from which to extract record ids.
     * If left empty, record deduplication will be strictly best effort.
     * </pre>
     *
     * <code>string id_label = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearIdLabel() {

      idLabel_ = getDefaultInstance().getIdLabel();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If set, contains a pubsub label from which to extract record ids.
     * If left empty, record deduplication will be strictly best effort.
     * </pre>
     *
     * <code>string id_label = 4;</code>
     *
     * @param value The bytes for idLabel to set.
     * @return This builder for chaining.
     */
    public Builder setIdLabelBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private boolean dropLateData_;
    /**
     *
     *
     * <pre>
     * Indicates whether the pipeline allows late-arriving data.
     * </pre>
     *
     * <code>bool drop_late_data = 5;</code>
     *
     * @return The dropLateData.
     */
    @java.lang.Override
    public boolean getDropLateData() {
      return dropLateData_;
    }
    /**
     *
     *
     * <pre>
     * Indicates whether the pipeline allows late-arriving data.
     * </pre>
     *
     * <code>bool drop_late_data = 5;</code>
     *
     * @param value The dropLateData to set.
     * @return This builder for chaining.
     */
    public Builder setDropLateData(boolean value) {

      dropLateData_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Indicates whether the pipeline allows late-arriving data.
     * </pre>
     *
     * <code>bool drop_late_data = 5;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDropLateData() {

      dropLateData_ = false;
      onChanged();
      return this;
    }

    private java.lang.Object trackingSubscription_ = "";
    /**
     *
     *
     * <pre>
     * If set, specifies the pubsub subscription that will be used for tracking
     * custom time timestamps for watermark estimation.
     * </pre>
     *
     * <code>string tracking_subscription = 6;</code>
     *
     * @return The trackingSubscription.
     */
    public java.lang.String getTrackingSubscription() {
      java.lang.Object ref = trackingSubscription_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        trackingSubscription_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * If set, specifies the pubsub subscription that will be used for tracking
     * custom time timestamps for watermark estimation.
     * </pre>
     *
     * <code>string tracking_subscription = 6;</code>
     *
     * @return The bytes for trackingSubscription.
     */
    public com.google.protobuf.ByteString getTrackingSubscriptionBytes() {
      java.lang.Object ref = trackingSubscription_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        trackingSubscription_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * If set, specifies the pubsub subscription that will be used for tracking
     * custom time timestamps for watermark estimation.
     * </pre>
     *
     * <code>string tracking_subscription = 6;</code>
     *
     * @param value The trackingSubscription to set.
     * @return This builder for chaining.
     */
    public Builder setTrackingSubscription(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      trackingSubscription_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If set, specifies the pubsub subscription that will be used for tracking
     * custom time timestamps for watermark estimation.
     * </pre>
     *
     * <code>string tracking_subscription = 6;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTrackingSubscription() {

      trackingSubscription_ = getDefaultInstance().getTrackingSubscription();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If set, specifies the pubsub subscription that will be used for tracking
     * custom time timestamps for watermark estimation.
     * </pre>
     *
     * <code>string tracking_subscription = 6;</code>
     *
     * @param value The bytes for trackingSubscription to set.
     * @return This builder for chaining.
     */
    public Builder setTrackingSubscriptionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private boolean withAttributes_;
    /**
     *
     *
     * <pre>
     * If true, then the client has requested to get pubsub attributes.
     * </pre>
     *
     * <code>bool with_attributes = 7;</code>
     *
     * @return The withAttributes.
     */
    @java.lang.Override
    public boolean getWithAttributes() {
      return withAttributes_;
    }
    /**
     *
     *
     * <pre>
     * If true, then the client has requested to get pubsub attributes.
     * </pre>
     *
     * <code>bool with_attributes = 7;</code>
     *
     * @param value The withAttributes to set.
     * @return This builder for chaining.
     */
    public Builder setWithAttributes(boolean value) {

      withAttributes_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If true, then the client has requested to get pubsub attributes.
     * </pre>
     *
     * <code>bool with_attributes = 7;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearWithAttributes() {

      withAttributes_ = false;
      onChanged();
      return this;
    }

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

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

    // @@protoc_insertion_point(builder_scope:google.dataflow.v1beta3.PubsubLocation)
  }

  // @@protoc_insertion_point(class_scope:google.dataflow.v1beta3.PubsubLocation)
  private static final com.google.dataflow.v1beta3.PubsubLocation DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.dataflow.v1beta3.PubsubLocation();
  }

  public static com.google.dataflow.v1beta3.PubsubLocation getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

  @java.lang.Override
  public com.google.dataflow.v1beta3.PubsubLocation getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
