/*
 * 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/cloud/iot/v1/resources.proto

package com.google.cloud.iot.v1;

/**
 *
 *
 * <pre>
 * The device configuration. Eventually delivered to devices.
 * </pre>
 *
 * Protobuf type {@code google.cloud.iot.v1.DeviceConfig}
 */
public final class DeviceConfig extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.DeviceConfig)
    DeviceConfigOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use DeviceConfig.newBuilder() to construct.
  private DeviceConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private DeviceConfig() {
    binaryData_ = com.google.protobuf.ByteString.EMPTY;
  }

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

  @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.cloud.iot.v1.ResourcesProto
        .internal_static_google_cloud_iot_v1_DeviceConfig_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.iot.v1.ResourcesProto
        .internal_static_google_cloud_iot_v1_DeviceConfig_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.iot.v1.DeviceConfig.class,
            com.google.cloud.iot.v1.DeviceConfig.Builder.class);
  }

  public static final int VERSION_FIELD_NUMBER = 1;
  private long version_ = 0L;
  /**
   *
   *
   * <pre>
   * [Output only] The version of this update. The version number is assigned by
   * the server, and is always greater than 0 after device creation. The
   * version must be 0 on the `CreateDevice` request if a `config` is
   * specified; the response of `CreateDevice` will always have a value of 1.
   * </pre>
   *
   * <code>int64 version = 1;</code>
   *
   * @return The version.
   */
  @java.lang.Override
  public long getVersion() {
    return version_;
  }

  public static final int CLOUD_UPDATE_TIME_FIELD_NUMBER = 2;
  private com.google.protobuf.Timestamp cloudUpdateTime_;
  /**
   *
   *
   * <pre>
   * [Output only] The time at which this configuration version was updated in
   * Cloud IoT Core. This timestamp is set by the server.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
   *
   * @return Whether the cloudUpdateTime field is set.
   */
  @java.lang.Override
  public boolean hasCloudUpdateTime() {
    return cloudUpdateTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The time at which this configuration version was updated in
   * Cloud IoT Core. This timestamp is set by the server.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
   *
   * @return The cloudUpdateTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getCloudUpdateTime() {
    return cloudUpdateTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : cloudUpdateTime_;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The time at which this configuration version was updated in
   * Cloud IoT Core. This timestamp is set by the server.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getCloudUpdateTimeOrBuilder() {
    return cloudUpdateTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : cloudUpdateTime_;
  }

  public static final int DEVICE_ACK_TIME_FIELD_NUMBER = 3;
  private com.google.protobuf.Timestamp deviceAckTime_;
  /**
   *
   *
   * <pre>
   * [Output only] The time at which Cloud IoT Core received the
   * acknowledgment from the device, indicating that the device has received
   * this configuration version. If this field is not present, the device has
   * not yet acknowledged that it received this version. Note that when
   * the config was sent to the device, many config versions may have been
   * available in Cloud IoT Core while the device was disconnected, and on
   * connection, only the latest version is sent to the device. Some
   * versions may never be sent to the device, and therefore are never
   * acknowledged. This timestamp is set by Cloud IoT Core.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
   *
   * @return Whether the deviceAckTime field is set.
   */
  @java.lang.Override
  public boolean hasDeviceAckTime() {
    return deviceAckTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The time at which Cloud IoT Core received the
   * acknowledgment from the device, indicating that the device has received
   * this configuration version. If this field is not present, the device has
   * not yet acknowledged that it received this version. Note that when
   * the config was sent to the device, many config versions may have been
   * available in Cloud IoT Core while the device was disconnected, and on
   * connection, only the latest version is sent to the device. Some
   * versions may never be sent to the device, and therefore are never
   * acknowledged. This timestamp is set by Cloud IoT Core.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
   *
   * @return The deviceAckTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getDeviceAckTime() {
    return deviceAckTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : deviceAckTime_;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The time at which Cloud IoT Core received the
   * acknowledgment from the device, indicating that the device has received
   * this configuration version. If this field is not present, the device has
   * not yet acknowledged that it received this version. Note that when
   * the config was sent to the device, many config versions may have been
   * available in Cloud IoT Core while the device was disconnected, and on
   * connection, only the latest version is sent to the device. Some
   * versions may never be sent to the device, and therefore are never
   * acknowledged. This timestamp is set by Cloud IoT Core.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getDeviceAckTimeOrBuilder() {
    return deviceAckTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : deviceAckTime_;
  }

  public static final int BINARY_DATA_FIELD_NUMBER = 4;
  private com.google.protobuf.ByteString binaryData_ = com.google.protobuf.ByteString.EMPTY;
  /**
   *
   *
   * <pre>
   * The device configuration data.
   * </pre>
   *
   * <code>bytes binary_data = 4;</code>
   *
   * @return The binaryData.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getBinaryData() {
    return binaryData_;
  }

  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 (version_ != 0L) {
      output.writeInt64(1, version_);
    }
    if (cloudUpdateTime_ != null) {
      output.writeMessage(2, getCloudUpdateTime());
    }
    if (deviceAckTime_ != null) {
      output.writeMessage(3, getDeviceAckTime());
    }
    if (!binaryData_.isEmpty()) {
      output.writeBytes(4, binaryData_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (version_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, version_);
    }
    if (cloudUpdateTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCloudUpdateTime());
    }
    if (deviceAckTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDeviceAckTime());
    }
    if (!binaryData_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, binaryData_);
    }
    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.cloud.iot.v1.DeviceConfig)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.DeviceConfig other = (com.google.cloud.iot.v1.DeviceConfig) obj;

    if (getVersion() != other.getVersion()) return false;
    if (hasCloudUpdateTime() != other.hasCloudUpdateTime()) return false;
    if (hasCloudUpdateTime()) {
      if (!getCloudUpdateTime().equals(other.getCloudUpdateTime())) return false;
    }
    if (hasDeviceAckTime() != other.hasDeviceAckTime()) return false;
    if (hasDeviceAckTime()) {
      if (!getDeviceAckTime().equals(other.getDeviceAckTime())) return false;
    }
    if (!getBinaryData().equals(other.getBinaryData())) 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) + VERSION_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getVersion());
    if (hasCloudUpdateTime()) {
      hash = (37 * hash) + CLOUD_UPDATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getCloudUpdateTime().hashCode();
    }
    if (hasDeviceAckTime()) {
      hash = (37 * hash) + DEVICE_ACK_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceAckTime().hashCode();
    }
    hash = (37 * hash) + BINARY_DATA_FIELD_NUMBER;
    hash = (53 * hash) + getBinaryData().hashCode();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.iot.v1.DeviceConfig parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

  public static com.google.cloud.iot.v1.DeviceConfig parseFrom(com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.DeviceConfig 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.cloud.iot.v1.DeviceConfig 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>
   * The device configuration. Eventually delivered to devices.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.DeviceConfig}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.DeviceConfig)
      com.google.cloud.iot.v1.DeviceConfigOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.ResourcesProto
          .internal_static_google_cloud_iot_v1_DeviceConfig_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.iot.v1.ResourcesProto
          .internal_static_google_cloud_iot_v1_DeviceConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.iot.v1.DeviceConfig.class,
              com.google.cloud.iot.v1.DeviceConfig.Builder.class);
    }

    // Construct using com.google.cloud.iot.v1.DeviceConfig.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      version_ = 0L;
      cloudUpdateTime_ = null;
      if (cloudUpdateTimeBuilder_ != null) {
        cloudUpdateTimeBuilder_.dispose();
        cloudUpdateTimeBuilder_ = null;
      }
      deviceAckTime_ = null;
      if (deviceAckTimeBuilder_ != null) {
        deviceAckTimeBuilder_.dispose();
        deviceAckTimeBuilder_ = null;
      }
      binaryData_ = com.google.protobuf.ByteString.EMPTY;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.iot.v1.ResourcesProto
          .internal_static_google_cloud_iot_v1_DeviceConfig_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.iot.v1.DeviceConfig getDefaultInstanceForType() {
      return com.google.cloud.iot.v1.DeviceConfig.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.cloud.iot.v1.DeviceConfig buildPartial() {
      com.google.cloud.iot.v1.DeviceConfig result = new com.google.cloud.iot.v1.DeviceConfig(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.cloud.iot.v1.DeviceConfig result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.version_ = version_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.cloudUpdateTime_ =
            cloudUpdateTimeBuilder_ == null ? cloudUpdateTime_ : cloudUpdateTimeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.deviceAckTime_ =
            deviceAckTimeBuilder_ == null ? deviceAckTime_ : deviceAckTimeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.binaryData_ = binaryData_;
      }
    }

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

    public Builder mergeFrom(com.google.cloud.iot.v1.DeviceConfig other) {
      if (other == com.google.cloud.iot.v1.DeviceConfig.getDefaultInstance()) return this;
      if (other.getVersion() != 0L) {
        setVersion(other.getVersion());
      }
      if (other.hasCloudUpdateTime()) {
        mergeCloudUpdateTime(other.getCloudUpdateTime());
      }
      if (other.hasDeviceAckTime()) {
        mergeDeviceAckTime(other.getDeviceAckTime());
      }
      if (other.getBinaryData() != com.google.protobuf.ByteString.EMPTY) {
        setBinaryData(other.getBinaryData());
      }
      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 8:
              {
                version_ = input.readInt64();
                bitField0_ |= 0x00000001;
                break;
              } // case 8
            case 18:
              {
                input.readMessage(getCloudUpdateTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                input.readMessage(getDeviceAckTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                binaryData_ = input.readBytes();
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private long version_;
    /**
     *
     *
     * <pre>
     * [Output only] The version of this update. The version number is assigned by
     * the server, and is always greater than 0 after device creation. The
     * version must be 0 on the `CreateDevice` request if a `config` is
     * specified; the response of `CreateDevice` will always have a value of 1.
     * </pre>
     *
     * <code>int64 version = 1;</code>
     *
     * @return The version.
     */
    @java.lang.Override
    public long getVersion() {
      return version_;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The version of this update. The version number is assigned by
     * the server, and is always greater than 0 after device creation. The
     * version must be 0 on the `CreateDevice` request if a `config` is
     * specified; the response of `CreateDevice` will always have a value of 1.
     * </pre>
     *
     * <code>int64 version = 1;</code>
     *
     * @param value The version to set.
     * @return This builder for chaining.
     */
    public Builder setVersion(long value) {

      version_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The version of this update. The version number is assigned by
     * the server, and is always greater than 0 after device creation. The
     * version must be 0 on the `CreateDevice` request if a `config` is
     * specified; the response of `CreateDevice` will always have a value of 1.
     * </pre>
     *
     * <code>int64 version = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearVersion() {
      bitField0_ = (bitField0_ & ~0x00000001);
      version_ = 0L;
      onChanged();
      return this;
    }

    private com.google.protobuf.Timestamp cloudUpdateTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        cloudUpdateTimeBuilder_;
    /**
     *
     *
     * <pre>
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     *
     * @return Whether the cloudUpdateTime field is set.
     */
    public boolean hasCloudUpdateTime() {
      return ((bitField0_ & 0x00000002) != 0);
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     *
     * @return The cloudUpdateTime.
     */
    public com.google.protobuf.Timestamp getCloudUpdateTime() {
      if (cloudUpdateTimeBuilder_ == null) {
        return cloudUpdateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : cloudUpdateTime_;
      } else {
        return cloudUpdateTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     */
    public Builder setCloudUpdateTime(com.google.protobuf.Timestamp value) {
      if (cloudUpdateTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        cloudUpdateTime_ = value;
      } else {
        cloudUpdateTimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     */
    public Builder setCloudUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (cloudUpdateTimeBuilder_ == null) {
        cloudUpdateTime_ = builderForValue.build();
      } else {
        cloudUpdateTimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     */
    public Builder mergeCloudUpdateTime(com.google.protobuf.Timestamp value) {
      if (cloudUpdateTimeBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)
            && cloudUpdateTime_ != null
            && cloudUpdateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getCloudUpdateTimeBuilder().mergeFrom(value);
        } else {
          cloudUpdateTime_ = value;
        }
      } else {
        cloudUpdateTimeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     */
    public Builder clearCloudUpdateTime() {
      bitField0_ = (bitField0_ & ~0x00000002);
      cloudUpdateTime_ = null;
      if (cloudUpdateTimeBuilder_ != null) {
        cloudUpdateTimeBuilder_.dispose();
        cloudUpdateTimeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     */
    public com.google.protobuf.Timestamp.Builder getCloudUpdateTimeBuilder() {
      bitField0_ |= 0x00000002;
      onChanged();
      return getCloudUpdateTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getCloudUpdateTimeOrBuilder() {
      if (cloudUpdateTimeBuilder_ != null) {
        return cloudUpdateTimeBuilder_.getMessageOrBuilder();
      } else {
        return cloudUpdateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : cloudUpdateTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getCloudUpdateTimeFieldBuilder() {
      if (cloudUpdateTimeBuilder_ == null) {
        cloudUpdateTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getCloudUpdateTime(), getParentForChildren(), isClean());
        cloudUpdateTime_ = null;
      }
      return cloudUpdateTimeBuilder_;
    }

    private com.google.protobuf.Timestamp deviceAckTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        deviceAckTimeBuilder_;
    /**
     *
     *
     * <pre>
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     *
     * @return Whether the deviceAckTime field is set.
     */
    public boolean hasDeviceAckTime() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     *
     * @return The deviceAckTime.
     */
    public com.google.protobuf.Timestamp getDeviceAckTime() {
      if (deviceAckTimeBuilder_ == null) {
        return deviceAckTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : deviceAckTime_;
      } else {
        return deviceAckTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     */
    public Builder setDeviceAckTime(com.google.protobuf.Timestamp value) {
      if (deviceAckTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        deviceAckTime_ = value;
      } else {
        deviceAckTimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     */
    public Builder setDeviceAckTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (deviceAckTimeBuilder_ == null) {
        deviceAckTime_ = builderForValue.build();
      } else {
        deviceAckTimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     */
    public Builder mergeDeviceAckTime(com.google.protobuf.Timestamp value) {
      if (deviceAckTimeBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)
            && deviceAckTime_ != null
            && deviceAckTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getDeviceAckTimeBuilder().mergeFrom(value);
        } else {
          deviceAckTime_ = value;
        }
      } else {
        deviceAckTimeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     */
    public Builder clearDeviceAckTime() {
      bitField0_ = (bitField0_ & ~0x00000004);
      deviceAckTime_ = null;
      if (deviceAckTimeBuilder_ != null) {
        deviceAckTimeBuilder_.dispose();
        deviceAckTimeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     */
    public com.google.protobuf.Timestamp.Builder getDeviceAckTimeBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return getDeviceAckTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getDeviceAckTimeOrBuilder() {
      if (deviceAckTimeBuilder_ != null) {
        return deviceAckTimeBuilder_.getMessageOrBuilder();
      } else {
        return deviceAckTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : deviceAckTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getDeviceAckTimeFieldBuilder() {
      if (deviceAckTimeBuilder_ == null) {
        deviceAckTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getDeviceAckTime(), getParentForChildren(), isClean());
        deviceAckTime_ = null;
      }
      return deviceAckTimeBuilder_;
    }

    private com.google.protobuf.ByteString binaryData_ = com.google.protobuf.ByteString.EMPTY;
    /**
     *
     *
     * <pre>
     * The device configuration data.
     * </pre>
     *
     * <code>bytes binary_data = 4;</code>
     *
     * @return The binaryData.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getBinaryData() {
      return binaryData_;
    }
    /**
     *
     *
     * <pre>
     * The device configuration data.
     * </pre>
     *
     * <code>bytes binary_data = 4;</code>
     *
     * @param value The binaryData to set.
     * @return This builder for chaining.
     */
    public Builder setBinaryData(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      binaryData_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The device configuration data.
     * </pre>
     *
     * <code>bytes binary_data = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearBinaryData() {
      bitField0_ = (bitField0_ & ~0x00000008);
      binaryData_ = getDefaultInstance().getBinaryData();
      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.cloud.iot.v1.DeviceConfig)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.iot.v1.DeviceConfig)
  private static final com.google.cloud.iot.v1.DeviceConfig DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.iot.v1.DeviceConfig();
  }

  public static com.google.cloud.iot.v1.DeviceConfig getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceConfig getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
