public static class ListDeviceRegistriesPagedResponse
    extends AbstractPagedListResponse<
        ListDeviceRegistriesRequest,
        ListDeviceRegistriesResponse,
        DeviceRegistry,
        ListDeviceRegistriesPage,
        ListDeviceRegistriesFixedSizeCollection> {

  public static ApiFuture<ListDeviceRegistriesPagedResponse> createAsync(
      PageContext<ListDeviceRegistriesRequest, ListDeviceRegistriesResponse, DeviceRegistry>
          context,
      ApiFuture<ListDeviceRegistriesResponse> futureResponse) {
    ApiFuture<ListDeviceRegistriesPage> futurePage =
        ListDeviceRegistriesPage.createEmptyPage().createPageAsync(context, futureResponse);
    return ApiFutures.transform(
        futurePage,
        input -> new ListDeviceRegistriesPagedResponse(input),
        MoreExecutors.directExecutor());
  }

  private ListDeviceRegistriesPagedResponse(ListDeviceRegistriesPage page) {
    super(page, ListDeviceRegistriesFixedSizeCollection.createEmptyCollection());
  }
} public static class ListDevicesPagedResponse
    extends AbstractPagedListResponse<
        ListDevicesRequest,
        ListDevicesResponse,
        Device,
        ListDevicesPage,
        ListDevicesFixedSizeCollection> {

  public static ApiFuture<ListDevicesPagedResponse> createAsync(
      PageContext<ListDevicesRequest, ListDevicesResponse, Device> context,
      ApiFuture<ListDevicesResponse> futureResponse) {
    ApiFuture<ListDevicesPage> futurePage =
        ListDevicesPage.createEmptyPage().createPageAsync(context, futureResponse);
    return ApiFutures.transform(
        futurePage, input -> new ListDevicesPagedResponse(input), MoreExecutors.directExecutor());
  }

  private ListDevicesPagedResponse(ListDevicesPage page) {
    super(page, ListDevicesFixedSizeCollection.createEmptyCollection());
  }
} public final class BindDeviceToGatewayRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.BindDeviceToGatewayRequest)
    BindDeviceToGatewayRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use BindDeviceToGatewayRequest.newBuilder() to construct.
  private BindDeviceToGatewayRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private BindDeviceToGatewayRequest() {
    parent_ = "";
    gatewayId_ = "";
    deviceId_ = "";
  }

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

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

  private BindDeviceToGatewayRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              parent_ = s;
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

              gatewayId_ = s;
              break;
            }
          case 26:
            {
              java.lang.String s = input.readStringRequireUtf8();

              deviceId_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_BindDeviceToGatewayRequest_descriptor;
  }

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

  public static final int PARENT_FIELD_NUMBER = 1;
  private volatile java.lang.Object parent_;
  /**
   *
   *
   * <pre>
   * Required. The name of the registry. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The parent.
   */
  @java.lang.Override
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    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();
      parent_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The name of the registry. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int GATEWAY_ID_FIELD_NUMBER = 2;
  private volatile java.lang.Object gatewayId_;
  /**
   *
   *
   * <pre>
   * Required. The value of `gateway_id` can be either the device numeric ID or the
   * user-defined device identifier.
   * </pre>
   *
   * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The gatewayId.
   */
  @java.lang.Override
  public java.lang.String getGatewayId() {
    java.lang.Object ref = gatewayId_;
    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();
      gatewayId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The value of `gateway_id` can be either the device numeric ID or the
   * user-defined device identifier.
   * </pre>
   *
   * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for gatewayId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getGatewayIdBytes() {
    java.lang.Object ref = gatewayId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      gatewayId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DEVICE_ID_FIELD_NUMBER = 3;
  private volatile java.lang.Object deviceId_;
  /**
   *
   *
   * <pre>
   * Required. The device to associate with the specified gateway. The value of
   * `device_id` can be either the device numeric ID or the user-defined device
   * identifier.
   * </pre>
   *
   * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The deviceId.
   */
  @java.lang.Override
  public java.lang.String getDeviceId() {
    java.lang.Object ref = deviceId_;
    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();
      deviceId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The device to associate with the specified gateway. The value of
   * `device_id` can be either the device numeric ID or the user-defined device
   * identifier.
   * </pre>
   *
   * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for deviceId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDeviceIdBytes() {
    java.lang.Object ref = deviceId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      deviceId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gatewayId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, gatewayId_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deviceId_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gatewayId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, gatewayId_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, deviceId_);
    }
    size += unknownFields.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.BindDeviceToGatewayRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.BindDeviceToGatewayRequest other =
        (com.google.cloud.iot.v1.BindDeviceToGatewayRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (!getGatewayId().equals(other.getGatewayId())) return false;
    if (!getDeviceId().equals(other.getDeviceId())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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) + PARENT_FIELD_NUMBER;
    hash = (53 * hash) + getParent().hashCode();
    hash = (37 * hash) + GATEWAY_ID_FIELD_NUMBER;
    hash = (53 * hash) + getGatewayId().hashCode();
    hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER;
    hash = (53 * hash) + getDeviceId().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.BindDeviceToGatewayRequest 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.BindDeviceToGatewayRequest 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.BindDeviceToGatewayRequest 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.BindDeviceToGatewayRequest 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>
   * Request for `BindDeviceToGateway`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.BindDeviceToGatewayRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.BindDeviceToGatewayRequest)
      com.google.cloud.iot.v1.BindDeviceToGatewayRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_BindDeviceToGatewayRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      gatewayId_ = "";

      deviceId_ = "";

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.BindDeviceToGatewayRequest buildPartial() {
      com.google.cloud.iot.v1.BindDeviceToGatewayRequest result =
          new com.google.cloud.iot.v1.BindDeviceToGatewayRequest(this);
      result.parent_ = parent_;
      result.gatewayId_ = gatewayId_;
      result.deviceId_ = deviceId_;
      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.cloud.iot.v1.BindDeviceToGatewayRequest) {
        return mergeFrom((com.google.cloud.iot.v1.BindDeviceToGatewayRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.BindDeviceToGatewayRequest other) {
      if (other == com.google.cloud.iot.v1.BindDeviceToGatewayRequest.getDefaultInstance())
        return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        onChanged();
      }
      if (!other.getGatewayId().isEmpty()) {
        gatewayId_ = other.gatewayId_;
        onChanged();
      }
      if (!other.getDeviceId().isEmpty()) {
        deviceId_ = other.deviceId_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.BindDeviceToGatewayRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.BindDeviceToGatewayRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The parent.
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for parent.
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      parent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {

      parent_ = getDefaultInstance().getParent();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object gatewayId_ = "";
    /**
     *
     *
     * <pre>
     * Required. The value of `gateway_id` can be either the device numeric ID or the
     * user-defined device identifier.
     * </pre>
     *
     * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The gatewayId.
     */
    public java.lang.String getGatewayId() {
      java.lang.Object ref = gatewayId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        gatewayId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The value of `gateway_id` can be either the device numeric ID or the
     * user-defined device identifier.
     * </pre>
     *
     * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for gatewayId.
     */
    public com.google.protobuf.ByteString getGatewayIdBytes() {
      java.lang.Object ref = gatewayId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        gatewayId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The value of `gateway_id` can be either the device numeric ID or the
     * user-defined device identifier.
     * </pre>
     *
     * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The gatewayId to set.
     * @return This builder for chaining.
     */
    public Builder setGatewayId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      gatewayId_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The value of `gateway_id` can be either the device numeric ID or the
     * user-defined device identifier.
     * </pre>
     *
     * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearGatewayId() {

      gatewayId_ = getDefaultInstance().getGatewayId();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The value of `gateway_id` can be either the device numeric ID or the
     * user-defined device identifier.
     * </pre>
     *
     * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for gatewayId to set.
     * @return This builder for chaining.
     */
    public Builder setGatewayIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object deviceId_ = "";
    /**
     *
     *
     * <pre>
     * Required. The device to associate with the specified gateway. The value of
     * `device_id` can be either the device numeric ID or the user-defined device
     * identifier.
     * </pre>
     *
     * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The deviceId.
     */
    public java.lang.String getDeviceId() {
      java.lang.Object ref = deviceId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        deviceId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The device to associate with the specified gateway. The value of
     * `device_id` can be either the device numeric ID or the user-defined device
     * identifier.
     * </pre>
     *
     * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for deviceId.
     */
    public com.google.protobuf.ByteString getDeviceIdBytes() {
      java.lang.Object ref = deviceId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        deviceId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The device to associate with the specified gateway. The value of
     * `device_id` can be either the device numeric ID or the user-defined device
     * identifier.
     * </pre>
     *
     * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The deviceId to set.
     * @return This builder for chaining.
     */
    public Builder setDeviceId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      deviceId_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device to associate with the specified gateway. The value of
     * `device_id` can be either the device numeric ID or the user-defined device
     * identifier.
     * </pre>
     *
     * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDeviceId() {

      deviceId_ = getDefaultInstance().getDeviceId();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device to associate with the specified gateway. The value of
     * `device_id` can be either the device numeric ID or the user-defined device
     * identifier.
     * </pre>
     *
     * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for deviceId to set.
     * @return This builder for chaining.
     */
    public Builder setDeviceIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      deviceId_ = value;
      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.BindDeviceToGatewayRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<BindDeviceToGatewayRequest> PARSER =
      new com.google.protobuf.AbstractParser<BindDeviceToGatewayRequest>() {
        @java.lang.Override
        public BindDeviceToGatewayRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new BindDeviceToGatewayRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.BindDeviceToGatewayRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class BindDeviceToGatewayResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.BindDeviceToGatewayResponse)
    BindDeviceToGatewayResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use BindDeviceToGatewayResponse.newBuilder() to construct.
  private BindDeviceToGatewayResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private BindDeviceToGatewayResponse() {}

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

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

  private BindDeviceToGatewayResponse(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_BindDeviceToGatewayResponse_descriptor;
  }

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

  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 {
    unknownFields.writeTo(output);
  }

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

    size = 0;
    size += unknownFields.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.BindDeviceToGatewayResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.BindDeviceToGatewayResponse other =
        (com.google.cloud.iot.v1.BindDeviceToGatewayResponse) obj;

    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.BindDeviceToGatewayResponse 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.BindDeviceToGatewayResponse 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.BindDeviceToGatewayResponse 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.BindDeviceToGatewayResponse 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>
   * Response for `BindDeviceToGateway`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.BindDeviceToGatewayResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.BindDeviceToGatewayResponse)
      com.google.cloud.iot.v1.BindDeviceToGatewayResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_BindDeviceToGatewayResponse_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.BindDeviceToGatewayResponse buildPartial() {
      com.google.cloud.iot.v1.BindDeviceToGatewayResponse result =
          new com.google.cloud.iot.v1.BindDeviceToGatewayResponse(this);
      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.cloud.iot.v1.BindDeviceToGatewayResponse) {
        return mergeFrom((com.google.cloud.iot.v1.BindDeviceToGatewayResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.BindDeviceToGatewayResponse other) {
      if (other == com.google.cloud.iot.v1.BindDeviceToGatewayResponse.getDefaultInstance())
        return this;
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.BindDeviceToGatewayResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.BindDeviceToGatewayResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      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.BindDeviceToGatewayResponse)
  }

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

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

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

  private static final com.google.protobuf.Parser<BindDeviceToGatewayResponse> PARSER =
      new com.google.protobuf.AbstractParser<BindDeviceToGatewayResponse>() {
        @java.lang.Override
        public BindDeviceToGatewayResponse parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new BindDeviceToGatewayResponse(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.BindDeviceToGatewayResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class CreateDeviceRegistryRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.CreateDeviceRegistryRequest)
    CreateDeviceRegistryRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use CreateDeviceRegistryRequest.newBuilder() to construct.
  private CreateDeviceRegistryRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private CreateDeviceRegistryRequest() {
    parent_ = "";
  }

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

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

  private CreateDeviceRegistryRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              parent_ = s;
              break;
            }
          case 18:
            {
              com.google.cloud.iot.v1.DeviceRegistry.Builder subBuilder = null;
              if (deviceRegistry_ != null) {
                subBuilder = deviceRegistry_.toBuilder();
              }
              deviceRegistry_ =
                  input.readMessage(
                      com.google.cloud.iot.v1.DeviceRegistry.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(deviceRegistry_);
                deviceRegistry_ = subBuilder.buildPartial();
              }

              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_CreateDeviceRegistryRequest_descriptor;
  }

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

  public static final int PARENT_FIELD_NUMBER = 1;
  private volatile java.lang.Object parent_;
  /**
   *
   *
   * <pre>
   * Required. The project and cloud region where this device registry must be created.
   * For example, `projects/example-project/locations/us-central1`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The parent.
   */
  @java.lang.Override
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    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();
      parent_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The project and cloud region where this device registry must be created.
   * For example, `projects/example-project/locations/us-central1`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DEVICE_REGISTRY_FIELD_NUMBER = 2;
  private com.google.cloud.iot.v1.DeviceRegistry deviceRegistry_;
  /**
   *
   *
   * <pre>
   * Required. The device registry. The field `name` must be empty. The server will
   * generate that field from the device registry `id` provided and the
   * `parent` field.
   * </pre>
   *
   * <code>
   * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return Whether the deviceRegistry field is set.
   */
  @java.lang.Override
  public boolean hasDeviceRegistry() {
    return deviceRegistry_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. The device registry. The field `name` must be empty. The server will
   * generate that field from the device registry `id` provided and the
   * `parent` field.
   * </pre>
   *
   * <code>
   * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The deviceRegistry.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceRegistry getDeviceRegistry() {
    return deviceRegistry_ == null
        ? com.google.cloud.iot.v1.DeviceRegistry.getDefaultInstance()
        : deviceRegistry_;
  }
  /**
   *
   *
   * <pre>
   * Required. The device registry. The field `name` must be empty. The server will
   * generate that field from the device registry `id` provided and the
   * `parent` field.
   * </pre>
   *
   * <code>
   * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceRegistryOrBuilder getDeviceRegistryOrBuilder() {
    return getDeviceRegistry();
  }

  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(parent_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    }
    if (deviceRegistry_ != null) {
      output.writeMessage(2, getDeviceRegistry());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    }
    if (deviceRegistry_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDeviceRegistry());
    }
    size += unknownFields.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.CreateDeviceRegistryRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.CreateDeviceRegistryRequest other =
        (com.google.cloud.iot.v1.CreateDeviceRegistryRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (hasDeviceRegistry() != other.hasDeviceRegistry()) return false;
    if (hasDeviceRegistry()) {
      if (!getDeviceRegistry().equals(other.getDeviceRegistry())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) 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) + PARENT_FIELD_NUMBER;
    hash = (53 * hash) + getParent().hashCode();
    if (hasDeviceRegistry()) {
      hash = (37 * hash) + DEVICE_REGISTRY_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceRegistry().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.CreateDeviceRegistryRequest 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.CreateDeviceRegistryRequest 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.CreateDeviceRegistryRequest 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.CreateDeviceRegistryRequest 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>
   * Request for `CreateDeviceRegistry`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.CreateDeviceRegistryRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.CreateDeviceRegistryRequest)
      com.google.cloud.iot.v1.CreateDeviceRegistryRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_CreateDeviceRegistryRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      if (deviceRegistryBuilder_ == null) {
        deviceRegistry_ = null;
      } else {
        deviceRegistry_ = null;
        deviceRegistryBuilder_ = null;
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.CreateDeviceRegistryRequest buildPartial() {
      com.google.cloud.iot.v1.CreateDeviceRegistryRequest result =
          new com.google.cloud.iot.v1.CreateDeviceRegistryRequest(this);
      result.parent_ = parent_;
      if (deviceRegistryBuilder_ == null) {
        result.deviceRegistry_ = deviceRegistry_;
      } else {
        result.deviceRegistry_ = deviceRegistryBuilder_.build();
      }
      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.cloud.iot.v1.CreateDeviceRegistryRequest) {
        return mergeFrom((com.google.cloud.iot.v1.CreateDeviceRegistryRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.CreateDeviceRegistryRequest other) {
      if (other == com.google.cloud.iot.v1.CreateDeviceRegistryRequest.getDefaultInstance())
        return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        onChanged();
      }
      if (other.hasDeviceRegistry()) {
        mergeDeviceRegistry(other.getDeviceRegistry());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.CreateDeviceRegistryRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.CreateDeviceRegistryRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Required. The project and cloud region where this device registry must be created.
     * For example, `projects/example-project/locations/us-central1`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The parent.
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The project and cloud region where this device registry must be created.
     * For example, `projects/example-project/locations/us-central1`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for parent.
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The project and cloud region where this device registry must be created.
     * For example, `projects/example-project/locations/us-central1`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      parent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The project and cloud region where this device registry must be created.
     * For example, `projects/example-project/locations/us-central1`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {

      parent_ = getDefaultInstance().getParent();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The project and cloud region where this device registry must be created.
     * For example, `projects/example-project/locations/us-central1`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private com.google.cloud.iot.v1.DeviceRegistry deviceRegistry_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceRegistry,
            com.google.cloud.iot.v1.DeviceRegistry.Builder,
            com.google.cloud.iot.v1.DeviceRegistryOrBuilder>
        deviceRegistryBuilder_;
    /**
     *
     *
     * <pre>
     * Required. The device registry. The field `name` must be empty. The server will
     * generate that field from the device registry `id` provided and the
     * `parent` field.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the deviceRegistry field is set.
     */
    public boolean hasDeviceRegistry() {
      return deviceRegistryBuilder_ != null || deviceRegistry_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry. The field `name` must be empty. The server will
     * generate that field from the device registry `id` provided and the
     * `parent` field.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The deviceRegistry.
     */
    public com.google.cloud.iot.v1.DeviceRegistry getDeviceRegistry() {
      if (deviceRegistryBuilder_ == null) {
        return deviceRegistry_ == null
            ? com.google.cloud.iot.v1.DeviceRegistry.getDefaultInstance()
            : deviceRegistry_;
      } else {
        return deviceRegistryBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry. The field `name` must be empty. The server will
     * generate that field from the device registry `id` provided and the
     * `parent` field.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setDeviceRegistry(com.google.cloud.iot.v1.DeviceRegistry value) {
      if (deviceRegistryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        deviceRegistry_ = value;
        onChanged();
      } else {
        deviceRegistryBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry. The field `name` must be empty. The server will
     * generate that field from the device registry `id` provided and the
     * `parent` field.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setDeviceRegistry(
        com.google.cloud.iot.v1.DeviceRegistry.Builder builderForValue) {
      if (deviceRegistryBuilder_ == null) {
        deviceRegistry_ = builderForValue.build();
        onChanged();
      } else {
        deviceRegistryBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry. The field `name` must be empty. The server will
     * generate that field from the device registry `id` provided and the
     * `parent` field.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder mergeDeviceRegistry(com.google.cloud.iot.v1.DeviceRegistry value) {
      if (deviceRegistryBuilder_ == null) {
        if (deviceRegistry_ != null) {
          deviceRegistry_ =
              com.google.cloud.iot.v1.DeviceRegistry.newBuilder(deviceRegistry_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          deviceRegistry_ = value;
        }
        onChanged();
      } else {
        deviceRegistryBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry. The field `name` must be empty. The server will
     * generate that field from the device registry `id` provided and the
     * `parent` field.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder clearDeviceRegistry() {
      if (deviceRegistryBuilder_ == null) {
        deviceRegistry_ = null;
        onChanged();
      } else {
        deviceRegistry_ = null;
        deviceRegistryBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry. The field `name` must be empty. The server will
     * generate that field from the device registry `id` provided and the
     * `parent` field.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.iot.v1.DeviceRegistry.Builder getDeviceRegistryBuilder() {

      onChanged();
      return getDeviceRegistryFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry. The field `name` must be empty. The server will
     * generate that field from the device registry `id` provided and the
     * `parent` field.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.iot.v1.DeviceRegistryOrBuilder getDeviceRegistryOrBuilder() {
      if (deviceRegistryBuilder_ != null) {
        return deviceRegistryBuilder_.getMessageOrBuilder();
      } else {
        return deviceRegistry_ == null
            ? com.google.cloud.iot.v1.DeviceRegistry.getDefaultInstance()
            : deviceRegistry_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry. The field `name` must be empty. The server will
     * generate that field from the device registry `id` provided and the
     * `parent` field.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceRegistry,
            com.google.cloud.iot.v1.DeviceRegistry.Builder,
            com.google.cloud.iot.v1.DeviceRegistryOrBuilder>
        getDeviceRegistryFieldBuilder() {
      if (deviceRegistryBuilder_ == null) {
        deviceRegistryBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.iot.v1.DeviceRegistry,
                com.google.cloud.iot.v1.DeviceRegistry.Builder,
                com.google.cloud.iot.v1.DeviceRegistryOrBuilder>(
                getDeviceRegistry(), getParentForChildren(), isClean());
        deviceRegistry_ = null;
      }
      return deviceRegistryBuilder_;
    }

    @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.CreateDeviceRegistryRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<CreateDeviceRegistryRequest> PARSER =
      new com.google.protobuf.AbstractParser<CreateDeviceRegistryRequest>() {
        @java.lang.Override
        public CreateDeviceRegistryRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new CreateDeviceRegistryRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.CreateDeviceRegistryRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class CreateDeviceRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.CreateDeviceRequest)
    CreateDeviceRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use CreateDeviceRequest.newBuilder() to construct.
  private CreateDeviceRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private CreateDeviceRequest() {
    parent_ = "";
  }

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

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

  private CreateDeviceRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              parent_ = s;
              break;
            }
          case 18:
            {
              com.google.cloud.iot.v1.Device.Builder subBuilder = null;
              if (device_ != null) {
                subBuilder = device_.toBuilder();
              }
              device_ =
                  input.readMessage(com.google.cloud.iot.v1.Device.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(device_);
                device_ = subBuilder.buildPartial();
              }

              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_CreateDeviceRequest_descriptor;
  }

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

  public static final int PARENT_FIELD_NUMBER = 1;
  private volatile java.lang.Object parent_;
  /**
   *
   *
   * <pre>
   * Required. The name of the device registry where this device should be created.
   * For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The parent.
   */
  @java.lang.Override
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    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();
      parent_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The name of the device registry where this device should be created.
   * For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DEVICE_FIELD_NUMBER = 2;
  private com.google.cloud.iot.v1.Device device_;
  /**
   *
   *
   * <pre>
   * Required. The device registration details. The field `name` must be empty. The server
   * generates `name` from the device registry `id` and the
   * `parent` field.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return Whether the device field is set.
   */
  @java.lang.Override
  public boolean hasDevice() {
    return device_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. The device registration details. The field `name` must be empty. The server
   * generates `name` from the device registry `id` and the
   * `parent` field.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The device.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.Device getDevice() {
    return device_ == null ? com.google.cloud.iot.v1.Device.getDefaultInstance() : device_;
  }
  /**
   *
   *
   * <pre>
   * Required. The device registration details. The field `name` must be empty. The server
   * generates `name` from the device registry `id` and the
   * `parent` field.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceOrBuilder getDeviceOrBuilder() {
    return getDevice();
  }

  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(parent_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    }
    if (device_ != null) {
      output.writeMessage(2, getDevice());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    }
    if (device_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDevice());
    }
    size += unknownFields.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.CreateDeviceRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.CreateDeviceRequest other =
        (com.google.cloud.iot.v1.CreateDeviceRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (hasDevice() != other.hasDevice()) return false;
    if (hasDevice()) {
      if (!getDevice().equals(other.getDevice())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) 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) + PARENT_FIELD_NUMBER;
    hash = (53 * hash) + getParent().hashCode();
    if (hasDevice()) {
      hash = (37 * hash) + DEVICE_FIELD_NUMBER;
      hash = (53 * hash) + getDevice().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.CreateDeviceRequest 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.CreateDeviceRequest 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.CreateDeviceRequest 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.CreateDeviceRequest 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>
   * Request for `CreateDevice`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.CreateDeviceRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.CreateDeviceRequest)
      com.google.cloud.iot.v1.CreateDeviceRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_CreateDeviceRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      if (deviceBuilder_ == null) {
        device_ = null;
      } else {
        device_ = null;
        deviceBuilder_ = null;
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.CreateDeviceRequest buildPartial() {
      com.google.cloud.iot.v1.CreateDeviceRequest result =
          new com.google.cloud.iot.v1.CreateDeviceRequest(this);
      result.parent_ = parent_;
      if (deviceBuilder_ == null) {
        result.device_ = device_;
      } else {
        result.device_ = deviceBuilder_.build();
      }
      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.cloud.iot.v1.CreateDeviceRequest) {
        return mergeFrom((com.google.cloud.iot.v1.CreateDeviceRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.CreateDeviceRequest other) {
      if (other == com.google.cloud.iot.v1.CreateDeviceRequest.getDefaultInstance()) return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        onChanged();
      }
      if (other.hasDevice()) {
        mergeDevice(other.getDevice());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.CreateDeviceRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.CreateDeviceRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the device registry where this device should be created.
     * For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The parent.
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device registry where this device should be created.
     * For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for parent.
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device registry where this device should be created.
     * For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      parent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device registry where this device should be created.
     * For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {

      parent_ = getDefaultInstance().getParent();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device registry where this device should be created.
     * For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private com.google.cloud.iot.v1.Device device_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.Device,
            com.google.cloud.iot.v1.Device.Builder,
            com.google.cloud.iot.v1.DeviceOrBuilder>
        deviceBuilder_;
    /**
     *
     *
     * <pre>
     * Required. The device registration details. The field `name` must be empty. The server
     * generates `name` from the device registry `id` and the
     * `parent` field.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the device field is set.
     */
    public boolean hasDevice() {
      return deviceBuilder_ != null || device_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registration details. The field `name` must be empty. The server
     * generates `name` from the device registry `id` and the
     * `parent` field.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The device.
     */
    public com.google.cloud.iot.v1.Device getDevice() {
      if (deviceBuilder_ == null) {
        return device_ == null ? com.google.cloud.iot.v1.Device.getDefaultInstance() : device_;
      } else {
        return deviceBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The device registration details. The field `name` must be empty. The server
     * generates `name` from the device registry `id` and the
     * `parent` field.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setDevice(com.google.cloud.iot.v1.Device value) {
      if (deviceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        device_ = value;
        onChanged();
      } else {
        deviceBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registration details. The field `name` must be empty. The server
     * generates `name` from the device registry `id` and the
     * `parent` field.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setDevice(com.google.cloud.iot.v1.Device.Builder builderForValue) {
      if (deviceBuilder_ == null) {
        device_ = builderForValue.build();
        onChanged();
      } else {
        deviceBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registration details. The field `name` must be empty. The server
     * generates `name` from the device registry `id` and the
     * `parent` field.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder mergeDevice(com.google.cloud.iot.v1.Device value) {
      if (deviceBuilder_ == null) {
        if (device_ != null) {
          device_ =
              com.google.cloud.iot.v1.Device.newBuilder(device_).mergeFrom(value).buildPartial();
        } else {
          device_ = value;
        }
        onChanged();
      } else {
        deviceBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registration details. The field `name` must be empty. The server
     * generates `name` from the device registry `id` and the
     * `parent` field.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder clearDevice() {
      if (deviceBuilder_ == null) {
        device_ = null;
        onChanged();
      } else {
        device_ = null;
        deviceBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registration details. The field `name` must be empty. The server
     * generates `name` from the device registry `id` and the
     * `parent` field.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.iot.v1.Device.Builder getDeviceBuilder() {

      onChanged();
      return getDeviceFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. The device registration details. The field `name` must be empty. The server
     * generates `name` from the device registry `id` and the
     * `parent` field.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.iot.v1.DeviceOrBuilder getDeviceOrBuilder() {
      if (deviceBuilder_ != null) {
        return deviceBuilder_.getMessageOrBuilder();
      } else {
        return device_ == null ? com.google.cloud.iot.v1.Device.getDefaultInstance() : device_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The device registration details. The field `name` must be empty. The server
     * generates `name` from the device registry `id` and the
     * `parent` field.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.Device,
            com.google.cloud.iot.v1.Device.Builder,
            com.google.cloud.iot.v1.DeviceOrBuilder>
        getDeviceFieldBuilder() {
      if (deviceBuilder_ == null) {
        deviceBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.iot.v1.Device,
                com.google.cloud.iot.v1.Device.Builder,
                com.google.cloud.iot.v1.DeviceOrBuilder>(
                getDevice(), getParentForChildren(), isClean());
        device_ = null;
      }
      return deviceBuilder_;
    }

    @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.CreateDeviceRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<CreateDeviceRequest> PARSER =
      new com.google.protobuf.AbstractParser<CreateDeviceRequest>() {
        @java.lang.Override
        public CreateDeviceRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new CreateDeviceRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.CreateDeviceRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class DeleteDeviceRegistryRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.DeleteDeviceRegistryRequest)
    DeleteDeviceRegistryRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use DeleteDeviceRegistryRequest.newBuilder() to construct.
  private DeleteDeviceRegistryRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private DeleteDeviceRegistryRequest() {
    name_ = "";
  }

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

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

  private DeleteDeviceRegistryRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_DeleteDeviceRegistryRequest_descriptor;
  }

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

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * Required. The name of the device registry. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 name of the device registry. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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;
    }
  }

  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(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    size += unknownFields.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.DeleteDeviceRegistryRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.DeleteDeviceRegistryRequest other =
        (com.google.cloud.iot.v1.DeleteDeviceRegistryRequest) obj;

    if (!getName().equals(other.getName())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.DeleteDeviceRegistryRequest 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.DeleteDeviceRegistryRequest 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.DeleteDeviceRegistryRequest 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.DeleteDeviceRegistryRequest 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>
   * Request for `DeleteDeviceRegistry`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.DeleteDeviceRegistryRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.DeleteDeviceRegistryRequest)
      com.google.cloud.iot.v1.DeleteDeviceRegistryRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_DeleteDeviceRegistryRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.DeleteDeviceRegistryRequest buildPartial() {
      com.google.cloud.iot.v1.DeleteDeviceRegistryRequest result =
          new com.google.cloud.iot.v1.DeleteDeviceRegistryRequest(this);
      result.name_ = name_;
      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.cloud.iot.v1.DeleteDeviceRegistryRequest) {
        return mergeFrom((com.google.cloud.iot.v1.DeleteDeviceRegistryRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.DeleteDeviceRegistryRequest other) {
      if (other == com.google.cloud.iot.v1.DeleteDeviceRegistryRequest.getDefaultInstance())
        return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.DeleteDeviceRegistryRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.DeleteDeviceRegistryRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the device registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      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.DeleteDeviceRegistryRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<DeleteDeviceRegistryRequest> PARSER =
      new com.google.protobuf.AbstractParser<DeleteDeviceRegistryRequest>() {
        @java.lang.Override
        public DeleteDeviceRegistryRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new DeleteDeviceRegistryRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.DeleteDeviceRegistryRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class DeleteDeviceRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.DeleteDeviceRequest)
    DeleteDeviceRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use DeleteDeviceRequest.newBuilder() to construct.
  private DeleteDeviceRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private DeleteDeviceRequest() {
    name_ = "";
  }

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

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

  private DeleteDeviceRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_DeleteDeviceRequest_descriptor;
  }

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

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * Required. The name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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;
    }
  }

  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(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    size += unknownFields.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.DeleteDeviceRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.DeleteDeviceRequest other =
        (com.google.cloud.iot.v1.DeleteDeviceRequest) obj;

    if (!getName().equals(other.getName())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.DeleteDeviceRequest 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.DeleteDeviceRequest 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.DeleteDeviceRequest 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.DeleteDeviceRequest 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>
   * Request for `DeleteDevice`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.DeleteDeviceRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.DeleteDeviceRequest)
      com.google.cloud.iot.v1.DeleteDeviceRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_DeleteDeviceRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.DeleteDeviceRequest buildPartial() {
      com.google.cloud.iot.v1.DeleteDeviceRequest result =
          new com.google.cloud.iot.v1.DeleteDeviceRequest(this);
      result.name_ = name_;
      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.cloud.iot.v1.DeleteDeviceRequest) {
        return mergeFrom((com.google.cloud.iot.v1.DeleteDeviceRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.DeleteDeviceRequest other) {
      if (other == com.google.cloud.iot.v1.DeleteDeviceRequest.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.DeleteDeviceRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.DeleteDeviceRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      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.DeleteDeviceRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<DeleteDeviceRequest> PARSER =
      new com.google.protobuf.AbstractParser<DeleteDeviceRequest>() {
        @java.lang.Override
        public DeleteDeviceRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new DeleteDeviceRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.DeleteDeviceRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class Device extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.Device)
    DeviceOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Device.newBuilder() to construct.
  private Device(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Device() {
    id_ = "";
    name_ = "";
    credentials_ = java.util.Collections.emptyList();
    logLevel_ = 0;
  }

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

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

  private Device(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              id_ = s;
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          case 24:
            {
              numId_ = input.readUInt64();
              break;
            }
          case 58:
            {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (lastHeartbeatTime_ != null) {
                subBuilder = lastHeartbeatTime_.toBuilder();
              }
              lastHeartbeatTime_ =
                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(lastHeartbeatTime_);
                lastHeartbeatTime_ = subBuilder.buildPartial();
              }

              break;
            }
          case 66:
            {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (lastEventTime_ != null) {
                subBuilder = lastEventTime_.toBuilder();
              }
              lastEventTime_ =
                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(lastEventTime_);
                lastEventTime_ = subBuilder.buildPartial();
              }

              break;
            }
          case 82:
            {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (lastErrorTime_ != null) {
                subBuilder = lastErrorTime_.toBuilder();
              }
              lastErrorTime_ =
                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(lastErrorTime_);
                lastErrorTime_ = subBuilder.buildPartial();
              }

              break;
            }
          case 90:
            {
              com.google.rpc.Status.Builder subBuilder = null;
              if (lastErrorStatus_ != null) {
                subBuilder = lastErrorStatus_.toBuilder();
              }
              lastErrorStatus_ =
                  input.readMessage(com.google.rpc.Status.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(lastErrorStatus_);
                lastErrorStatus_ = subBuilder.buildPartial();
              }

              break;
            }
          case 98:
            {
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                credentials_ = new java.util.ArrayList<com.google.cloud.iot.v1.DeviceCredential>();
                mutable_bitField0_ |= 0x00000001;
              }
              credentials_.add(
                  input.readMessage(
                      com.google.cloud.iot.v1.DeviceCredential.parser(), extensionRegistry));
              break;
            }
          case 106:
            {
              com.google.cloud.iot.v1.DeviceConfig.Builder subBuilder = null;
              if (config_ != null) {
                subBuilder = config_.toBuilder();
              }
              config_ =
                  input.readMessage(
                      com.google.cloud.iot.v1.DeviceConfig.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(config_);
                config_ = subBuilder.buildPartial();
              }

              break;
            }
          case 114:
            {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (lastConfigAckTime_ != null) {
                subBuilder = lastConfigAckTime_.toBuilder();
              }
              lastConfigAckTime_ =
                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(lastConfigAckTime_);
                lastConfigAckTime_ = subBuilder.buildPartial();
              }

              break;
            }
          case 130:
            {
              com.google.cloud.iot.v1.DeviceState.Builder subBuilder = null;
              if (state_ != null) {
                subBuilder = state_.toBuilder();
              }
              state_ =
                  input.readMessage(
                      com.google.cloud.iot.v1.DeviceState.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(state_);
                state_ = subBuilder.buildPartial();
              }

              break;
            }
          case 138:
            {
              if (!((mutable_bitField0_ & 0x00000002) != 0)) {
                metadata_ =
                    com.google.protobuf.MapField.newMapField(
                        MetadataDefaultEntryHolder.defaultEntry);
                mutable_bitField0_ |= 0x00000002;
              }
              com.google.protobuf.MapEntry<java.lang.String, java.lang.String> metadata__ =
                  input.readMessage(
                      MetadataDefaultEntryHolder.defaultEntry.getParserForType(),
                      extensionRegistry);
              metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue());
              break;
            }
          case 146:
            {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (lastConfigSendTime_ != null) {
                subBuilder = lastConfigSendTime_.toBuilder();
              }
              lastConfigSendTime_ =
                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(lastConfigSendTime_);
                lastConfigSendTime_ = subBuilder.buildPartial();
              }

              break;
            }
          case 152:
            {
              blocked_ = input.readBool();
              break;
            }
          case 162:
            {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (lastStateTime_ != null) {
                subBuilder = lastStateTime_.toBuilder();
              }
              lastStateTime_ =
                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(lastStateTime_);
                lastStateTime_ = subBuilder.buildPartial();
              }

              break;
            }
          case 168:
            {
              int rawValue = input.readEnum();

              logLevel_ = rawValue;
              break;
            }
          case 194:
            {
              com.google.cloud.iot.v1.GatewayConfig.Builder subBuilder = null;
              if (gatewayConfig_ != null) {
                subBuilder = gatewayConfig_.toBuilder();
              }
              gatewayConfig_ =
                  input.readMessage(
                      com.google.cloud.iot.v1.GatewayConfig.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(gatewayConfig_);
                gatewayConfig_ = subBuilder.buildPartial();
              }

              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        credentials_ = java.util.Collections.unmodifiableList(credentials_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.ResourcesProto
        .internal_static_google_cloud_iot_v1_Device_descriptor;
  }

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

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

  public static final int ID_FIELD_NUMBER = 1;
  private volatile java.lang.Object id_;
  /**
   *
   *
   * <pre>
   * The user-defined device identifier. The device ID must be unique
   * within a device registry.
   * </pre>
   *
   * <code>string id = 1;</code>
   *
   * @return The id.
   */
  @java.lang.Override
  public java.lang.String getId() {
    java.lang.Object ref = id_;
    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();
      id_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The user-defined device identifier. The device ID must be unique
   * within a device registry.
   * </pre>
   *
   * <code>string id = 1;</code>
   *
   * @return The bytes for id.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getIdBytes() {
    java.lang.Object ref = id_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      id_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int NAME_FIELD_NUMBER = 2;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * The resource path name. For example,
   * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
   * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
   * When `name` is populated as a response from the service, it always ends
   * in the device numeric ID.
   * </pre>
   *
   * <code>string name = 2;</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>
   * The resource path name. For example,
   * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
   * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
   * When `name` is populated as a response from the service, it always ends
   * in the device numeric ID.
   * </pre>
   *
   * <code>string name = 2;</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 NUM_ID_FIELD_NUMBER = 3;
  private long numId_;
  /**
   *
   *
   * <pre>
   * [Output only] A server-defined unique numeric ID for the device. This is a
   * more compact way to identify devices, and it is globally unique.
   * </pre>
   *
   * <code>uint64 num_id = 3;</code>
   *
   * @return The numId.
   */
  @java.lang.Override
  public long getNumId() {
    return numId_;
  }

  public static final int CREDENTIALS_FIELD_NUMBER = 12;
  private java.util.List<com.google.cloud.iot.v1.DeviceCredential> credentials_;
  /**
   *
   *
   * <pre>
   * The credentials used to authenticate this device. To allow credential
   * rotation without interruption, multiple device credentials can be bound to
   * this device. No more than 3 credentials can be bound to a single device at
   * a time. When new credentials are added to a device, they are verified
   * against the registry credentials. For details, see the description of the
   * `DeviceRegistry.credentials` field.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.iot.v1.DeviceCredential> getCredentialsList() {
    return credentials_;
  }
  /**
   *
   *
   * <pre>
   * The credentials used to authenticate this device. To allow credential
   * rotation without interruption, multiple device credentials can be bound to
   * this device. No more than 3 credentials can be bound to a single device at
   * a time. When new credentials are added to a device, they are verified
   * against the registry credentials. For details, see the description of the
   * `DeviceRegistry.credentials` field.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.iot.v1.DeviceCredentialOrBuilder>
      getCredentialsOrBuilderList() {
    return credentials_;
  }
  /**
   *
   *
   * <pre>
   * The credentials used to authenticate this device. To allow credential
   * rotation without interruption, multiple device credentials can be bound to
   * this device. No more than 3 credentials can be bound to a single device at
   * a time. When new credentials are added to a device, they are verified
   * against the registry credentials. For details, see the description of the
   * `DeviceRegistry.credentials` field.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
   */
  @java.lang.Override
  public int getCredentialsCount() {
    return credentials_.size();
  }
  /**
   *
   *
   * <pre>
   * The credentials used to authenticate this device. To allow credential
   * rotation without interruption, multiple device credentials can be bound to
   * this device. No more than 3 credentials can be bound to a single device at
   * a time. When new credentials are added to a device, they are verified
   * against the registry credentials. For details, see the description of the
   * `DeviceRegistry.credentials` field.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceCredential getCredentials(int index) {
    return credentials_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The credentials used to authenticate this device. To allow credential
   * rotation without interruption, multiple device credentials can be bound to
   * this device. No more than 3 credentials can be bound to a single device at
   * a time. When new credentials are added to a device, they are verified
   * against the registry credentials. For details, see the description of the
   * `DeviceRegistry.credentials` field.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceCredentialOrBuilder getCredentialsOrBuilder(int index) {
    return credentials_.get(index);
  }

  public static final int LAST_HEARTBEAT_TIME_FIELD_NUMBER = 7;
  private com.google.protobuf.Timestamp lastHeartbeatTime_;
  /**
   *
   *
   * <pre>
   * [Output only] The last time an MQTT `PINGREQ` was received. This field
   * applies only to devices connecting through MQTT. MQTT clients usually only
   * send `PINGREQ` messages if the connection is idle, and no other messages
   * have been sent. Timestamps are periodically collected and written to
   * storage; they may be stale by a few minutes.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
   *
   * @return Whether the lastHeartbeatTime field is set.
   */
  @java.lang.Override
  public boolean hasLastHeartbeatTime() {
    return lastHeartbeatTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The last time an MQTT `PINGREQ` was received. This field
   * applies only to devices connecting through MQTT. MQTT clients usually only
   * send `PINGREQ` messages if the connection is idle, and no other messages
   * have been sent. Timestamps are periodically collected and written to
   * storage; they may be stale by a few minutes.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
   *
   * @return The lastHeartbeatTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getLastHeartbeatTime() {
    return lastHeartbeatTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : lastHeartbeatTime_;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The last time an MQTT `PINGREQ` was received. This field
   * applies only to devices connecting through MQTT. MQTT clients usually only
   * send `PINGREQ` messages if the connection is idle, and no other messages
   * have been sent. Timestamps are periodically collected and written to
   * storage; they may be stale by a few minutes.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getLastHeartbeatTimeOrBuilder() {
    return getLastHeartbeatTime();
  }

  public static final int LAST_EVENT_TIME_FIELD_NUMBER = 8;
  private com.google.protobuf.Timestamp lastEventTime_;
  /**
   *
   *
   * <pre>
   * [Output only] The last time a telemetry event was received. Timestamps are
   * periodically collected and written to storage; they may be stale by a few
   * minutes.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
   *
   * @return Whether the lastEventTime field is set.
   */
  @java.lang.Override
  public boolean hasLastEventTime() {
    return lastEventTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The last time a telemetry event was received. Timestamps are
   * periodically collected and written to storage; they may be stale by a few
   * minutes.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
   *
   * @return The lastEventTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getLastEventTime() {
    return lastEventTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : lastEventTime_;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The last time a telemetry event was received. Timestamps are
   * periodically collected and written to storage; they may be stale by a few
   * minutes.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getLastEventTimeOrBuilder() {
    return getLastEventTime();
  }

  public static final int LAST_STATE_TIME_FIELD_NUMBER = 20;
  private com.google.protobuf.Timestamp lastStateTime_;
  /**
   *
   *
   * <pre>
   * [Output only] The last time a state event was received. Timestamps are
   * periodically collected and written to storage; they may be stale by a few
   * minutes.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
   *
   * @return Whether the lastStateTime field is set.
   */
  @java.lang.Override
  public boolean hasLastStateTime() {
    return lastStateTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The last time a state event was received. Timestamps are
   * periodically collected and written to storage; they may be stale by a few
   * minutes.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
   *
   * @return The lastStateTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getLastStateTime() {
    return lastStateTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : lastStateTime_;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The last time a state event was received. Timestamps are
   * periodically collected and written to storage; they may be stale by a few
   * minutes.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getLastStateTimeOrBuilder() {
    return getLastStateTime();
  }

  public static final int LAST_CONFIG_ACK_TIME_FIELD_NUMBER = 14;
  private com.google.protobuf.Timestamp lastConfigAckTime_;
  /**
   *
   *
   * <pre>
   * [Output only] The last time a cloud-to-device config version acknowledgment
   * was received from the device. This field is only for configurations
   * sent through MQTT.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
   *
   * @return Whether the lastConfigAckTime field is set.
   */
  @java.lang.Override
  public boolean hasLastConfigAckTime() {
    return lastConfigAckTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The last time a cloud-to-device config version acknowledgment
   * was received from the device. This field is only for configurations
   * sent through MQTT.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
   *
   * @return The lastConfigAckTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getLastConfigAckTime() {
    return lastConfigAckTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : lastConfigAckTime_;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The last time a cloud-to-device config version acknowledgment
   * was received from the device. This field is only for configurations
   * sent through MQTT.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getLastConfigAckTimeOrBuilder() {
    return getLastConfigAckTime();
  }

  public static final int LAST_CONFIG_SEND_TIME_FIELD_NUMBER = 18;
  private com.google.protobuf.Timestamp lastConfigSendTime_;
  /**
   *
   *
   * <pre>
   * [Output only] The last time a cloud-to-device config version was sent to
   * the device.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
   *
   * @return Whether the lastConfigSendTime field is set.
   */
  @java.lang.Override
  public boolean hasLastConfigSendTime() {
    return lastConfigSendTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The last time a cloud-to-device config version was sent to
   * the device.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
   *
   * @return The lastConfigSendTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getLastConfigSendTime() {
    return lastConfigSendTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : lastConfigSendTime_;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The last time a cloud-to-device config version was sent to
   * the device.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getLastConfigSendTimeOrBuilder() {
    return getLastConfigSendTime();
  }

  public static final int BLOCKED_FIELD_NUMBER = 19;
  private boolean blocked_;
  /**
   *
   *
   * <pre>
   * If a device is blocked, connections or requests from this device will fail.
   * Can be used to temporarily prevent the device from connecting if, for
   * example, the sensor is generating bad data and needs maintenance.
   * </pre>
   *
   * <code>bool blocked = 19;</code>
   *
   * @return The blocked.
   */
  @java.lang.Override
  public boolean getBlocked() {
    return blocked_;
  }

  public static final int LAST_ERROR_TIME_FIELD_NUMBER = 10;
  private com.google.protobuf.Timestamp lastErrorTime_;
  /**
   *
   *
   * <pre>
   * [Output only] The time the most recent error occurred, such as a failure to
   * publish to Cloud Pub/Sub. This field is the timestamp of
   * 'last_error_status'.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
   *
   * @return Whether the lastErrorTime field is set.
   */
  @java.lang.Override
  public boolean hasLastErrorTime() {
    return lastErrorTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The time the most recent error occurred, such as a failure to
   * publish to Cloud Pub/Sub. This field is the timestamp of
   * 'last_error_status'.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
   *
   * @return The lastErrorTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getLastErrorTime() {
    return lastErrorTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : lastErrorTime_;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The time the most recent error occurred, such as a failure to
   * publish to Cloud Pub/Sub. This field is the timestamp of
   * 'last_error_status'.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getLastErrorTimeOrBuilder() {
    return getLastErrorTime();
  }

  public static final int LAST_ERROR_STATUS_FIELD_NUMBER = 11;
  private com.google.rpc.Status lastErrorStatus_;
  /**
   *
   *
   * <pre>
   * [Output only] The error message of the most recent error, such as a failure
   * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
   * field. If no errors have occurred, this field has an empty message
   * and the status code 0 == OK. Otherwise, this field is expected to have a
   * status code other than OK.
   * </pre>
   *
   * <code>.google.rpc.Status last_error_status = 11;</code>
   *
   * @return Whether the lastErrorStatus field is set.
   */
  @java.lang.Override
  public boolean hasLastErrorStatus() {
    return lastErrorStatus_ != null;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The error message of the most recent error, such as a failure
   * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
   * field. If no errors have occurred, this field has an empty message
   * and the status code 0 == OK. Otherwise, this field is expected to have a
   * status code other than OK.
   * </pre>
   *
   * <code>.google.rpc.Status last_error_status = 11;</code>
   *
   * @return The lastErrorStatus.
   */
  @java.lang.Override
  public com.google.rpc.Status getLastErrorStatus() {
    return lastErrorStatus_ == null ? com.google.rpc.Status.getDefaultInstance() : lastErrorStatus_;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The error message of the most recent error, such as a failure
   * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
   * field. If no errors have occurred, this field has an empty message
   * and the status code 0 == OK. Otherwise, this field is expected to have a
   * status code other than OK.
   * </pre>
   *
   * <code>.google.rpc.Status last_error_status = 11;</code>
   */
  @java.lang.Override
  public com.google.rpc.StatusOrBuilder getLastErrorStatusOrBuilder() {
    return getLastErrorStatus();
  }

  public static final int CONFIG_FIELD_NUMBER = 13;
  private com.google.cloud.iot.v1.DeviceConfig config_;
  /**
   *
   *
   * <pre>
   * The most recent device configuration, which is eventually sent from
   * Cloud IoT Core to the device. If not present on creation, the
   * configuration will be initialized with an empty payload and version value
   * of `1`. To update this field after creation, use the
   * `DeviceManager.ModifyCloudToDeviceConfig` method.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
   *
   * @return Whether the config field is set.
   */
  @java.lang.Override
  public boolean hasConfig() {
    return config_ != null;
  }
  /**
   *
   *
   * <pre>
   * The most recent device configuration, which is eventually sent from
   * Cloud IoT Core to the device. If not present on creation, the
   * configuration will be initialized with an empty payload and version value
   * of `1`. To update this field after creation, use the
   * `DeviceManager.ModifyCloudToDeviceConfig` method.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
   *
   * @return The config.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceConfig getConfig() {
    return config_ == null ? com.google.cloud.iot.v1.DeviceConfig.getDefaultInstance() : config_;
  }
  /**
   *
   *
   * <pre>
   * The most recent device configuration, which is eventually sent from
   * Cloud IoT Core to the device. If not present on creation, the
   * configuration will be initialized with an empty payload and version value
   * of `1`. To update this field after creation, use the
   * `DeviceManager.ModifyCloudToDeviceConfig` method.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceConfigOrBuilder getConfigOrBuilder() {
    return getConfig();
  }

  public static final int STATE_FIELD_NUMBER = 16;
  private com.google.cloud.iot.v1.DeviceState state_;
  /**
   *
   *
   * <pre>
   * [Output only] The state most recently received from the device. If no state
   * has been reported, this field is not present.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
   *
   * @return Whether the state field is set.
   */
  @java.lang.Override
  public boolean hasState() {
    return state_ != null;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The state most recently received from the device. If no state
   * has been reported, this field is not present.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
   *
   * @return The state.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceState getState() {
    return state_ == null ? com.google.cloud.iot.v1.DeviceState.getDefaultInstance() : state_;
  }
  /**
   *
   *
   * <pre>
   * [Output only] The state most recently received from the device. If no state
   * has been reported, this field is not present.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceStateOrBuilder getStateOrBuilder() {
    return getState();
  }

  public static final int LOG_LEVEL_FIELD_NUMBER = 21;
  private int logLevel_;
  /**
   *
   *
   * <pre>
   * **Beta Feature**
   * The logging verbosity for device activity. If unspecified,
   * DeviceRegistry.log_level will be used.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.LogLevel log_level = 21;</code>
   *
   * @return The enum numeric value on the wire for logLevel.
   */
  @java.lang.Override
  public int getLogLevelValue() {
    return logLevel_;
  }
  /**
   *
   *
   * <pre>
   * **Beta Feature**
   * The logging verbosity for device activity. If unspecified,
   * DeviceRegistry.log_level will be used.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.LogLevel log_level = 21;</code>
   *
   * @return The logLevel.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.LogLevel getLogLevel() {
    @SuppressWarnings("deprecation")
    com.google.cloud.iot.v1.LogLevel result = com.google.cloud.iot.v1.LogLevel.valueOf(logLevel_);
    return result == null ? com.google.cloud.iot.v1.LogLevel.UNRECOGNIZED : result;
  }

  public static final int METADATA_FIELD_NUMBER = 17;

  private static final class MetadataDefaultEntryHolder {
    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.cloud.iot.v1.ResourcesProto
                .internal_static_google_cloud_iot_v1_Device_MetadataEntry_descriptor,
            com.google.protobuf.WireFormat.FieldType.STRING,
            "",
            com.google.protobuf.WireFormat.FieldType.STRING,
            "");
  }

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

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMetadata() {
    if (metadata_ == null) {
      return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
    }
    return metadata_;
  }

  public int getMetadataCount() {
    return internalGetMetadata().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * The metadata key-value pairs assigned to the device. This metadata is not
   * interpreted or indexed by Cloud IoT Core. It can be used to add contextual
   * information for the device.
   * Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
   * be less than 128 bytes in length.
   * Values are free-form strings. Each value must be less than or equal to 32
   * KB in size.
   * The total size of all keys and values must be less than 256 KB, and the
   * maximum number of key-value pairs is 500.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 17;</code>
   */
  @java.lang.Override
  public boolean containsMetadata(java.lang.String key) {
    if (key == null) {
      throw new java.lang.NullPointerException();
    }
    return internalGetMetadata().getMap().containsKey(key);
  }
  /** Use {@link #getMetadataMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
    return getMetadataMap();
  }
  /**
   *
   *
   * <pre>
   * The metadata key-value pairs assigned to the device. This metadata is not
   * interpreted or indexed by Cloud IoT Core. It can be used to add contextual
   * information for the device.
   * Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
   * be less than 128 bytes in length.
   * Values are free-form strings. Each value must be less than or equal to 32
   * KB in size.
   * The total size of all keys and values must be less than 256 KB, and the
   * maximum number of key-value pairs is 500.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 17;</code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
    return internalGetMetadata().getMap();
  }
  /**
   *
   *
   * <pre>
   * The metadata key-value pairs assigned to the device. This metadata is not
   * interpreted or indexed by Cloud IoT Core. It can be used to add contextual
   * information for the device.
   * Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
   * be less than 128 bytes in length.
   * Values are free-form strings. Each value must be less than or equal to 32
   * KB in size.
   * The total size of all keys and values must be less than 256 KB, and the
   * maximum number of key-value pairs is 500.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 17;</code>
   */
  @java.lang.Override
  public java.lang.String getMetadataOrDefault(
      java.lang.String key, java.lang.String defaultValue) {
    if (key == null) {
      throw new java.lang.NullPointerException();
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * The metadata key-value pairs assigned to the device. This metadata is not
   * interpreted or indexed by Cloud IoT Core. It can be used to add contextual
   * information for the device.
   * Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
   * be less than 128 bytes in length.
   * Values are free-form strings. Each value must be less than or equal to 32
   * KB in size.
   * The total size of all keys and values must be less than 256 KB, and the
   * maximum number of key-value pairs is 500.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 17;</code>
   */
  @java.lang.Override
  public java.lang.String getMetadataOrThrow(java.lang.String key) {
    if (key == null) {
      throw new java.lang.NullPointerException();
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int GATEWAY_CONFIG_FIELD_NUMBER = 24;
  private com.google.cloud.iot.v1.GatewayConfig gatewayConfig_;
  /**
   *
   *
   * <pre>
   * Gateway-related configuration and state.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
   *
   * @return Whether the gatewayConfig field is set.
   */
  @java.lang.Override
  public boolean hasGatewayConfig() {
    return gatewayConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * Gateway-related configuration and state.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
   *
   * @return The gatewayConfig.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.GatewayConfig getGatewayConfig() {
    return gatewayConfig_ == null
        ? com.google.cloud.iot.v1.GatewayConfig.getDefaultInstance()
        : gatewayConfig_;
  }
  /**
   *
   *
   * <pre>
   * Gateway-related configuration and state.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.GatewayConfigOrBuilder getGatewayConfigOrBuilder() {
    return getGatewayConfig();
  }

  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(id_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_);
    }
    if (numId_ != 0L) {
      output.writeUInt64(3, numId_);
    }
    if (lastHeartbeatTime_ != null) {
      output.writeMessage(7, getLastHeartbeatTime());
    }
    if (lastEventTime_ != null) {
      output.writeMessage(8, getLastEventTime());
    }
    if (lastErrorTime_ != null) {
      output.writeMessage(10, getLastErrorTime());
    }
    if (lastErrorStatus_ != null) {
      output.writeMessage(11, getLastErrorStatus());
    }
    for (int i = 0; i < credentials_.size(); i++) {
      output.writeMessage(12, credentials_.get(i));
    }
    if (config_ != null) {
      output.writeMessage(13, getConfig());
    }
    if (lastConfigAckTime_ != null) {
      output.writeMessage(14, getLastConfigAckTime());
    }
    if (state_ != null) {
      output.writeMessage(16, getState());
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 17);
    if (lastConfigSendTime_ != null) {
      output.writeMessage(18, getLastConfigSendTime());
    }
    if (blocked_ != false) {
      output.writeBool(19, blocked_);
    }
    if (lastStateTime_ != null) {
      output.writeMessage(20, getLastStateTime());
    }
    if (logLevel_ != com.google.cloud.iot.v1.LogLevel.LOG_LEVEL_UNSPECIFIED.getNumber()) {
      output.writeEnum(21, logLevel_);
    }
    if (gatewayConfig_ != null) {
      output.writeMessage(24, getGatewayConfig());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_);
    }
    if (numId_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeUInt64Size(3, numId_);
    }
    if (lastHeartbeatTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getLastHeartbeatTime());
    }
    if (lastEventTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getLastEventTime());
    }
    if (lastErrorTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getLastErrorTime());
    }
    if (lastErrorStatus_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getLastErrorStatus());
    }
    for (int i = 0; i < credentials_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, credentials_.get(i));
    }
    if (config_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getConfig());
    }
    if (lastConfigAckTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getLastConfigAckTime());
    }
    if (state_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getState());
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetMetadata().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String> metadata__ =
          MetadataDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, metadata__);
    }
    if (lastConfigSendTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getLastConfigSendTime());
    }
    if (blocked_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(19, blocked_);
    }
    if (lastStateTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getLastStateTime());
    }
    if (logLevel_ != com.google.cloud.iot.v1.LogLevel.LOG_LEVEL_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(21, logLevel_);
    }
    if (gatewayConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getGatewayConfig());
    }
    size += unknownFields.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.Device)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.Device other = (com.google.cloud.iot.v1.Device) obj;

    if (!getId().equals(other.getId())) return false;
    if (!getName().equals(other.getName())) return false;
    if (getNumId() != other.getNumId()) return false;
    if (!getCredentialsList().equals(other.getCredentialsList())) return false;
    if (hasLastHeartbeatTime() != other.hasLastHeartbeatTime()) return false;
    if (hasLastHeartbeatTime()) {
      if (!getLastHeartbeatTime().equals(other.getLastHeartbeatTime())) return false;
    }
    if (hasLastEventTime() != other.hasLastEventTime()) return false;
    if (hasLastEventTime()) {
      if (!getLastEventTime().equals(other.getLastEventTime())) return false;
    }
    if (hasLastStateTime() != other.hasLastStateTime()) return false;
    if (hasLastStateTime()) {
      if (!getLastStateTime().equals(other.getLastStateTime())) return false;
    }
    if (hasLastConfigAckTime() != other.hasLastConfigAckTime()) return false;
    if (hasLastConfigAckTime()) {
      if (!getLastConfigAckTime().equals(other.getLastConfigAckTime())) return false;
    }
    if (hasLastConfigSendTime() != other.hasLastConfigSendTime()) return false;
    if (hasLastConfigSendTime()) {
      if (!getLastConfigSendTime().equals(other.getLastConfigSendTime())) return false;
    }
    if (getBlocked() != other.getBlocked()) return false;
    if (hasLastErrorTime() != other.hasLastErrorTime()) return false;
    if (hasLastErrorTime()) {
      if (!getLastErrorTime().equals(other.getLastErrorTime())) return false;
    }
    if (hasLastErrorStatus() != other.hasLastErrorStatus()) return false;
    if (hasLastErrorStatus()) {
      if (!getLastErrorStatus().equals(other.getLastErrorStatus())) return false;
    }
    if (hasConfig() != other.hasConfig()) return false;
    if (hasConfig()) {
      if (!getConfig().equals(other.getConfig())) return false;
    }
    if (hasState() != other.hasState()) return false;
    if (hasState()) {
      if (!getState().equals(other.getState())) return false;
    }
    if (logLevel_ != other.logLevel_) return false;
    if (!internalGetMetadata().equals(other.internalGetMetadata())) return false;
    if (hasGatewayConfig() != other.hasGatewayConfig()) return false;
    if (hasGatewayConfig()) {
      if (!getGatewayConfig().equals(other.getGatewayConfig())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) 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) + ID_FIELD_NUMBER;
    hash = (53 * hash) + getId().hashCode();
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + NUM_ID_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getNumId());
    if (getCredentialsCount() > 0) {
      hash = (37 * hash) + CREDENTIALS_FIELD_NUMBER;
      hash = (53 * hash) + getCredentialsList().hashCode();
    }
    if (hasLastHeartbeatTime()) {
      hash = (37 * hash) + LAST_HEARTBEAT_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getLastHeartbeatTime().hashCode();
    }
    if (hasLastEventTime()) {
      hash = (37 * hash) + LAST_EVENT_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getLastEventTime().hashCode();
    }
    if (hasLastStateTime()) {
      hash = (37 * hash) + LAST_STATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getLastStateTime().hashCode();
    }
    if (hasLastConfigAckTime()) {
      hash = (37 * hash) + LAST_CONFIG_ACK_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getLastConfigAckTime().hashCode();
    }
    if (hasLastConfigSendTime()) {
      hash = (37 * hash) + LAST_CONFIG_SEND_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getLastConfigSendTime().hashCode();
    }
    hash = (37 * hash) + BLOCKED_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBlocked());
    if (hasLastErrorTime()) {
      hash = (37 * hash) + LAST_ERROR_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getLastErrorTime().hashCode();
    }
    if (hasLastErrorStatus()) {
      hash = (37 * hash) + LAST_ERROR_STATUS_FIELD_NUMBER;
      hash = (53 * hash) + getLastErrorStatus().hashCode();
    }
    if (hasConfig()) {
      hash = (37 * hash) + CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getConfig().hashCode();
    }
    if (hasState()) {
      hash = (37 * hash) + STATE_FIELD_NUMBER;
      hash = (53 * hash) + getState().hashCode();
    }
    hash = (37 * hash) + LOG_LEVEL_FIELD_NUMBER;
    hash = (53 * hash) + logLevel_;
    if (!internalGetMetadata().getMap().isEmpty()) {
      hash = (37 * hash) + METADATA_FIELD_NUMBER;
      hash = (53 * hash) + internalGetMetadata().hashCode();
    }
    if (hasGatewayConfig()) {
      hash = (37 * hash) + GATEWAY_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getGatewayConfig().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.Device 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.Device 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.Device 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.Device 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 resource.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.Device}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.Device)
      com.google.cloud.iot.v1.DeviceOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.ResourcesProto
          .internal_static_google_cloud_iot_v1_Device_descriptor;
    }

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

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

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
        getCredentialsFieldBuilder();
      }
    }

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

      name_ = "";

      numId_ = 0L;

      if (credentialsBuilder_ == null) {
        credentials_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        credentialsBuilder_.clear();
      }
      if (lastHeartbeatTimeBuilder_ == null) {
        lastHeartbeatTime_ = null;
      } else {
        lastHeartbeatTime_ = null;
        lastHeartbeatTimeBuilder_ = null;
      }
      if (lastEventTimeBuilder_ == null) {
        lastEventTime_ = null;
      } else {
        lastEventTime_ = null;
        lastEventTimeBuilder_ = null;
      }
      if (lastStateTimeBuilder_ == null) {
        lastStateTime_ = null;
      } else {
        lastStateTime_ = null;
        lastStateTimeBuilder_ = null;
      }
      if (lastConfigAckTimeBuilder_ == null) {
        lastConfigAckTime_ = null;
      } else {
        lastConfigAckTime_ = null;
        lastConfigAckTimeBuilder_ = null;
      }
      if (lastConfigSendTimeBuilder_ == null) {
        lastConfigSendTime_ = null;
      } else {
        lastConfigSendTime_ = null;
        lastConfigSendTimeBuilder_ = null;
      }
      blocked_ = false;

      if (lastErrorTimeBuilder_ == null) {
        lastErrorTime_ = null;
      } else {
        lastErrorTime_ = null;
        lastErrorTimeBuilder_ = null;
      }
      if (lastErrorStatusBuilder_ == null) {
        lastErrorStatus_ = null;
      } else {
        lastErrorStatus_ = null;
        lastErrorStatusBuilder_ = null;
      }
      if (configBuilder_ == null) {
        config_ = null;
      } else {
        config_ = null;
        configBuilder_ = null;
      }
      if (stateBuilder_ == null) {
        state_ = null;
      } else {
        state_ = null;
        stateBuilder_ = null;
      }
      logLevel_ = 0;

      internalGetMutableMetadata().clear();
      if (gatewayConfigBuilder_ == null) {
        gatewayConfig_ = null;
      } else {
        gatewayConfig_ = null;
        gatewayConfigBuilder_ = null;
      }
      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_Device_descriptor;
    }

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.Device buildPartial() {
      com.google.cloud.iot.v1.Device result = new com.google.cloud.iot.v1.Device(this);
      int from_bitField0_ = bitField0_;
      result.id_ = id_;
      result.name_ = name_;
      result.numId_ = numId_;
      if (credentialsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          credentials_ = java.util.Collections.unmodifiableList(credentials_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.credentials_ = credentials_;
      } else {
        result.credentials_ = credentialsBuilder_.build();
      }
      if (lastHeartbeatTimeBuilder_ == null) {
        result.lastHeartbeatTime_ = lastHeartbeatTime_;
      } else {
        result.lastHeartbeatTime_ = lastHeartbeatTimeBuilder_.build();
      }
      if (lastEventTimeBuilder_ == null) {
        result.lastEventTime_ = lastEventTime_;
      } else {
        result.lastEventTime_ = lastEventTimeBuilder_.build();
      }
      if (lastStateTimeBuilder_ == null) {
        result.lastStateTime_ = lastStateTime_;
      } else {
        result.lastStateTime_ = lastStateTimeBuilder_.build();
      }
      if (lastConfigAckTimeBuilder_ == null) {
        result.lastConfigAckTime_ = lastConfigAckTime_;
      } else {
        result.lastConfigAckTime_ = lastConfigAckTimeBuilder_.build();
      }
      if (lastConfigSendTimeBuilder_ == null) {
        result.lastConfigSendTime_ = lastConfigSendTime_;
      } else {
        result.lastConfigSendTime_ = lastConfigSendTimeBuilder_.build();
      }
      result.blocked_ = blocked_;
      if (lastErrorTimeBuilder_ == null) {
        result.lastErrorTime_ = lastErrorTime_;
      } else {
        result.lastErrorTime_ = lastErrorTimeBuilder_.build();
      }
      if (lastErrorStatusBuilder_ == null) {
        result.lastErrorStatus_ = lastErrorStatus_;
      } else {
        result.lastErrorStatus_ = lastErrorStatusBuilder_.build();
      }
      if (configBuilder_ == null) {
        result.config_ = config_;
      } else {
        result.config_ = configBuilder_.build();
      }
      if (stateBuilder_ == null) {
        result.state_ = state_;
      } else {
        result.state_ = stateBuilder_.build();
      }
      result.logLevel_ = logLevel_;
      result.metadata_ = internalGetMetadata();
      result.metadata_.makeImmutable();
      if (gatewayConfigBuilder_ == null) {
        result.gatewayConfig_ = gatewayConfig_;
      } else {
        result.gatewayConfig_ = gatewayConfigBuilder_.build();
      }
      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.cloud.iot.v1.Device) {
        return mergeFrom((com.google.cloud.iot.v1.Device) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.Device other) {
      if (other == com.google.cloud.iot.v1.Device.getDefaultInstance()) return this;
      if (!other.getId().isEmpty()) {
        id_ = other.id_;
        onChanged();
      }
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.getNumId() != 0L) {
        setNumId(other.getNumId());
      }
      if (credentialsBuilder_ == null) {
        if (!other.credentials_.isEmpty()) {
          if (credentials_.isEmpty()) {
            credentials_ = other.credentials_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureCredentialsIsMutable();
            credentials_.addAll(other.credentials_);
          }
          onChanged();
        }
      } else {
        if (!other.credentials_.isEmpty()) {
          if (credentialsBuilder_.isEmpty()) {
            credentialsBuilder_.dispose();
            credentialsBuilder_ = null;
            credentials_ = other.credentials_;
            bitField0_ = (bitField0_ & ~0x00000001);
            credentialsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getCredentialsFieldBuilder()
                    : null;
          } else {
            credentialsBuilder_.addAllMessages(other.credentials_);
          }
        }
      }
      if (other.hasLastHeartbeatTime()) {
        mergeLastHeartbeatTime(other.getLastHeartbeatTime());
      }
      if (other.hasLastEventTime()) {
        mergeLastEventTime(other.getLastEventTime());
      }
      if (other.hasLastStateTime()) {
        mergeLastStateTime(other.getLastStateTime());
      }
      if (other.hasLastConfigAckTime()) {
        mergeLastConfigAckTime(other.getLastConfigAckTime());
      }
      if (other.hasLastConfigSendTime()) {
        mergeLastConfigSendTime(other.getLastConfigSendTime());
      }
      if (other.getBlocked() != false) {
        setBlocked(other.getBlocked());
      }
      if (other.hasLastErrorTime()) {
        mergeLastErrorTime(other.getLastErrorTime());
      }
      if (other.hasLastErrorStatus()) {
        mergeLastErrorStatus(other.getLastErrorStatus());
      }
      if (other.hasConfig()) {
        mergeConfig(other.getConfig());
      }
      if (other.hasState()) {
        mergeState(other.getState());
      }
      if (other.logLevel_ != 0) {
        setLogLevelValue(other.getLogLevelValue());
      }
      internalGetMutableMetadata().mergeFrom(other.internalGetMetadata());
      if (other.hasGatewayConfig()) {
        mergeGatewayConfig(other.getGatewayConfig());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.Device parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.Device) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.lang.Object id_ = "";
    /**
     *
     *
     * <pre>
     * The user-defined device identifier. The device ID must be unique
     * within a device registry.
     * </pre>
     *
     * <code>string id = 1;</code>
     *
     * @return The id.
     */
    public java.lang.String getId() {
      java.lang.Object ref = id_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        id_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The user-defined device identifier. The device ID must be unique
     * within a device registry.
     * </pre>
     *
     * <code>string id = 1;</code>
     *
     * @return The bytes for id.
     */
    public com.google.protobuf.ByteString getIdBytes() {
      java.lang.Object ref = id_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        id_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The user-defined device identifier. The device ID must be unique
     * within a device registry.
     * </pre>
     *
     * <code>string id = 1;</code>
     *
     * @param value The id to set.
     * @return This builder for chaining.
     */
    public Builder setId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      id_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The user-defined device identifier. The device ID must be unique
     * within a device registry.
     * </pre>
     *
     * <code>string id = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearId() {

      id_ = getDefaultInstance().getId();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The user-defined device identifier. The device ID must be unique
     * within a device registry.
     * </pre>
     *
     * <code>string id = 1;</code>
     *
     * @param value The bytes for id to set.
     * @return This builder for chaining.
     */
    public Builder setIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * The resource path name. For example,
     * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
     * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
     * When `name` is populated as a response from the service, it always ends
     * in the device numeric ID.
     * </pre>
     *
     * <code>string name = 2;</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>
     * The resource path name. For example,
     * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
     * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
     * When `name` is populated as a response from the service, it always ends
     * in the device numeric ID.
     * </pre>
     *
     * <code>string name = 2;</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>
     * The resource path name. For example,
     * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
     * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
     * When `name` is populated as a response from the service, it always ends
     * in the device numeric ID.
     * </pre>
     *
     * <code>string name = 2;</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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource path name. For example,
     * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
     * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
     * When `name` is populated as a response from the service, it always ends
     * in the device numeric ID.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource path name. For example,
     * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
     * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
     * When `name` is populated as a response from the service, it always ends
     * in the device numeric ID.
     * </pre>
     *
     * <code>string name = 2;</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;
      onChanged();
      return this;
    }

    private long numId_;
    /**
     *
     *
     * <pre>
     * [Output only] A server-defined unique numeric ID for the device. This is a
     * more compact way to identify devices, and it is globally unique.
     * </pre>
     *
     * <code>uint64 num_id = 3;</code>
     *
     * @return The numId.
     */
    @java.lang.Override
    public long getNumId() {
      return numId_;
    }
    /**
     *
     *
     * <pre>
     * [Output only] A server-defined unique numeric ID for the device. This is a
     * more compact way to identify devices, and it is globally unique.
     * </pre>
     *
     * <code>uint64 num_id = 3;</code>
     *
     * @param value The numId to set.
     * @return This builder for chaining.
     */
    public Builder setNumId(long value) {

      numId_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] A server-defined unique numeric ID for the device. This is a
     * more compact way to identify devices, and it is globally unique.
     * </pre>
     *
     * <code>uint64 num_id = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearNumId() {

      numId_ = 0L;
      onChanged();
      return this;
    }

    private java.util.List<com.google.cloud.iot.v1.DeviceCredential> credentials_ =
        java.util.Collections.emptyList();

    private void ensureCredentialsIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        credentials_ =
            new java.util.ArrayList<com.google.cloud.iot.v1.DeviceCredential>(credentials_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceCredential,
            com.google.cloud.iot.v1.DeviceCredential.Builder,
            com.google.cloud.iot.v1.DeviceCredentialOrBuilder>
        credentialsBuilder_;

    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.DeviceCredential> getCredentialsList() {
      if (credentialsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(credentials_);
      } else {
        return credentialsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public int getCredentialsCount() {
      if (credentialsBuilder_ == null) {
        return credentials_.size();
      } else {
        return credentialsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public com.google.cloud.iot.v1.DeviceCredential getCredentials(int index) {
      if (credentialsBuilder_ == null) {
        return credentials_.get(index);
      } else {
        return credentialsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public Builder setCredentials(int index, com.google.cloud.iot.v1.DeviceCredential value) {
      if (credentialsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCredentialsIsMutable();
        credentials_.set(index, value);
        onChanged();
      } else {
        credentialsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public Builder setCredentials(
        int index, com.google.cloud.iot.v1.DeviceCredential.Builder builderForValue) {
      if (credentialsBuilder_ == null) {
        ensureCredentialsIsMutable();
        credentials_.set(index, builderForValue.build());
        onChanged();
      } else {
        credentialsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public Builder addCredentials(com.google.cloud.iot.v1.DeviceCredential value) {
      if (credentialsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCredentialsIsMutable();
        credentials_.add(value);
        onChanged();
      } else {
        credentialsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public Builder addCredentials(int index, com.google.cloud.iot.v1.DeviceCredential value) {
      if (credentialsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCredentialsIsMutable();
        credentials_.add(index, value);
        onChanged();
      } else {
        credentialsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public Builder addCredentials(
        com.google.cloud.iot.v1.DeviceCredential.Builder builderForValue) {
      if (credentialsBuilder_ == null) {
        ensureCredentialsIsMutable();
        credentials_.add(builderForValue.build());
        onChanged();
      } else {
        credentialsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public Builder addCredentials(
        int index, com.google.cloud.iot.v1.DeviceCredential.Builder builderForValue) {
      if (credentialsBuilder_ == null) {
        ensureCredentialsIsMutable();
        credentials_.add(index, builderForValue.build());
        onChanged();
      } else {
        credentialsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public Builder addAllCredentials(
        java.lang.Iterable<? extends com.google.cloud.iot.v1.DeviceCredential> values) {
      if (credentialsBuilder_ == null) {
        ensureCredentialsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, credentials_);
        onChanged();
      } else {
        credentialsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public Builder clearCredentials() {
      if (credentialsBuilder_ == null) {
        credentials_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        credentialsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public Builder removeCredentials(int index) {
      if (credentialsBuilder_ == null) {
        ensureCredentialsIsMutable();
        credentials_.remove(index);
        onChanged();
      } else {
        credentialsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public com.google.cloud.iot.v1.DeviceCredential.Builder getCredentialsBuilder(int index) {
      return getCredentialsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public com.google.cloud.iot.v1.DeviceCredentialOrBuilder getCredentialsOrBuilder(int index) {
      if (credentialsBuilder_ == null) {
        return credentials_.get(index);
      } else {
        return credentialsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public java.util.List<? extends com.google.cloud.iot.v1.DeviceCredentialOrBuilder>
        getCredentialsOrBuilderList() {
      if (credentialsBuilder_ != null) {
        return credentialsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(credentials_);
      }
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public com.google.cloud.iot.v1.DeviceCredential.Builder addCredentialsBuilder() {
      return getCredentialsFieldBuilder()
          .addBuilder(com.google.cloud.iot.v1.DeviceCredential.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public com.google.cloud.iot.v1.DeviceCredential.Builder addCredentialsBuilder(int index) {
      return getCredentialsFieldBuilder()
          .addBuilder(index, com.google.cloud.iot.v1.DeviceCredential.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The credentials used to authenticate this device. To allow credential
     * rotation without interruption, multiple device credentials can be bound to
     * this device. No more than 3 credentials can be bound to a single device at
     * a time. When new credentials are added to a device, they are verified
     * against the registry credentials. For details, see the description of the
     * `DeviceRegistry.credentials` field.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.DeviceCredential.Builder>
        getCredentialsBuilderList() {
      return getCredentialsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceCredential,
            com.google.cloud.iot.v1.DeviceCredential.Builder,
            com.google.cloud.iot.v1.DeviceCredentialOrBuilder>
        getCredentialsFieldBuilder() {
      if (credentialsBuilder_ == null) {
        credentialsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.iot.v1.DeviceCredential,
                com.google.cloud.iot.v1.DeviceCredential.Builder,
                com.google.cloud.iot.v1.DeviceCredentialOrBuilder>(
                credentials_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
        credentials_ = null;
      }
      return credentialsBuilder_;
    }

    private com.google.protobuf.Timestamp lastHeartbeatTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        lastHeartbeatTimeBuilder_;
    /**
     *
     *
     * <pre>
     * [Output only] The last time an MQTT `PINGREQ` was received. This field
     * applies only to devices connecting through MQTT. MQTT clients usually only
     * send `PINGREQ` messages if the connection is idle, and no other messages
     * have been sent. Timestamps are periodically collected and written to
     * storage; they may be stale by a few minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
     *
     * @return Whether the lastHeartbeatTime field is set.
     */
    public boolean hasLastHeartbeatTime() {
      return lastHeartbeatTimeBuilder_ != null || lastHeartbeatTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time an MQTT `PINGREQ` was received. This field
     * applies only to devices connecting through MQTT. MQTT clients usually only
     * send `PINGREQ` messages if the connection is idle, and no other messages
     * have been sent. Timestamps are periodically collected and written to
     * storage; they may be stale by a few minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
     *
     * @return The lastHeartbeatTime.
     */
    public com.google.protobuf.Timestamp getLastHeartbeatTime() {
      if (lastHeartbeatTimeBuilder_ == null) {
        return lastHeartbeatTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastHeartbeatTime_;
      } else {
        return lastHeartbeatTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time an MQTT `PINGREQ` was received. This field
     * applies only to devices connecting through MQTT. MQTT clients usually only
     * send `PINGREQ` messages if the connection is idle, and no other messages
     * have been sent. Timestamps are periodically collected and written to
     * storage; they may be stale by a few minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
     */
    public Builder setLastHeartbeatTime(com.google.protobuf.Timestamp value) {
      if (lastHeartbeatTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        lastHeartbeatTime_ = value;
        onChanged();
      } else {
        lastHeartbeatTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time an MQTT `PINGREQ` was received. This field
     * applies only to devices connecting through MQTT. MQTT clients usually only
     * send `PINGREQ` messages if the connection is idle, and no other messages
     * have been sent. Timestamps are periodically collected and written to
     * storage; they may be stale by a few minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
     */
    public Builder setLastHeartbeatTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (lastHeartbeatTimeBuilder_ == null) {
        lastHeartbeatTime_ = builderForValue.build();
        onChanged();
      } else {
        lastHeartbeatTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time an MQTT `PINGREQ` was received. This field
     * applies only to devices connecting through MQTT. MQTT clients usually only
     * send `PINGREQ` messages if the connection is idle, and no other messages
     * have been sent. Timestamps are periodically collected and written to
     * storage; they may be stale by a few minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
     */
    public Builder mergeLastHeartbeatTime(com.google.protobuf.Timestamp value) {
      if (lastHeartbeatTimeBuilder_ == null) {
        if (lastHeartbeatTime_ != null) {
          lastHeartbeatTime_ =
              com.google.protobuf.Timestamp.newBuilder(lastHeartbeatTime_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          lastHeartbeatTime_ = value;
        }
        onChanged();
      } else {
        lastHeartbeatTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time an MQTT `PINGREQ` was received. This field
     * applies only to devices connecting through MQTT. MQTT clients usually only
     * send `PINGREQ` messages if the connection is idle, and no other messages
     * have been sent. Timestamps are periodically collected and written to
     * storage; they may be stale by a few minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
     */
    public Builder clearLastHeartbeatTime() {
      if (lastHeartbeatTimeBuilder_ == null) {
        lastHeartbeatTime_ = null;
        onChanged();
      } else {
        lastHeartbeatTime_ = null;
        lastHeartbeatTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time an MQTT `PINGREQ` was received. This field
     * applies only to devices connecting through MQTT. MQTT clients usually only
     * send `PINGREQ` messages if the connection is idle, and no other messages
     * have been sent. Timestamps are periodically collected and written to
     * storage; they may be stale by a few minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
     */
    public com.google.protobuf.Timestamp.Builder getLastHeartbeatTimeBuilder() {

      onChanged();
      return getLastHeartbeatTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time an MQTT `PINGREQ` was received. This field
     * applies only to devices connecting through MQTT. MQTT clients usually only
     * send `PINGREQ` messages if the connection is idle, and no other messages
     * have been sent. Timestamps are periodically collected and written to
     * storage; they may be stale by a few minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getLastHeartbeatTimeOrBuilder() {
      if (lastHeartbeatTimeBuilder_ != null) {
        return lastHeartbeatTimeBuilder_.getMessageOrBuilder();
      } else {
        return lastHeartbeatTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastHeartbeatTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time an MQTT `PINGREQ` was received. This field
     * applies only to devices connecting through MQTT. MQTT clients usually only
     * send `PINGREQ` messages if the connection is idle, and no other messages
     * have been sent. Timestamps are periodically collected and written to
     * storage; they may be stale by a few minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_heartbeat_time = 7;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getLastHeartbeatTimeFieldBuilder() {
      if (lastHeartbeatTimeBuilder_ == null) {
        lastHeartbeatTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getLastHeartbeatTime(), getParentForChildren(), isClean());
        lastHeartbeatTime_ = null;
      }
      return lastHeartbeatTimeBuilder_;
    }

    private com.google.protobuf.Timestamp lastEventTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        lastEventTimeBuilder_;
    /**
     *
     *
     * <pre>
     * [Output only] The last time a telemetry event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
     *
     * @return Whether the lastEventTime field is set.
     */
    public boolean hasLastEventTime() {
      return lastEventTimeBuilder_ != null || lastEventTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a telemetry event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
     *
     * @return The lastEventTime.
     */
    public com.google.protobuf.Timestamp getLastEventTime() {
      if (lastEventTimeBuilder_ == null) {
        return lastEventTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastEventTime_;
      } else {
        return lastEventTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a telemetry event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
     */
    public Builder setLastEventTime(com.google.protobuf.Timestamp value) {
      if (lastEventTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        lastEventTime_ = value;
        onChanged();
      } else {
        lastEventTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a telemetry event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
     */
    public Builder setLastEventTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (lastEventTimeBuilder_ == null) {
        lastEventTime_ = builderForValue.build();
        onChanged();
      } else {
        lastEventTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a telemetry event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
     */
    public Builder mergeLastEventTime(com.google.protobuf.Timestamp value) {
      if (lastEventTimeBuilder_ == null) {
        if (lastEventTime_ != null) {
          lastEventTime_ =
              com.google.protobuf.Timestamp.newBuilder(lastEventTime_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          lastEventTime_ = value;
        }
        onChanged();
      } else {
        lastEventTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a telemetry event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
     */
    public Builder clearLastEventTime() {
      if (lastEventTimeBuilder_ == null) {
        lastEventTime_ = null;
        onChanged();
      } else {
        lastEventTime_ = null;
        lastEventTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a telemetry event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
     */
    public com.google.protobuf.Timestamp.Builder getLastEventTimeBuilder() {

      onChanged();
      return getLastEventTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a telemetry event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getLastEventTimeOrBuilder() {
      if (lastEventTimeBuilder_ != null) {
        return lastEventTimeBuilder_.getMessageOrBuilder();
      } else {
        return lastEventTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastEventTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a telemetry event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_event_time = 8;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getLastEventTimeFieldBuilder() {
      if (lastEventTimeBuilder_ == null) {
        lastEventTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getLastEventTime(), getParentForChildren(), isClean());
        lastEventTime_ = null;
      }
      return lastEventTimeBuilder_;
    }

    private com.google.protobuf.Timestamp lastStateTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        lastStateTimeBuilder_;
    /**
     *
     *
     * <pre>
     * [Output only] The last time a state event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
     *
     * @return Whether the lastStateTime field is set.
     */
    public boolean hasLastStateTime() {
      return lastStateTimeBuilder_ != null || lastStateTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a state event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
     *
     * @return The lastStateTime.
     */
    public com.google.protobuf.Timestamp getLastStateTime() {
      if (lastStateTimeBuilder_ == null) {
        return lastStateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastStateTime_;
      } else {
        return lastStateTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a state event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
     */
    public Builder setLastStateTime(com.google.protobuf.Timestamp value) {
      if (lastStateTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        lastStateTime_ = value;
        onChanged();
      } else {
        lastStateTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a state event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
     */
    public Builder setLastStateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (lastStateTimeBuilder_ == null) {
        lastStateTime_ = builderForValue.build();
        onChanged();
      } else {
        lastStateTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a state event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
     */
    public Builder mergeLastStateTime(com.google.protobuf.Timestamp value) {
      if (lastStateTimeBuilder_ == null) {
        if (lastStateTime_ != null) {
          lastStateTime_ =
              com.google.protobuf.Timestamp.newBuilder(lastStateTime_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          lastStateTime_ = value;
        }
        onChanged();
      } else {
        lastStateTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a state event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
     */
    public Builder clearLastStateTime() {
      if (lastStateTimeBuilder_ == null) {
        lastStateTime_ = null;
        onChanged();
      } else {
        lastStateTime_ = null;
        lastStateTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a state event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
     */
    public com.google.protobuf.Timestamp.Builder getLastStateTimeBuilder() {

      onChanged();
      return getLastStateTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a state event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getLastStateTimeOrBuilder() {
      if (lastStateTimeBuilder_ != null) {
        return lastStateTimeBuilder_.getMessageOrBuilder();
      } else {
        return lastStateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastStateTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a state event was received. Timestamps are
     * periodically collected and written to storage; they may be stale by a few
     * minutes.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_state_time = 20;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getLastStateTimeFieldBuilder() {
      if (lastStateTimeBuilder_ == null) {
        lastStateTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getLastStateTime(), getParentForChildren(), isClean());
        lastStateTime_ = null;
      }
      return lastStateTimeBuilder_;
    }

    private com.google.protobuf.Timestamp lastConfigAckTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        lastConfigAckTimeBuilder_;
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version acknowledgment
     * was received from the device. This field is only for configurations
     * sent through MQTT.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
     *
     * @return Whether the lastConfigAckTime field is set.
     */
    public boolean hasLastConfigAckTime() {
      return lastConfigAckTimeBuilder_ != null || lastConfigAckTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version acknowledgment
     * was received from the device. This field is only for configurations
     * sent through MQTT.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
     *
     * @return The lastConfigAckTime.
     */
    public com.google.protobuf.Timestamp getLastConfigAckTime() {
      if (lastConfigAckTimeBuilder_ == null) {
        return lastConfigAckTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastConfigAckTime_;
      } else {
        return lastConfigAckTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version acknowledgment
     * was received from the device. This field is only for configurations
     * sent through MQTT.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
     */
    public Builder setLastConfigAckTime(com.google.protobuf.Timestamp value) {
      if (lastConfigAckTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        lastConfigAckTime_ = value;
        onChanged();
      } else {
        lastConfigAckTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version acknowledgment
     * was received from the device. This field is only for configurations
     * sent through MQTT.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
     */
    public Builder setLastConfigAckTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (lastConfigAckTimeBuilder_ == null) {
        lastConfigAckTime_ = builderForValue.build();
        onChanged();
      } else {
        lastConfigAckTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version acknowledgment
     * was received from the device. This field is only for configurations
     * sent through MQTT.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
     */
    public Builder mergeLastConfigAckTime(com.google.protobuf.Timestamp value) {
      if (lastConfigAckTimeBuilder_ == null) {
        if (lastConfigAckTime_ != null) {
          lastConfigAckTime_ =
              com.google.protobuf.Timestamp.newBuilder(lastConfigAckTime_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          lastConfigAckTime_ = value;
        }
        onChanged();
      } else {
        lastConfigAckTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version acknowledgment
     * was received from the device. This field is only for configurations
     * sent through MQTT.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
     */
    public Builder clearLastConfigAckTime() {
      if (lastConfigAckTimeBuilder_ == null) {
        lastConfigAckTime_ = null;
        onChanged();
      } else {
        lastConfigAckTime_ = null;
        lastConfigAckTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version acknowledgment
     * was received from the device. This field is only for configurations
     * sent through MQTT.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
     */
    public com.google.protobuf.Timestamp.Builder getLastConfigAckTimeBuilder() {

      onChanged();
      return getLastConfigAckTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version acknowledgment
     * was received from the device. This field is only for configurations
     * sent through MQTT.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getLastConfigAckTimeOrBuilder() {
      if (lastConfigAckTimeBuilder_ != null) {
        return lastConfigAckTimeBuilder_.getMessageOrBuilder();
      } else {
        return lastConfigAckTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastConfigAckTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version acknowledgment
     * was received from the device. This field is only for configurations
     * sent through MQTT.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_ack_time = 14;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getLastConfigAckTimeFieldBuilder() {
      if (lastConfigAckTimeBuilder_ == null) {
        lastConfigAckTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getLastConfigAckTime(), getParentForChildren(), isClean());
        lastConfigAckTime_ = null;
      }
      return lastConfigAckTimeBuilder_;
    }

    private com.google.protobuf.Timestamp lastConfigSendTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        lastConfigSendTimeBuilder_;
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version was sent to
     * the device.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
     *
     * @return Whether the lastConfigSendTime field is set.
     */
    public boolean hasLastConfigSendTime() {
      return lastConfigSendTimeBuilder_ != null || lastConfigSendTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version was sent to
     * the device.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
     *
     * @return The lastConfigSendTime.
     */
    public com.google.protobuf.Timestamp getLastConfigSendTime() {
      if (lastConfigSendTimeBuilder_ == null) {
        return lastConfigSendTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastConfigSendTime_;
      } else {
        return lastConfigSendTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version was sent to
     * the device.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
     */
    public Builder setLastConfigSendTime(com.google.protobuf.Timestamp value) {
      if (lastConfigSendTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        lastConfigSendTime_ = value;
        onChanged();
      } else {
        lastConfigSendTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version was sent to
     * the device.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
     */
    public Builder setLastConfigSendTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (lastConfigSendTimeBuilder_ == null) {
        lastConfigSendTime_ = builderForValue.build();
        onChanged();
      } else {
        lastConfigSendTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version was sent to
     * the device.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
     */
    public Builder mergeLastConfigSendTime(com.google.protobuf.Timestamp value) {
      if (lastConfigSendTimeBuilder_ == null) {
        if (lastConfigSendTime_ != null) {
          lastConfigSendTime_ =
              com.google.protobuf.Timestamp.newBuilder(lastConfigSendTime_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          lastConfigSendTime_ = value;
        }
        onChanged();
      } else {
        lastConfigSendTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version was sent to
     * the device.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
     */
    public Builder clearLastConfigSendTime() {
      if (lastConfigSendTimeBuilder_ == null) {
        lastConfigSendTime_ = null;
        onChanged();
      } else {
        lastConfigSendTime_ = null;
        lastConfigSendTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version was sent to
     * the device.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
     */
    public com.google.protobuf.Timestamp.Builder getLastConfigSendTimeBuilder() {

      onChanged();
      return getLastConfigSendTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version was sent to
     * the device.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getLastConfigSendTimeOrBuilder() {
      if (lastConfigSendTimeBuilder_ != null) {
        return lastConfigSendTimeBuilder_.getMessageOrBuilder();
      } else {
        return lastConfigSendTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastConfigSendTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The last time a cloud-to-device config version was sent to
     * the device.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_config_send_time = 18;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getLastConfigSendTimeFieldBuilder() {
      if (lastConfigSendTimeBuilder_ == null) {
        lastConfigSendTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getLastConfigSendTime(), getParentForChildren(), isClean());
        lastConfigSendTime_ = null;
      }
      return lastConfigSendTimeBuilder_;
    }

    private boolean blocked_;
    /**
     *
     *
     * <pre>
     * If a device is blocked, connections or requests from this device will fail.
     * Can be used to temporarily prevent the device from connecting if, for
     * example, the sensor is generating bad data and needs maintenance.
     * </pre>
     *
     * <code>bool blocked = 19;</code>
     *
     * @return The blocked.
     */
    @java.lang.Override
    public boolean getBlocked() {
      return blocked_;
    }
    /**
     *
     *
     * <pre>
     * If a device is blocked, connections or requests from this device will fail.
     * Can be used to temporarily prevent the device from connecting if, for
     * example, the sensor is generating bad data and needs maintenance.
     * </pre>
     *
     * <code>bool blocked = 19;</code>
     *
     * @param value The blocked to set.
     * @return This builder for chaining.
     */
    public Builder setBlocked(boolean value) {

      blocked_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If a device is blocked, connections or requests from this device will fail.
     * Can be used to temporarily prevent the device from connecting if, for
     * example, the sensor is generating bad data and needs maintenance.
     * </pre>
     *
     * <code>bool blocked = 19;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearBlocked() {

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

    private com.google.protobuf.Timestamp lastErrorTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        lastErrorTimeBuilder_;
    /**
     *
     *
     * <pre>
     * [Output only] The time the most recent error occurred, such as a failure to
     * publish to Cloud Pub/Sub. This field is the timestamp of
     * 'last_error_status'.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
     *
     * @return Whether the lastErrorTime field is set.
     */
    public boolean hasLastErrorTime() {
      return lastErrorTimeBuilder_ != null || lastErrorTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time the most recent error occurred, such as a failure to
     * publish to Cloud Pub/Sub. This field is the timestamp of
     * 'last_error_status'.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
     *
     * @return The lastErrorTime.
     */
    public com.google.protobuf.Timestamp getLastErrorTime() {
      if (lastErrorTimeBuilder_ == null) {
        return lastErrorTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastErrorTime_;
      } else {
        return lastErrorTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time the most recent error occurred, such as a failure to
     * publish to Cloud Pub/Sub. This field is the timestamp of
     * 'last_error_status'.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
     */
    public Builder setLastErrorTime(com.google.protobuf.Timestamp value) {
      if (lastErrorTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        lastErrorTime_ = value;
        onChanged();
      } else {
        lastErrorTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time the most recent error occurred, such as a failure to
     * publish to Cloud Pub/Sub. This field is the timestamp of
     * 'last_error_status'.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
     */
    public Builder setLastErrorTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (lastErrorTimeBuilder_ == null) {
        lastErrorTime_ = builderForValue.build();
        onChanged();
      } else {
        lastErrorTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time the most recent error occurred, such as a failure to
     * publish to Cloud Pub/Sub. This field is the timestamp of
     * 'last_error_status'.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
     */
    public Builder mergeLastErrorTime(com.google.protobuf.Timestamp value) {
      if (lastErrorTimeBuilder_ == null) {
        if (lastErrorTime_ != null) {
          lastErrorTime_ =
              com.google.protobuf.Timestamp.newBuilder(lastErrorTime_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          lastErrorTime_ = value;
        }
        onChanged();
      } else {
        lastErrorTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time the most recent error occurred, such as a failure to
     * publish to Cloud Pub/Sub. This field is the timestamp of
     * 'last_error_status'.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
     */
    public Builder clearLastErrorTime() {
      if (lastErrorTimeBuilder_ == null) {
        lastErrorTime_ = null;
        onChanged();
      } else {
        lastErrorTime_ = null;
        lastErrorTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time the most recent error occurred, such as a failure to
     * publish to Cloud Pub/Sub. This field is the timestamp of
     * 'last_error_status'.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
     */
    public com.google.protobuf.Timestamp.Builder getLastErrorTimeBuilder() {

      onChanged();
      return getLastErrorTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time the most recent error occurred, such as a failure to
     * publish to Cloud Pub/Sub. This field is the timestamp of
     * 'last_error_status'.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getLastErrorTimeOrBuilder() {
      if (lastErrorTimeBuilder_ != null) {
        return lastErrorTimeBuilder_.getMessageOrBuilder();
      } else {
        return lastErrorTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : lastErrorTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The time the most recent error occurred, such as a failure to
     * publish to Cloud Pub/Sub. This field is the timestamp of
     * 'last_error_status'.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp last_error_time = 10;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getLastErrorTimeFieldBuilder() {
      if (lastErrorTimeBuilder_ == null) {
        lastErrorTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getLastErrorTime(), getParentForChildren(), isClean());
        lastErrorTime_ = null;
      }
      return lastErrorTimeBuilder_;
    }

    private com.google.rpc.Status lastErrorStatus_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
        lastErrorStatusBuilder_;
    /**
     *
     *
     * <pre>
     * [Output only] The error message of the most recent error, such as a failure
     * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
     * field. If no errors have occurred, this field has an empty message
     * and the status code 0 == OK. Otherwise, this field is expected to have a
     * status code other than OK.
     * </pre>
     *
     * <code>.google.rpc.Status last_error_status = 11;</code>
     *
     * @return Whether the lastErrorStatus field is set.
     */
    public boolean hasLastErrorStatus() {
      return lastErrorStatusBuilder_ != null || lastErrorStatus_ != null;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The error message of the most recent error, such as a failure
     * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
     * field. If no errors have occurred, this field has an empty message
     * and the status code 0 == OK. Otherwise, this field is expected to have a
     * status code other than OK.
     * </pre>
     *
     * <code>.google.rpc.Status last_error_status = 11;</code>
     *
     * @return The lastErrorStatus.
     */
    public com.google.rpc.Status getLastErrorStatus() {
      if (lastErrorStatusBuilder_ == null) {
        return lastErrorStatus_ == null
            ? com.google.rpc.Status.getDefaultInstance()
            : lastErrorStatus_;
      } else {
        return lastErrorStatusBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The error message of the most recent error, such as a failure
     * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
     * field. If no errors have occurred, this field has an empty message
     * and the status code 0 == OK. Otherwise, this field is expected to have a
     * status code other than OK.
     * </pre>
     *
     * <code>.google.rpc.Status last_error_status = 11;</code>
     */
    public Builder setLastErrorStatus(com.google.rpc.Status value) {
      if (lastErrorStatusBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        lastErrorStatus_ = value;
        onChanged();
      } else {
        lastErrorStatusBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The error message of the most recent error, such as a failure
     * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
     * field. If no errors have occurred, this field has an empty message
     * and the status code 0 == OK. Otherwise, this field is expected to have a
     * status code other than OK.
     * </pre>
     *
     * <code>.google.rpc.Status last_error_status = 11;</code>
     */
    public Builder setLastErrorStatus(com.google.rpc.Status.Builder builderForValue) {
      if (lastErrorStatusBuilder_ == null) {
        lastErrorStatus_ = builderForValue.build();
        onChanged();
      } else {
        lastErrorStatusBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The error message of the most recent error, such as a failure
     * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
     * field. If no errors have occurred, this field has an empty message
     * and the status code 0 == OK. Otherwise, this field is expected to have a
     * status code other than OK.
     * </pre>
     *
     * <code>.google.rpc.Status last_error_status = 11;</code>
     */
    public Builder mergeLastErrorStatus(com.google.rpc.Status value) {
      if (lastErrorStatusBuilder_ == null) {
        if (lastErrorStatus_ != null) {
          lastErrorStatus_ =
              com.google.rpc.Status.newBuilder(lastErrorStatus_).mergeFrom(value).buildPartial();
        } else {
          lastErrorStatus_ = value;
        }
        onChanged();
      } else {
        lastErrorStatusBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The error message of the most recent error, such as a failure
     * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
     * field. If no errors have occurred, this field has an empty message
     * and the status code 0 == OK. Otherwise, this field is expected to have a
     * status code other than OK.
     * </pre>
     *
     * <code>.google.rpc.Status last_error_status = 11;</code>
     */
    public Builder clearLastErrorStatus() {
      if (lastErrorStatusBuilder_ == null) {
        lastErrorStatus_ = null;
        onChanged();
      } else {
        lastErrorStatus_ = null;
        lastErrorStatusBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The error message of the most recent error, such as a failure
     * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
     * field. If no errors have occurred, this field has an empty message
     * and the status code 0 == OK. Otherwise, this field is expected to have a
     * status code other than OK.
     * </pre>
     *
     * <code>.google.rpc.Status last_error_status = 11;</code>
     */
    public com.google.rpc.Status.Builder getLastErrorStatusBuilder() {

      onChanged();
      return getLastErrorStatusFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * [Output only] The error message of the most recent error, such as a failure
     * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
     * field. If no errors have occurred, this field has an empty message
     * and the status code 0 == OK. Otherwise, this field is expected to have a
     * status code other than OK.
     * </pre>
     *
     * <code>.google.rpc.Status last_error_status = 11;</code>
     */
    public com.google.rpc.StatusOrBuilder getLastErrorStatusOrBuilder() {
      if (lastErrorStatusBuilder_ != null) {
        return lastErrorStatusBuilder_.getMessageOrBuilder();
      } else {
        return lastErrorStatus_ == null
            ? com.google.rpc.Status.getDefaultInstance()
            : lastErrorStatus_;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The error message of the most recent error, such as a failure
     * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
     * field. If no errors have occurred, this field has an empty message
     * and the status code 0 == OK. Otherwise, this field is expected to have a
     * status code other than OK.
     * </pre>
     *
     * <code>.google.rpc.Status last_error_status = 11;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
        getLastErrorStatusFieldBuilder() {
      if (lastErrorStatusBuilder_ == null) {
        lastErrorStatusBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.rpc.Status,
                com.google.rpc.Status.Builder,
                com.google.rpc.StatusOrBuilder>(
                getLastErrorStatus(), getParentForChildren(), isClean());
        lastErrorStatus_ = null;
      }
      return lastErrorStatusBuilder_;
    }

    private com.google.cloud.iot.v1.DeviceConfig config_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceConfig,
            com.google.cloud.iot.v1.DeviceConfig.Builder,
            com.google.cloud.iot.v1.DeviceConfigOrBuilder>
        configBuilder_;
    /**
     *
     *
     * <pre>
     * The most recent device configuration, which is eventually sent from
     * Cloud IoT Core to the device. If not present on creation, the
     * configuration will be initialized with an empty payload and version value
     * of `1`. To update this field after creation, use the
     * `DeviceManager.ModifyCloudToDeviceConfig` method.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
     *
     * @return Whether the config field is set.
     */
    public boolean hasConfig() {
      return configBuilder_ != null || config_ != null;
    }
    /**
     *
     *
     * <pre>
     * The most recent device configuration, which is eventually sent from
     * Cloud IoT Core to the device. If not present on creation, the
     * configuration will be initialized with an empty payload and version value
     * of `1`. To update this field after creation, use the
     * `DeviceManager.ModifyCloudToDeviceConfig` method.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
     *
     * @return The config.
     */
    public com.google.cloud.iot.v1.DeviceConfig getConfig() {
      if (configBuilder_ == null) {
        return config_ == null
            ? com.google.cloud.iot.v1.DeviceConfig.getDefaultInstance()
            : config_;
      } else {
        return configBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The most recent device configuration, which is eventually sent from
     * Cloud IoT Core to the device. If not present on creation, the
     * configuration will be initialized with an empty payload and version value
     * of `1`. To update this field after creation, use the
     * `DeviceManager.ModifyCloudToDeviceConfig` method.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
     */
    public Builder setConfig(com.google.cloud.iot.v1.DeviceConfig value) {
      if (configBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        config_ = value;
        onChanged();
      } else {
        configBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The most recent device configuration, which is eventually sent from
     * Cloud IoT Core to the device. If not present on creation, the
     * configuration will be initialized with an empty payload and version value
     * of `1`. To update this field after creation, use the
     * `DeviceManager.ModifyCloudToDeviceConfig` method.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
     */
    public Builder setConfig(com.google.cloud.iot.v1.DeviceConfig.Builder builderForValue) {
      if (configBuilder_ == null) {
        config_ = builderForValue.build();
        onChanged();
      } else {
        configBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The most recent device configuration, which is eventually sent from
     * Cloud IoT Core to the device. If not present on creation, the
     * configuration will be initialized with an empty payload and version value
     * of `1`. To update this field after creation, use the
     * `DeviceManager.ModifyCloudToDeviceConfig` method.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
     */
    public Builder mergeConfig(com.google.cloud.iot.v1.DeviceConfig value) {
      if (configBuilder_ == null) {
        if (config_ != null) {
          config_ =
              com.google.cloud.iot.v1.DeviceConfig.newBuilder(config_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          config_ = value;
        }
        onChanged();
      } else {
        configBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The most recent device configuration, which is eventually sent from
     * Cloud IoT Core to the device. If not present on creation, the
     * configuration will be initialized with an empty payload and version value
     * of `1`. To update this field after creation, use the
     * `DeviceManager.ModifyCloudToDeviceConfig` method.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
     */
    public Builder clearConfig() {
      if (configBuilder_ == null) {
        config_ = null;
        onChanged();
      } else {
        config_ = null;
        configBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The most recent device configuration, which is eventually sent from
     * Cloud IoT Core to the device. If not present on creation, the
     * configuration will be initialized with an empty payload and version value
     * of `1`. To update this field after creation, use the
     * `DeviceManager.ModifyCloudToDeviceConfig` method.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
     */
    public com.google.cloud.iot.v1.DeviceConfig.Builder getConfigBuilder() {

      onChanged();
      return getConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The most recent device configuration, which is eventually sent from
     * Cloud IoT Core to the device. If not present on creation, the
     * configuration will be initialized with an empty payload and version value
     * of `1`. To update this field after creation, use the
     * `DeviceManager.ModifyCloudToDeviceConfig` method.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
     */
    public com.google.cloud.iot.v1.DeviceConfigOrBuilder getConfigOrBuilder() {
      if (configBuilder_ != null) {
        return configBuilder_.getMessageOrBuilder();
      } else {
        return config_ == null
            ? com.google.cloud.iot.v1.DeviceConfig.getDefaultInstance()
            : config_;
      }
    }
    /**
     *
     *
     * <pre>
     * The most recent device configuration, which is eventually sent from
     * Cloud IoT Core to the device. If not present on creation, the
     * configuration will be initialized with an empty payload and version value
     * of `1`. To update this field after creation, use the
     * `DeviceManager.ModifyCloudToDeviceConfig` method.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceConfig config = 13;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceConfig,
            com.google.cloud.iot.v1.DeviceConfig.Builder,
            com.google.cloud.iot.v1.DeviceConfigOrBuilder>
        getConfigFieldBuilder() {
      if (configBuilder_ == null) {
        configBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.iot.v1.DeviceConfig,
                com.google.cloud.iot.v1.DeviceConfig.Builder,
                com.google.cloud.iot.v1.DeviceConfigOrBuilder>(
                getConfig(), getParentForChildren(), isClean());
        config_ = null;
      }
      return configBuilder_;
    }

    private com.google.cloud.iot.v1.DeviceState state_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceState,
            com.google.cloud.iot.v1.DeviceState.Builder,
            com.google.cloud.iot.v1.DeviceStateOrBuilder>
        stateBuilder_;
    /**
     *
     *
     * <pre>
     * [Output only] The state most recently received from the device. If no state
     * has been reported, this field is not present.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
     *
     * @return Whether the state field is set.
     */
    public boolean hasState() {
      return stateBuilder_ != null || state_ != null;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The state most recently received from the device. If no state
     * has been reported, this field is not present.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
     *
     * @return The state.
     */
    public com.google.cloud.iot.v1.DeviceState getState() {
      if (stateBuilder_ == null) {
        return state_ == null ? com.google.cloud.iot.v1.DeviceState.getDefaultInstance() : state_;
      } else {
        return stateBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The state most recently received from the device. If no state
     * has been reported, this field is not present.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
     */
    public Builder setState(com.google.cloud.iot.v1.DeviceState value) {
      if (stateBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        state_ = value;
        onChanged();
      } else {
        stateBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The state most recently received from the device. If no state
     * has been reported, this field is not present.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
     */
    public Builder setState(com.google.cloud.iot.v1.DeviceState.Builder builderForValue) {
      if (stateBuilder_ == null) {
        state_ = builderForValue.build();
        onChanged();
      } else {
        stateBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The state most recently received from the device. If no state
     * has been reported, this field is not present.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
     */
    public Builder mergeState(com.google.cloud.iot.v1.DeviceState value) {
      if (stateBuilder_ == null) {
        if (state_ != null) {
          state_ =
              com.google.cloud.iot.v1.DeviceState.newBuilder(state_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          state_ = value;
        }
        onChanged();
      } else {
        stateBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The state most recently received from the device. If no state
     * has been reported, this field is not present.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
     */
    public Builder clearState() {
      if (stateBuilder_ == null) {
        state_ = null;
        onChanged();
      } else {
        state_ = null;
        stateBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output only] The state most recently received from the device. If no state
     * has been reported, this field is not present.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
     */
    public com.google.cloud.iot.v1.DeviceState.Builder getStateBuilder() {

      onChanged();
      return getStateFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * [Output only] The state most recently received from the device. If no state
     * has been reported, this field is not present.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
     */
    public com.google.cloud.iot.v1.DeviceStateOrBuilder getStateOrBuilder() {
      if (stateBuilder_ != null) {
        return stateBuilder_.getMessageOrBuilder();
      } else {
        return state_ == null ? com.google.cloud.iot.v1.DeviceState.getDefaultInstance() : state_;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output only] The state most recently received from the device. If no state
     * has been reported, this field is not present.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.DeviceState state = 16;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceState,
            com.google.cloud.iot.v1.DeviceState.Builder,
            com.google.cloud.iot.v1.DeviceStateOrBuilder>
        getStateFieldBuilder() {
      if (stateBuilder_ == null) {
        stateBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.iot.v1.DeviceState,
                com.google.cloud.iot.v1.DeviceState.Builder,
                com.google.cloud.iot.v1.DeviceStateOrBuilder>(
                getState(), getParentForChildren(), isClean());
        state_ = null;
      }
      return stateBuilder_;
    }

    private int logLevel_ = 0;
    /**
     *
     *
     * <pre>
     * **Beta Feature**
     * The logging verbosity for device activity. If unspecified,
     * DeviceRegistry.log_level will be used.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.LogLevel log_level = 21;</code>
     *
     * @return The enum numeric value on the wire for logLevel.
     */
    @java.lang.Override
    public int getLogLevelValue() {
      return logLevel_;
    }
    /**
     *
     *
     * <pre>
     * **Beta Feature**
     * The logging verbosity for device activity. If unspecified,
     * DeviceRegistry.log_level will be used.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.LogLevel log_level = 21;</code>
     *
     * @param value The enum numeric value on the wire for logLevel to set.
     * @return This builder for chaining.
     */
    public Builder setLogLevelValue(int value) {

      logLevel_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * **Beta Feature**
     * The logging verbosity for device activity. If unspecified,
     * DeviceRegistry.log_level will be used.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.LogLevel log_level = 21;</code>
     *
     * @return The logLevel.
     */
    @java.lang.Override
    public com.google.cloud.iot.v1.LogLevel getLogLevel() {
      @SuppressWarnings("deprecation")
      com.google.cloud.iot.v1.LogLevel result = com.google.cloud.iot.v1.LogLevel.valueOf(logLevel_);
      return result == null ? com.google.cloud.iot.v1.LogLevel.UNRECOGNIZED : result;
    }
    /**
     *
     *
     * <pre>
     * **Beta Feature**
     * The logging verbosity for device activity. If unspecified,
     * DeviceRegistry.log_level will be used.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.LogLevel log_level = 21;</code>
     *
     * @param value The logLevel to set.
     * @return This builder for chaining.
     */
    public Builder setLogLevel(com.google.cloud.iot.v1.LogLevel value) {
      if (value == null) {
        throw new NullPointerException();
      }

      logLevel_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * **Beta Feature**
     * The logging verbosity for device activity. If unspecified,
     * DeviceRegistry.log_level will be used.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.LogLevel log_level = 21;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearLogLevel() {

      logLevel_ = 0;
      onChanged();
      return this;
    }

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

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMetadata() {
      if (metadata_ == null) {
        return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
      }
      return metadata_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableMetadata() {
      onChanged();
      ;
      if (metadata_ == null) {
        metadata_ =
            com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry);
      }
      if (!metadata_.isMutable()) {
        metadata_ = metadata_.copy();
      }
      return metadata_;
    }

    public int getMetadataCount() {
      return internalGetMetadata().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * The metadata key-value pairs assigned to the device. This metadata is not
     * interpreted or indexed by Cloud IoT Core. It can be used to add contextual
     * information for the device.
     * Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
     * be less than 128 bytes in length.
     * Values are free-form strings. Each value must be less than or equal to 32
     * KB in size.
     * The total size of all keys and values must be less than 256 KB, and the
     * maximum number of key-value pairs is 500.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 17;</code>
     */
    @java.lang.Override
    public boolean containsMetadata(java.lang.String key) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      return internalGetMetadata().getMap().containsKey(key);
    }
    /** Use {@link #getMetadataMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
      return getMetadataMap();
    }
    /**
     *
     *
     * <pre>
     * The metadata key-value pairs assigned to the device. This metadata is not
     * interpreted or indexed by Cloud IoT Core. It can be used to add contextual
     * information for the device.
     * Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
     * be less than 128 bytes in length.
     * Values are free-form strings. Each value must be less than or equal to 32
     * KB in size.
     * The total size of all keys and values must be less than 256 KB, and the
     * maximum number of key-value pairs is 500.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 17;</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
      return internalGetMetadata().getMap();
    }
    /**
     *
     *
     * <pre>
     * The metadata key-value pairs assigned to the device. This metadata is not
     * interpreted or indexed by Cloud IoT Core. It can be used to add contextual
     * information for the device.
     * Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
     * be less than 128 bytes in length.
     * Values are free-form strings. Each value must be less than or equal to 32
     * KB in size.
     * The total size of all keys and values must be less than 256 KB, and the
     * maximum number of key-value pairs is 500.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 17;</code>
     */
    @java.lang.Override
    public java.lang.String getMetadataOrDefault(
        java.lang.String key, java.lang.String defaultValue) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * The metadata key-value pairs assigned to the device. This metadata is not
     * interpreted or indexed by Cloud IoT Core. It can be used to add contextual
     * information for the device.
     * Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
     * be less than 128 bytes in length.
     * Values are free-form strings. Each value must be less than or equal to 32
     * KB in size.
     * The total size of all keys and values must be less than 256 KB, and the
     * maximum number of key-value pairs is 500.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 17;</code>
     */
    @java.lang.Override
    public java.lang.String getMetadataOrThrow(java.lang.String key) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearMetadata() {
      internalGetMutableMetadata().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The metadata key-value pairs assigned to the device. This metadata is not
     * interpreted or indexed by Cloud IoT Core. It can be used to add contextual
     * information for the device.
     * Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
     * be less than 128 bytes in length.
     * Values are free-form strings. Each value must be less than or equal to 32
     * KB in size.
     * The total size of all keys and values must be less than 256 KB, and the
     * maximum number of key-value pairs is 500.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 17;</code>
     */
    public Builder removeMetadata(java.lang.String key) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      internalGetMutableMetadata().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMutableMetadata() {
      return internalGetMutableMetadata().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * The metadata key-value pairs assigned to the device. This metadata is not
     * interpreted or indexed by Cloud IoT Core. It can be used to add contextual
     * information for the device.
     * Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
     * be less than 128 bytes in length.
     * Values are free-form strings. Each value must be less than or equal to 32
     * KB in size.
     * The total size of all keys and values must be less than 256 KB, and the
     * maximum number of key-value pairs is 500.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 17;</code>
     */
    public Builder putMetadata(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      if (value == null) {
        throw new java.lang.NullPointerException();
      }
      internalGetMutableMetadata().getMutableMap().put(key, value);
      return this;
    }
    /**
     *
     *
     * <pre>
     * The metadata key-value pairs assigned to the device. This metadata is not
     * interpreted or indexed by Cloud IoT Core. It can be used to add contextual
     * information for the device.
     * Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
     * be less than 128 bytes in length.
     * Values are free-form strings. Each value must be less than or equal to 32
     * KB in size.
     * The total size of all keys and values must be less than 256 KB, and the
     * maximum number of key-value pairs is 500.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 17;</code>
     */
    public Builder putAllMetadata(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableMetadata().getMutableMap().putAll(values);
      return this;
    }

    private com.google.cloud.iot.v1.GatewayConfig gatewayConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.GatewayConfig,
            com.google.cloud.iot.v1.GatewayConfig.Builder,
            com.google.cloud.iot.v1.GatewayConfigOrBuilder>
        gatewayConfigBuilder_;
    /**
     *
     *
     * <pre>
     * Gateway-related configuration and state.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
     *
     * @return Whether the gatewayConfig field is set.
     */
    public boolean hasGatewayConfig() {
      return gatewayConfigBuilder_ != null || gatewayConfig_ != null;
    }
    /**
     *
     *
     * <pre>
     * Gateway-related configuration and state.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
     *
     * @return The gatewayConfig.
     */
    public com.google.cloud.iot.v1.GatewayConfig getGatewayConfig() {
      if (gatewayConfigBuilder_ == null) {
        return gatewayConfig_ == null
            ? com.google.cloud.iot.v1.GatewayConfig.getDefaultInstance()
            : gatewayConfig_;
      } else {
        return gatewayConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Gateway-related configuration and state.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
     */
    public Builder setGatewayConfig(com.google.cloud.iot.v1.GatewayConfig value) {
      if (gatewayConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        gatewayConfig_ = value;
        onChanged();
      } else {
        gatewayConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Gateway-related configuration and state.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
     */
    public Builder setGatewayConfig(com.google.cloud.iot.v1.GatewayConfig.Builder builderForValue) {
      if (gatewayConfigBuilder_ == null) {
        gatewayConfig_ = builderForValue.build();
        onChanged();
      } else {
        gatewayConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Gateway-related configuration and state.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
     */
    public Builder mergeGatewayConfig(com.google.cloud.iot.v1.GatewayConfig value) {
      if (gatewayConfigBuilder_ == null) {
        if (gatewayConfig_ != null) {
          gatewayConfig_ =
              com.google.cloud.iot.v1.GatewayConfig.newBuilder(gatewayConfig_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          gatewayConfig_ = value;
        }
        onChanged();
      } else {
        gatewayConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Gateway-related configuration and state.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
     */
    public Builder clearGatewayConfig() {
      if (gatewayConfigBuilder_ == null) {
        gatewayConfig_ = null;
        onChanged();
      } else {
        gatewayConfig_ = null;
        gatewayConfigBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Gateway-related configuration and state.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
     */
    public com.google.cloud.iot.v1.GatewayConfig.Builder getGatewayConfigBuilder() {

      onChanged();
      return getGatewayConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Gateway-related configuration and state.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
     */
    public com.google.cloud.iot.v1.GatewayConfigOrBuilder getGatewayConfigOrBuilder() {
      if (gatewayConfigBuilder_ != null) {
        return gatewayConfigBuilder_.getMessageOrBuilder();
      } else {
        return gatewayConfig_ == null
            ? com.google.cloud.iot.v1.GatewayConfig.getDefaultInstance()
            : gatewayConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * Gateway-related configuration and state.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayConfig gateway_config = 24;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.GatewayConfig,
            com.google.cloud.iot.v1.GatewayConfig.Builder,
            com.google.cloud.iot.v1.GatewayConfigOrBuilder>
        getGatewayConfigFieldBuilder() {
      if (gatewayConfigBuilder_ == null) {
        gatewayConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.iot.v1.GatewayConfig,
                com.google.cloud.iot.v1.GatewayConfig.Builder,
                com.google.cloud.iot.v1.GatewayConfigOrBuilder>(
                getGatewayConfig(), getParentForChildren(), isClean());
        gatewayConfig_ = null;
      }
      return gatewayConfigBuilder_;
    }

    @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.Device)
  }

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

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

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

  private static final com.google.protobuf.Parser<Device> PARSER =
      new com.google.protobuf.AbstractParser<Device>() {
        @java.lang.Override
        public Device parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new Device(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.Device getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} 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;
  }

  private DeviceConfig(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 8:
            {
              version_ = input.readInt64();
              break;
            }
          case 18:
            {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (cloudUpdateTime_ != null) {
                subBuilder = cloudUpdateTime_.toBuilder();
              }
              cloudUpdateTime_ =
                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(cloudUpdateTime_);
                cloudUpdateTime_ = subBuilder.buildPartial();
              }

              break;
            }
          case 26:
            {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (deviceAckTime_ != null) {
                subBuilder = deviceAckTime_.toBuilder();
              }
              deviceAckTime_ =
                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(deviceAckTime_);
                deviceAckTime_ = subBuilder.buildPartial();
              }

              break;
            }
          case 34:
            {
              binaryData_ = input.readBytes();
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  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_;
  /**
   *
   *
   * <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 getCloudUpdateTime();
  }

  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 getDeviceAckTime();
  }

  public static final int BINARY_DATA_FIELD_NUMBER = 4;
  private com.google.protobuf.ByteString binaryData_;
  /**
   *
   *
   * <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_);
    }
    unknownFields.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 += unknownFields.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 (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.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() {
      maybeForceBuilderInitialization();
    }

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      version_ = 0L;

      if (cloudUpdateTimeBuilder_ == null) {
        cloudUpdateTime_ = null;
      } else {
        cloudUpdateTime_ = null;
        cloudUpdateTimeBuilder_ = null;
      }
      if (deviceAckTimeBuilder_ == null) {
        deviceAckTime_ = null;
      } else {
        deviceAckTime_ = null;
        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);
      result.version_ = version_;
      if (cloudUpdateTimeBuilder_ == null) {
        result.cloudUpdateTime_ = cloudUpdateTime_;
      } else {
        result.cloudUpdateTime_ = cloudUpdateTimeBuilder_.build();
      }
      if (deviceAckTimeBuilder_ == null) {
        result.deviceAckTime_ = deviceAckTime_;
      } else {
        result.deviceAckTime_ = deviceAckTimeBuilder_.build();
      }
      result.binaryData_ = binaryData_;
      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.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.unknownFields);
      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 {
      com.google.cloud.iot.v1.DeviceConfig parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.DeviceConfig) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    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;
      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() {

      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 cloudUpdateTimeBuilder_ != null || 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.
     */
    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;
        onChanged();
      } else {
        cloudUpdateTimeBuilder_.setMessage(value);
      }

      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();
        onChanged();
      } else {
        cloudUpdateTimeBuilder_.setMessage(builderForValue.build());
      }

      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 (cloudUpdateTime_ != null) {
          cloudUpdateTime_ =
              com.google.protobuf.Timestamp.newBuilder(cloudUpdateTime_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          cloudUpdateTime_ = value;
        }
        onChanged();
      } else {
        cloudUpdateTimeBuilder_.mergeFrom(value);
      }

      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() {
      if (cloudUpdateTimeBuilder_ == null) {
        cloudUpdateTime_ = null;
        onChanged();
      } else {
        cloudUpdateTime_ = null;
        cloudUpdateTimeBuilder_ = null;
      }

      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() {

      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 deviceAckTimeBuilder_ != null || 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.
     */
    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;
        onChanged();
      } else {
        deviceAckTimeBuilder_.setMessage(value);
      }

      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();
        onChanged();
      } else {
        deviceAckTimeBuilder_.setMessage(builderForValue.build());
      }

      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 (deviceAckTime_ != null) {
          deviceAckTime_ =
              com.google.protobuf.Timestamp.newBuilder(deviceAckTime_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          deviceAckTime_ = value;
        }
        onChanged();
      } else {
        deviceAckTimeBuilder_.mergeFrom(value);
      }

      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() {
      if (deviceAckTimeBuilder_ == null) {
        deviceAckTime_ = null;
        onChanged();
      } else {
        deviceAckTime_ = null;
        deviceAckTimeBuilder_ = null;
      }

      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() {

      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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The device configuration data.
     * </pre>
     *
     * <code>bytes binary_data = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearBinaryData() {

      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 {
          return new DeviceConfig(input, extensionRegistry);
        }
      };

  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;
  }
} public final class DeviceRegistry extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.DeviceRegistry)
    DeviceRegistryOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use DeviceRegistry.newBuilder() to construct.
  private DeviceRegistry(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private DeviceRegistry() {
    id_ = "";
    name_ = "";
    eventNotificationConfigs_ = java.util.Collections.emptyList();
    logLevel_ = 0;
    credentials_ = java.util.Collections.emptyList();
  }

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

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

  private DeviceRegistry(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              id_ = s;
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          case 34:
            {
              com.google.cloud.iot.v1.MqttConfig.Builder subBuilder = null;
              if (mqttConfig_ != null) {
                subBuilder = mqttConfig_.toBuilder();
              }
              mqttConfig_ =
                  input.readMessage(com.google.cloud.iot.v1.MqttConfig.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(mqttConfig_);
                mqttConfig_ = subBuilder.buildPartial();
              }

              break;
            }
          case 58:
            {
              com.google.cloud.iot.v1.StateNotificationConfig.Builder subBuilder = null;
              if (stateNotificationConfig_ != null) {
                subBuilder = stateNotificationConfig_.toBuilder();
              }
              stateNotificationConfig_ =
                  input.readMessage(
                      com.google.cloud.iot.v1.StateNotificationConfig.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(stateNotificationConfig_);
                stateNotificationConfig_ = subBuilder.buildPartial();
              }

              break;
            }
          case 66:
            {
              if (!((mutable_bitField0_ & 0x00000002) != 0)) {
                credentials_ =
                    new java.util.ArrayList<com.google.cloud.iot.v1.RegistryCredential>();
                mutable_bitField0_ |= 0x00000002;
              }
              credentials_.add(
                  input.readMessage(
                      com.google.cloud.iot.v1.RegistryCredential.parser(), extensionRegistry));
              break;
            }
          case 74:
            {
              com.google.cloud.iot.v1.HttpConfig.Builder subBuilder = null;
              if (httpConfig_ != null) {
                subBuilder = httpConfig_.toBuilder();
              }
              httpConfig_ =
                  input.readMessage(com.google.cloud.iot.v1.HttpConfig.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(httpConfig_);
                httpConfig_ = subBuilder.buildPartial();
              }

              break;
            }
          case 82:
            {
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                eventNotificationConfigs_ =
                    new java.util.ArrayList<com.google.cloud.iot.v1.EventNotificationConfig>();
                mutable_bitField0_ |= 0x00000001;
              }
              eventNotificationConfigs_.add(
                  input.readMessage(
                      com.google.cloud.iot.v1.EventNotificationConfig.parser(), extensionRegistry));
              break;
            }
          case 88:
            {
              int rawValue = input.readEnum();

              logLevel_ = rawValue;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000002) != 0)) {
        credentials_ = java.util.Collections.unmodifiableList(credentials_);
      }
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        eventNotificationConfigs_ =
            java.util.Collections.unmodifiableList(eventNotificationConfigs_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.ResourcesProto
        .internal_static_google_cloud_iot_v1_DeviceRegistry_descriptor;
  }

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

  public static final int ID_FIELD_NUMBER = 1;
  private volatile java.lang.Object id_;
  /**
   *
   *
   * <pre>
   * The identifier of this device registry. For example, `myRegistry`.
   * </pre>
   *
   * <code>string id = 1;</code>
   *
   * @return The id.
   */
  @java.lang.Override
  public java.lang.String getId() {
    java.lang.Object ref = id_;
    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();
      id_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The identifier of this device registry. For example, `myRegistry`.
   * </pre>
   *
   * <code>string id = 1;</code>
   *
   * @return The bytes for id.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getIdBytes() {
    java.lang.Object ref = id_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      id_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int NAME_FIELD_NUMBER = 2;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * The resource path name. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>string name = 2;</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>
   * The resource path name. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>string name = 2;</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 EVENT_NOTIFICATION_CONFIGS_FIELD_NUMBER = 10;
  private java.util.List<com.google.cloud.iot.v1.EventNotificationConfig> eventNotificationConfigs_;
  /**
   *
   *
   * <pre>
   * The configuration for notification of telemetry events received from the
   * device. All telemetry events that were successfully published by the
   * device and acknowledged by Cloud IoT Core are guaranteed to be
   * delivered to Cloud Pub/Sub. If multiple configurations match a message,
   * only the first matching configuration is used. If you try to publish a
   * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
   * for the device's registry, the connection closes automatically. If you try
   * to do so using an HTTP connection, an error is returned. Up to 10
   * configurations may be provided.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
   * </code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.iot.v1.EventNotificationConfig>
      getEventNotificationConfigsList() {
    return eventNotificationConfigs_;
  }
  /**
   *
   *
   * <pre>
   * The configuration for notification of telemetry events received from the
   * device. All telemetry events that were successfully published by the
   * device and acknowledged by Cloud IoT Core are guaranteed to be
   * delivered to Cloud Pub/Sub. If multiple configurations match a message,
   * only the first matching configuration is used. If you try to publish a
   * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
   * for the device's registry, the connection closes automatically. If you try
   * to do so using an HTTP connection, an error is returned. Up to 10
   * configurations may be provided.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
   * </code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.iot.v1.EventNotificationConfigOrBuilder>
      getEventNotificationConfigsOrBuilderList() {
    return eventNotificationConfigs_;
  }
  /**
   *
   *
   * <pre>
   * The configuration for notification of telemetry events received from the
   * device. All telemetry events that were successfully published by the
   * device and acknowledged by Cloud IoT Core are guaranteed to be
   * delivered to Cloud Pub/Sub. If multiple configurations match a message,
   * only the first matching configuration is used. If you try to publish a
   * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
   * for the device's registry, the connection closes automatically. If you try
   * to do so using an HTTP connection, an error is returned. Up to 10
   * configurations may be provided.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
   * </code>
   */
  @java.lang.Override
  public int getEventNotificationConfigsCount() {
    return eventNotificationConfigs_.size();
  }
  /**
   *
   *
   * <pre>
   * The configuration for notification of telemetry events received from the
   * device. All telemetry events that were successfully published by the
   * device and acknowledged by Cloud IoT Core are guaranteed to be
   * delivered to Cloud Pub/Sub. If multiple configurations match a message,
   * only the first matching configuration is used. If you try to publish a
   * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
   * for the device's registry, the connection closes automatically. If you try
   * to do so using an HTTP connection, an error is returned. Up to 10
   * configurations may be provided.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.EventNotificationConfig getEventNotificationConfigs(int index) {
    return eventNotificationConfigs_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The configuration for notification of telemetry events received from the
   * device. All telemetry events that were successfully published by the
   * device and acknowledged by Cloud IoT Core are guaranteed to be
   * delivered to Cloud Pub/Sub. If multiple configurations match a message,
   * only the first matching configuration is used. If you try to publish a
   * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
   * for the device's registry, the connection closes automatically. If you try
   * to do so using an HTTP connection, an error is returned. Up to 10
   * configurations may be provided.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.EventNotificationConfigOrBuilder
      getEventNotificationConfigsOrBuilder(int index) {
    return eventNotificationConfigs_.get(index);
  }

  public static final int STATE_NOTIFICATION_CONFIG_FIELD_NUMBER = 7;
  private com.google.cloud.iot.v1.StateNotificationConfig stateNotificationConfig_;
  /**
   *
   *
   * <pre>
   * The configuration for notification of new states received from the device.
   * State updates are guaranteed to be stored in the state history, but
   * notifications to Cloud Pub/Sub are not guaranteed. For example, if
   * permissions are misconfigured or the specified topic doesn't exist, no
   * notification will be published but the state will still be stored in Cloud
   * IoT Core.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
   *
   * @return Whether the stateNotificationConfig field is set.
   */
  @java.lang.Override
  public boolean hasStateNotificationConfig() {
    return stateNotificationConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * The configuration for notification of new states received from the device.
   * State updates are guaranteed to be stored in the state history, but
   * notifications to Cloud Pub/Sub are not guaranteed. For example, if
   * permissions are misconfigured or the specified topic doesn't exist, no
   * notification will be published but the state will still be stored in Cloud
   * IoT Core.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
   *
   * @return The stateNotificationConfig.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.StateNotificationConfig getStateNotificationConfig() {
    return stateNotificationConfig_ == null
        ? com.google.cloud.iot.v1.StateNotificationConfig.getDefaultInstance()
        : stateNotificationConfig_;
  }
  /**
   *
   *
   * <pre>
   * The configuration for notification of new states received from the device.
   * State updates are guaranteed to be stored in the state history, but
   * notifications to Cloud Pub/Sub are not guaranteed. For example, if
   * permissions are misconfigured or the specified topic doesn't exist, no
   * notification will be published but the state will still be stored in Cloud
   * IoT Core.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.StateNotificationConfigOrBuilder
      getStateNotificationConfigOrBuilder() {
    return getStateNotificationConfig();
  }

  public static final int MQTT_CONFIG_FIELD_NUMBER = 4;
  private com.google.cloud.iot.v1.MqttConfig mqttConfig_;
  /**
   *
   *
   * <pre>
   * The MQTT configuration for this device registry.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
   *
   * @return Whether the mqttConfig field is set.
   */
  @java.lang.Override
  public boolean hasMqttConfig() {
    return mqttConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * The MQTT configuration for this device registry.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
   *
   * @return The mqttConfig.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.MqttConfig getMqttConfig() {
    return mqttConfig_ == null
        ? com.google.cloud.iot.v1.MqttConfig.getDefaultInstance()
        : mqttConfig_;
  }
  /**
   *
   *
   * <pre>
   * The MQTT configuration for this device registry.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.MqttConfigOrBuilder getMqttConfigOrBuilder() {
    return getMqttConfig();
  }

  public static final int HTTP_CONFIG_FIELD_NUMBER = 9;
  private com.google.cloud.iot.v1.HttpConfig httpConfig_;
  /**
   *
   *
   * <pre>
   * The DeviceService (HTTP) configuration for this device registry.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
   *
   * @return Whether the httpConfig field is set.
   */
  @java.lang.Override
  public boolean hasHttpConfig() {
    return httpConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * The DeviceService (HTTP) configuration for this device registry.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
   *
   * @return The httpConfig.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.HttpConfig getHttpConfig() {
    return httpConfig_ == null
        ? com.google.cloud.iot.v1.HttpConfig.getDefaultInstance()
        : httpConfig_;
  }
  /**
   *
   *
   * <pre>
   * The DeviceService (HTTP) configuration for this device registry.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.HttpConfigOrBuilder getHttpConfigOrBuilder() {
    return getHttpConfig();
  }

  public static final int LOG_LEVEL_FIELD_NUMBER = 11;
  private int logLevel_;
  /**
   *
   *
   * <pre>
   * **Beta Feature**
   * The default logging verbosity for activity from devices in this registry.
   * The verbosity level can be overridden by Device.log_level.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.LogLevel log_level = 11;</code>
   *
   * @return The enum numeric value on the wire for logLevel.
   */
  @java.lang.Override
  public int getLogLevelValue() {
    return logLevel_;
  }
  /**
   *
   *
   * <pre>
   * **Beta Feature**
   * The default logging verbosity for activity from devices in this registry.
   * The verbosity level can be overridden by Device.log_level.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.LogLevel log_level = 11;</code>
   *
   * @return The logLevel.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.LogLevel getLogLevel() {
    @SuppressWarnings("deprecation")
    com.google.cloud.iot.v1.LogLevel result = com.google.cloud.iot.v1.LogLevel.valueOf(logLevel_);
    return result == null ? com.google.cloud.iot.v1.LogLevel.UNRECOGNIZED : result;
  }

  public static final int CREDENTIALS_FIELD_NUMBER = 8;
  private java.util.List<com.google.cloud.iot.v1.RegistryCredential> credentials_;
  /**
   *
   *
   * <pre>
   * The credentials used to verify the device credentials. No more than 10
   * credentials can be bound to a single registry at a time. The verification
   * process occurs at the time of device creation or update. If this field is
   * empty, no verification is performed. Otherwise, the credentials of a newly
   * created device or added credentials of an updated device should be signed
   * with one of these registry credentials.
   * Note, however, that existing devices will never be affected by
   * modifications to this list of credentials: after a device has been
   * successfully created in a registry, it should be able to connect even if
   * its registry credentials are revoked, deleted, or modified.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.iot.v1.RegistryCredential> getCredentialsList() {
    return credentials_;
  }
  /**
   *
   *
   * <pre>
   * The credentials used to verify the device credentials. No more than 10
   * credentials can be bound to a single registry at a time. The verification
   * process occurs at the time of device creation or update. If this field is
   * empty, no verification is performed. Otherwise, the credentials of a newly
   * created device or added credentials of an updated device should be signed
   * with one of these registry credentials.
   * Note, however, that existing devices will never be affected by
   * modifications to this list of credentials: after a device has been
   * successfully created in a registry, it should be able to connect even if
   * its registry credentials are revoked, deleted, or modified.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.iot.v1.RegistryCredentialOrBuilder>
      getCredentialsOrBuilderList() {
    return credentials_;
  }
  /**
   *
   *
   * <pre>
   * The credentials used to verify the device credentials. No more than 10
   * credentials can be bound to a single registry at a time. The verification
   * process occurs at the time of device creation or update. If this field is
   * empty, no verification is performed. Otherwise, the credentials of a newly
   * created device or added credentials of an updated device should be signed
   * with one of these registry credentials.
   * Note, however, that existing devices will never be affected by
   * modifications to this list of credentials: after a device has been
   * successfully created in a registry, it should be able to connect even if
   * its registry credentials are revoked, deleted, or modified.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
   */
  @java.lang.Override
  public int getCredentialsCount() {
    return credentials_.size();
  }
  /**
   *
   *
   * <pre>
   * The credentials used to verify the device credentials. No more than 10
   * credentials can be bound to a single registry at a time. The verification
   * process occurs at the time of device creation or update. If this field is
   * empty, no verification is performed. Otherwise, the credentials of a newly
   * created device or added credentials of an updated device should be signed
   * with one of these registry credentials.
   * Note, however, that existing devices will never be affected by
   * modifications to this list of credentials: after a device has been
   * successfully created in a registry, it should be able to connect even if
   * its registry credentials are revoked, deleted, or modified.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.RegistryCredential getCredentials(int index) {
    return credentials_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The credentials used to verify the device credentials. No more than 10
   * credentials can be bound to a single registry at a time. The verification
   * process occurs at the time of device creation or update. If this field is
   * empty, no verification is performed. Otherwise, the credentials of a newly
   * created device or added credentials of an updated device should be signed
   * with one of these registry credentials.
   * Note, however, that existing devices will never be affected by
   * modifications to this list of credentials: after a device has been
   * successfully created in a registry, it should be able to connect even if
   * its registry credentials are revoked, deleted, or modified.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.RegistryCredentialOrBuilder getCredentialsOrBuilder(int index) {
    return credentials_.get(index);
  }

  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(id_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_);
    }
    if (mqttConfig_ != null) {
      output.writeMessage(4, getMqttConfig());
    }
    if (stateNotificationConfig_ != null) {
      output.writeMessage(7, getStateNotificationConfig());
    }
    for (int i = 0; i < credentials_.size(); i++) {
      output.writeMessage(8, credentials_.get(i));
    }
    if (httpConfig_ != null) {
      output.writeMessage(9, getHttpConfig());
    }
    for (int i = 0; i < eventNotificationConfigs_.size(); i++) {
      output.writeMessage(10, eventNotificationConfigs_.get(i));
    }
    if (logLevel_ != com.google.cloud.iot.v1.LogLevel.LOG_LEVEL_UNSPECIFIED.getNumber()) {
      output.writeEnum(11, logLevel_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_);
    }
    if (mqttConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getMqttConfig());
    }
    if (stateNotificationConfig_ != null) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(7, getStateNotificationConfig());
    }
    for (int i = 0; i < credentials_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, credentials_.get(i));
    }
    if (httpConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getHttpConfig());
    }
    for (int i = 0; i < eventNotificationConfigs_.size(); i++) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              10, eventNotificationConfigs_.get(i));
    }
    if (logLevel_ != com.google.cloud.iot.v1.LogLevel.LOG_LEVEL_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, logLevel_);
    }
    size += unknownFields.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.DeviceRegistry)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.DeviceRegistry other = (com.google.cloud.iot.v1.DeviceRegistry) obj;

    if (!getId().equals(other.getId())) return false;
    if (!getName().equals(other.getName())) return false;
    if (!getEventNotificationConfigsList().equals(other.getEventNotificationConfigsList()))
      return false;
    if (hasStateNotificationConfig() != other.hasStateNotificationConfig()) return false;
    if (hasStateNotificationConfig()) {
      if (!getStateNotificationConfig().equals(other.getStateNotificationConfig())) return false;
    }
    if (hasMqttConfig() != other.hasMqttConfig()) return false;
    if (hasMqttConfig()) {
      if (!getMqttConfig().equals(other.getMqttConfig())) return false;
    }
    if (hasHttpConfig() != other.hasHttpConfig()) return false;
    if (hasHttpConfig()) {
      if (!getHttpConfig().equals(other.getHttpConfig())) return false;
    }
    if (logLevel_ != other.logLevel_) return false;
    if (!getCredentialsList().equals(other.getCredentialsList())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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) + ID_FIELD_NUMBER;
    hash = (53 * hash) + getId().hashCode();
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    if (getEventNotificationConfigsCount() > 0) {
      hash = (37 * hash) + EVENT_NOTIFICATION_CONFIGS_FIELD_NUMBER;
      hash = (53 * hash) + getEventNotificationConfigsList().hashCode();
    }
    if (hasStateNotificationConfig()) {
      hash = (37 * hash) + STATE_NOTIFICATION_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getStateNotificationConfig().hashCode();
    }
    if (hasMqttConfig()) {
      hash = (37 * hash) + MQTT_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getMqttConfig().hashCode();
    }
    if (hasHttpConfig()) {
      hash = (37 * hash) + HTTP_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getHttpConfig().hashCode();
    }
    hash = (37 * hash) + LOG_LEVEL_FIELD_NUMBER;
    hash = (53 * hash) + logLevel_;
    if (getCredentialsCount() > 0) {
      hash = (37 * hash) + CREDENTIALS_FIELD_NUMBER;
      hash = (53 * hash) + getCredentialsList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.DeviceRegistry 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.DeviceRegistry 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.DeviceRegistry 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.DeviceRegistry 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>
   * A container for a group of devices.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.DeviceRegistry}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.DeviceRegistry)
      com.google.cloud.iot.v1.DeviceRegistryOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.ResourcesProto
          .internal_static_google_cloud_iot_v1_DeviceRegistry_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
        getEventNotificationConfigsFieldBuilder();
        getCredentialsFieldBuilder();
      }
    }

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

      name_ = "";

      if (eventNotificationConfigsBuilder_ == null) {
        eventNotificationConfigs_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        eventNotificationConfigsBuilder_.clear();
      }
      if (stateNotificationConfigBuilder_ == null) {
        stateNotificationConfig_ = null;
      } else {
        stateNotificationConfig_ = null;
        stateNotificationConfigBuilder_ = null;
      }
      if (mqttConfigBuilder_ == null) {
        mqttConfig_ = null;
      } else {
        mqttConfig_ = null;
        mqttConfigBuilder_ = null;
      }
      if (httpConfigBuilder_ == null) {
        httpConfig_ = null;
      } else {
        httpConfig_ = null;
        httpConfigBuilder_ = null;
      }
      logLevel_ = 0;

      if (credentialsBuilder_ == null) {
        credentials_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
      } else {
        credentialsBuilder_.clear();
      }
      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_DeviceRegistry_descriptor;
    }

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.DeviceRegistry buildPartial() {
      com.google.cloud.iot.v1.DeviceRegistry result =
          new com.google.cloud.iot.v1.DeviceRegistry(this);
      int from_bitField0_ = bitField0_;
      result.id_ = id_;
      result.name_ = name_;
      if (eventNotificationConfigsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          eventNotificationConfigs_ =
              java.util.Collections.unmodifiableList(eventNotificationConfigs_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.eventNotificationConfigs_ = eventNotificationConfigs_;
      } else {
        result.eventNotificationConfigs_ = eventNotificationConfigsBuilder_.build();
      }
      if (stateNotificationConfigBuilder_ == null) {
        result.stateNotificationConfig_ = stateNotificationConfig_;
      } else {
        result.stateNotificationConfig_ = stateNotificationConfigBuilder_.build();
      }
      if (mqttConfigBuilder_ == null) {
        result.mqttConfig_ = mqttConfig_;
      } else {
        result.mqttConfig_ = mqttConfigBuilder_.build();
      }
      if (httpConfigBuilder_ == null) {
        result.httpConfig_ = httpConfig_;
      } else {
        result.httpConfig_ = httpConfigBuilder_.build();
      }
      result.logLevel_ = logLevel_;
      if (credentialsBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)) {
          credentials_ = java.util.Collections.unmodifiableList(credentials_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.credentials_ = credentials_;
      } else {
        result.credentials_ = credentialsBuilder_.build();
      }
      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.cloud.iot.v1.DeviceRegistry) {
        return mergeFrom((com.google.cloud.iot.v1.DeviceRegistry) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.DeviceRegistry other) {
      if (other == com.google.cloud.iot.v1.DeviceRegistry.getDefaultInstance()) return this;
      if (!other.getId().isEmpty()) {
        id_ = other.id_;
        onChanged();
      }
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (eventNotificationConfigsBuilder_ == null) {
        if (!other.eventNotificationConfigs_.isEmpty()) {
          if (eventNotificationConfigs_.isEmpty()) {
            eventNotificationConfigs_ = other.eventNotificationConfigs_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureEventNotificationConfigsIsMutable();
            eventNotificationConfigs_.addAll(other.eventNotificationConfigs_);
          }
          onChanged();
        }
      } else {
        if (!other.eventNotificationConfigs_.isEmpty()) {
          if (eventNotificationConfigsBuilder_.isEmpty()) {
            eventNotificationConfigsBuilder_.dispose();
            eventNotificationConfigsBuilder_ = null;
            eventNotificationConfigs_ = other.eventNotificationConfigs_;
            bitField0_ = (bitField0_ & ~0x00000001);
            eventNotificationConfigsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getEventNotificationConfigsFieldBuilder()
                    : null;
          } else {
            eventNotificationConfigsBuilder_.addAllMessages(other.eventNotificationConfigs_);
          }
        }
      }
      if (other.hasStateNotificationConfig()) {
        mergeStateNotificationConfig(other.getStateNotificationConfig());
      }
      if (other.hasMqttConfig()) {
        mergeMqttConfig(other.getMqttConfig());
      }
      if (other.hasHttpConfig()) {
        mergeHttpConfig(other.getHttpConfig());
      }
      if (other.logLevel_ != 0) {
        setLogLevelValue(other.getLogLevelValue());
      }
      if (credentialsBuilder_ == null) {
        if (!other.credentials_.isEmpty()) {
          if (credentials_.isEmpty()) {
            credentials_ = other.credentials_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureCredentialsIsMutable();
            credentials_.addAll(other.credentials_);
          }
          onChanged();
        }
      } else {
        if (!other.credentials_.isEmpty()) {
          if (credentialsBuilder_.isEmpty()) {
            credentialsBuilder_.dispose();
            credentialsBuilder_ = null;
            credentials_ = other.credentials_;
            bitField0_ = (bitField0_ & ~0x00000002);
            credentialsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getCredentialsFieldBuilder()
                    : null;
          } else {
            credentialsBuilder_.addAllMessages(other.credentials_);
          }
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.DeviceRegistry parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.DeviceRegistry) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.lang.Object id_ = "";
    /**
     *
     *
     * <pre>
     * The identifier of this device registry. For example, `myRegistry`.
     * </pre>
     *
     * <code>string id = 1;</code>
     *
     * @return The id.
     */
    public java.lang.String getId() {
      java.lang.Object ref = id_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        id_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The identifier of this device registry. For example, `myRegistry`.
     * </pre>
     *
     * <code>string id = 1;</code>
     *
     * @return The bytes for id.
     */
    public com.google.protobuf.ByteString getIdBytes() {
      java.lang.Object ref = id_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        id_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The identifier of this device registry. For example, `myRegistry`.
     * </pre>
     *
     * <code>string id = 1;</code>
     *
     * @param value The id to set.
     * @return This builder for chaining.
     */
    public Builder setId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      id_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The identifier of this device registry. For example, `myRegistry`.
     * </pre>
     *
     * <code>string id = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearId() {

      id_ = getDefaultInstance().getId();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The identifier of this device registry. For example, `myRegistry`.
     * </pre>
     *
     * <code>string id = 1;</code>
     *
     * @param value The bytes for id to set.
     * @return This builder for chaining.
     */
    public Builder setIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * The resource path name. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>string name = 2;</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>
     * The resource path name. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>string name = 2;</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>
     * The resource path name. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>string name = 2;</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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource path name. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource path name. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>string name = 2;</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;
      onChanged();
      return this;
    }

    private java.util.List<com.google.cloud.iot.v1.EventNotificationConfig>
        eventNotificationConfigs_ = java.util.Collections.emptyList();

    private void ensureEventNotificationConfigsIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        eventNotificationConfigs_ =
            new java.util.ArrayList<com.google.cloud.iot.v1.EventNotificationConfig>(
                eventNotificationConfigs_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.EventNotificationConfig,
            com.google.cloud.iot.v1.EventNotificationConfig.Builder,
            com.google.cloud.iot.v1.EventNotificationConfigOrBuilder>
        eventNotificationConfigsBuilder_;

    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public java.util.List<com.google.cloud.iot.v1.EventNotificationConfig>
        getEventNotificationConfigsList() {
      if (eventNotificationConfigsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(eventNotificationConfigs_);
      } else {
        return eventNotificationConfigsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public int getEventNotificationConfigsCount() {
      if (eventNotificationConfigsBuilder_ == null) {
        return eventNotificationConfigs_.size();
      } else {
        return eventNotificationConfigsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public com.google.cloud.iot.v1.EventNotificationConfig getEventNotificationConfigs(int index) {
      if (eventNotificationConfigsBuilder_ == null) {
        return eventNotificationConfigs_.get(index);
      } else {
        return eventNotificationConfigsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public Builder setEventNotificationConfigs(
        int index, com.google.cloud.iot.v1.EventNotificationConfig value) {
      if (eventNotificationConfigsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureEventNotificationConfigsIsMutable();
        eventNotificationConfigs_.set(index, value);
        onChanged();
      } else {
        eventNotificationConfigsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public Builder setEventNotificationConfigs(
        int index, com.google.cloud.iot.v1.EventNotificationConfig.Builder builderForValue) {
      if (eventNotificationConfigsBuilder_ == null) {
        ensureEventNotificationConfigsIsMutable();
        eventNotificationConfigs_.set(index, builderForValue.build());
        onChanged();
      } else {
        eventNotificationConfigsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public Builder addEventNotificationConfigs(
        com.google.cloud.iot.v1.EventNotificationConfig value) {
      if (eventNotificationConfigsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureEventNotificationConfigsIsMutable();
        eventNotificationConfigs_.add(value);
        onChanged();
      } else {
        eventNotificationConfigsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public Builder addEventNotificationConfigs(
        int index, com.google.cloud.iot.v1.EventNotificationConfig value) {
      if (eventNotificationConfigsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureEventNotificationConfigsIsMutable();
        eventNotificationConfigs_.add(index, value);
        onChanged();
      } else {
        eventNotificationConfigsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public Builder addEventNotificationConfigs(
        com.google.cloud.iot.v1.EventNotificationConfig.Builder builderForValue) {
      if (eventNotificationConfigsBuilder_ == null) {
        ensureEventNotificationConfigsIsMutable();
        eventNotificationConfigs_.add(builderForValue.build());
        onChanged();
      } else {
        eventNotificationConfigsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public Builder addEventNotificationConfigs(
        int index, com.google.cloud.iot.v1.EventNotificationConfig.Builder builderForValue) {
      if (eventNotificationConfigsBuilder_ == null) {
        ensureEventNotificationConfigsIsMutable();
        eventNotificationConfigs_.add(index, builderForValue.build());
        onChanged();
      } else {
        eventNotificationConfigsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public Builder addAllEventNotificationConfigs(
        java.lang.Iterable<? extends com.google.cloud.iot.v1.EventNotificationConfig> values) {
      if (eventNotificationConfigsBuilder_ == null) {
        ensureEventNotificationConfigsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, eventNotificationConfigs_);
        onChanged();
      } else {
        eventNotificationConfigsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public Builder clearEventNotificationConfigs() {
      if (eventNotificationConfigsBuilder_ == null) {
        eventNotificationConfigs_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        eventNotificationConfigsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public Builder removeEventNotificationConfigs(int index) {
      if (eventNotificationConfigsBuilder_ == null) {
        ensureEventNotificationConfigsIsMutable();
        eventNotificationConfigs_.remove(index);
        onChanged();
      } else {
        eventNotificationConfigsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public com.google.cloud.iot.v1.EventNotificationConfig.Builder
        getEventNotificationConfigsBuilder(int index) {
      return getEventNotificationConfigsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public com.google.cloud.iot.v1.EventNotificationConfigOrBuilder
        getEventNotificationConfigsOrBuilder(int index) {
      if (eventNotificationConfigsBuilder_ == null) {
        return eventNotificationConfigs_.get(index);
      } else {
        return eventNotificationConfigsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public java.util.List<? extends com.google.cloud.iot.v1.EventNotificationConfigOrBuilder>
        getEventNotificationConfigsOrBuilderList() {
      if (eventNotificationConfigsBuilder_ != null) {
        return eventNotificationConfigsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(eventNotificationConfigs_);
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public com.google.cloud.iot.v1.EventNotificationConfig.Builder
        addEventNotificationConfigsBuilder() {
      return getEventNotificationConfigsFieldBuilder()
          .addBuilder(com.google.cloud.iot.v1.EventNotificationConfig.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public com.google.cloud.iot.v1.EventNotificationConfig.Builder
        addEventNotificationConfigsBuilder(int index) {
      return getEventNotificationConfigsFieldBuilder()
          .addBuilder(index, com.google.cloud.iot.v1.EventNotificationConfig.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;
     * </code>
     */
    public java.util.List<com.google.cloud.iot.v1.EventNotificationConfig.Builder>
        getEventNotificationConfigsBuilderList() {
      return getEventNotificationConfigsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.EventNotificationConfig,
            com.google.cloud.iot.v1.EventNotificationConfig.Builder,
            com.google.cloud.iot.v1.EventNotificationConfigOrBuilder>
        getEventNotificationConfigsFieldBuilder() {
      if (eventNotificationConfigsBuilder_ == null) {
        eventNotificationConfigsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.iot.v1.EventNotificationConfig,
                com.google.cloud.iot.v1.EventNotificationConfig.Builder,
                com.google.cloud.iot.v1.EventNotificationConfigOrBuilder>(
                eventNotificationConfigs_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        eventNotificationConfigs_ = null;
      }
      return eventNotificationConfigsBuilder_;
    }

    private com.google.cloud.iot.v1.StateNotificationConfig stateNotificationConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.StateNotificationConfig,
            com.google.cloud.iot.v1.StateNotificationConfig.Builder,
            com.google.cloud.iot.v1.StateNotificationConfigOrBuilder>
        stateNotificationConfigBuilder_;
    /**
     *
     *
     * <pre>
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     *
     * @return Whether the stateNotificationConfig field is set.
     */
    public boolean hasStateNotificationConfig() {
      return stateNotificationConfigBuilder_ != null || stateNotificationConfig_ != null;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     *
     * @return The stateNotificationConfig.
     */
    public com.google.cloud.iot.v1.StateNotificationConfig getStateNotificationConfig() {
      if (stateNotificationConfigBuilder_ == null) {
        return stateNotificationConfig_ == null
            ? com.google.cloud.iot.v1.StateNotificationConfig.getDefaultInstance()
            : stateNotificationConfig_;
      } else {
        return stateNotificationConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     */
    public Builder setStateNotificationConfig(
        com.google.cloud.iot.v1.StateNotificationConfig value) {
      if (stateNotificationConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        stateNotificationConfig_ = value;
        onChanged();
      } else {
        stateNotificationConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     */
    public Builder setStateNotificationConfig(
        com.google.cloud.iot.v1.StateNotificationConfig.Builder builderForValue) {
      if (stateNotificationConfigBuilder_ == null) {
        stateNotificationConfig_ = builderForValue.build();
        onChanged();
      } else {
        stateNotificationConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     */
    public Builder mergeStateNotificationConfig(
        com.google.cloud.iot.v1.StateNotificationConfig value) {
      if (stateNotificationConfigBuilder_ == null) {
        if (stateNotificationConfig_ != null) {
          stateNotificationConfig_ =
              com.google.cloud.iot.v1.StateNotificationConfig.newBuilder(stateNotificationConfig_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          stateNotificationConfig_ = value;
        }
        onChanged();
      } else {
        stateNotificationConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     */
    public Builder clearStateNotificationConfig() {
      if (stateNotificationConfigBuilder_ == null) {
        stateNotificationConfig_ = null;
        onChanged();
      } else {
        stateNotificationConfig_ = null;
        stateNotificationConfigBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     */
    public com.google.cloud.iot.v1.StateNotificationConfig.Builder
        getStateNotificationConfigBuilder() {

      onChanged();
      return getStateNotificationConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     */
    public com.google.cloud.iot.v1.StateNotificationConfigOrBuilder
        getStateNotificationConfigOrBuilder() {
      if (stateNotificationConfigBuilder_ != null) {
        return stateNotificationConfigBuilder_.getMessageOrBuilder();
      } else {
        return stateNotificationConfig_ == null
            ? com.google.cloud.iot.v1.StateNotificationConfig.getDefaultInstance()
            : stateNotificationConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.StateNotificationConfig,
            com.google.cloud.iot.v1.StateNotificationConfig.Builder,
            com.google.cloud.iot.v1.StateNotificationConfigOrBuilder>
        getStateNotificationConfigFieldBuilder() {
      if (stateNotificationConfigBuilder_ == null) {
        stateNotificationConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.iot.v1.StateNotificationConfig,
                com.google.cloud.iot.v1.StateNotificationConfig.Builder,
                com.google.cloud.iot.v1.StateNotificationConfigOrBuilder>(
                getStateNotificationConfig(), getParentForChildren(), isClean());
        stateNotificationConfig_ = null;
      }
      return stateNotificationConfigBuilder_;
    }

    private com.google.cloud.iot.v1.MqttConfig mqttConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.MqttConfig,
            com.google.cloud.iot.v1.MqttConfig.Builder,
            com.google.cloud.iot.v1.MqttConfigOrBuilder>
        mqttConfigBuilder_;
    /**
     *
     *
     * <pre>
     * The MQTT configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     *
     * @return Whether the mqttConfig field is set.
     */
    public boolean hasMqttConfig() {
      return mqttConfigBuilder_ != null || mqttConfig_ != null;
    }
    /**
     *
     *
     * <pre>
     * The MQTT configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     *
     * @return The mqttConfig.
     */
    public com.google.cloud.iot.v1.MqttConfig getMqttConfig() {
      if (mqttConfigBuilder_ == null) {
        return mqttConfig_ == null
            ? com.google.cloud.iot.v1.MqttConfig.getDefaultInstance()
            : mqttConfig_;
      } else {
        return mqttConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The MQTT configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     */
    public Builder setMqttConfig(com.google.cloud.iot.v1.MqttConfig value) {
      if (mqttConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        mqttConfig_ = value;
        onChanged();
      } else {
        mqttConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The MQTT configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     */
    public Builder setMqttConfig(com.google.cloud.iot.v1.MqttConfig.Builder builderForValue) {
      if (mqttConfigBuilder_ == null) {
        mqttConfig_ = builderForValue.build();
        onChanged();
      } else {
        mqttConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The MQTT configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     */
    public Builder mergeMqttConfig(com.google.cloud.iot.v1.MqttConfig value) {
      if (mqttConfigBuilder_ == null) {
        if (mqttConfig_ != null) {
          mqttConfig_ =
              com.google.cloud.iot.v1.MqttConfig.newBuilder(mqttConfig_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          mqttConfig_ = value;
        }
        onChanged();
      } else {
        mqttConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The MQTT configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     */
    public Builder clearMqttConfig() {
      if (mqttConfigBuilder_ == null) {
        mqttConfig_ = null;
        onChanged();
      } else {
        mqttConfig_ = null;
        mqttConfigBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The MQTT configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     */
    public com.google.cloud.iot.v1.MqttConfig.Builder getMqttConfigBuilder() {

      onChanged();
      return getMqttConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The MQTT configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     */
    public com.google.cloud.iot.v1.MqttConfigOrBuilder getMqttConfigOrBuilder() {
      if (mqttConfigBuilder_ != null) {
        return mqttConfigBuilder_.getMessageOrBuilder();
      } else {
        return mqttConfig_ == null
            ? com.google.cloud.iot.v1.MqttConfig.getDefaultInstance()
            : mqttConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * The MQTT configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.MqttConfig,
            com.google.cloud.iot.v1.MqttConfig.Builder,
            com.google.cloud.iot.v1.MqttConfigOrBuilder>
        getMqttConfigFieldBuilder() {
      if (mqttConfigBuilder_ == null) {
        mqttConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.iot.v1.MqttConfig,
                com.google.cloud.iot.v1.MqttConfig.Builder,
                com.google.cloud.iot.v1.MqttConfigOrBuilder>(
                getMqttConfig(), getParentForChildren(), isClean());
        mqttConfig_ = null;
      }
      return mqttConfigBuilder_;
    }

    private com.google.cloud.iot.v1.HttpConfig httpConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.HttpConfig,
            com.google.cloud.iot.v1.HttpConfig.Builder,
            com.google.cloud.iot.v1.HttpConfigOrBuilder>
        httpConfigBuilder_;
    /**
     *
     *
     * <pre>
     * The DeviceService (HTTP) configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     *
     * @return Whether the httpConfig field is set.
     */
    public boolean hasHttpConfig() {
      return httpConfigBuilder_ != null || httpConfig_ != null;
    }
    /**
     *
     *
     * <pre>
     * The DeviceService (HTTP) configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     *
     * @return The httpConfig.
     */
    public com.google.cloud.iot.v1.HttpConfig getHttpConfig() {
      if (httpConfigBuilder_ == null) {
        return httpConfig_ == null
            ? com.google.cloud.iot.v1.HttpConfig.getDefaultInstance()
            : httpConfig_;
      } else {
        return httpConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The DeviceService (HTTP) configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     */
    public Builder setHttpConfig(com.google.cloud.iot.v1.HttpConfig value) {
      if (httpConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        httpConfig_ = value;
        onChanged();
      } else {
        httpConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The DeviceService (HTTP) configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     */
    public Builder setHttpConfig(com.google.cloud.iot.v1.HttpConfig.Builder builderForValue) {
      if (httpConfigBuilder_ == null) {
        httpConfig_ = builderForValue.build();
        onChanged();
      } else {
        httpConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The DeviceService (HTTP) configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     */
    public Builder mergeHttpConfig(com.google.cloud.iot.v1.HttpConfig value) {
      if (httpConfigBuilder_ == null) {
        if (httpConfig_ != null) {
          httpConfig_ =
              com.google.cloud.iot.v1.HttpConfig.newBuilder(httpConfig_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          httpConfig_ = value;
        }
        onChanged();
      } else {
        httpConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The DeviceService (HTTP) configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     */
    public Builder clearHttpConfig() {
      if (httpConfigBuilder_ == null) {
        httpConfig_ = null;
        onChanged();
      } else {
        httpConfig_ = null;
        httpConfigBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The DeviceService (HTTP) configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     */
    public com.google.cloud.iot.v1.HttpConfig.Builder getHttpConfigBuilder() {

      onChanged();
      return getHttpConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The DeviceService (HTTP) configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     */
    public com.google.cloud.iot.v1.HttpConfigOrBuilder getHttpConfigOrBuilder() {
      if (httpConfigBuilder_ != null) {
        return httpConfigBuilder_.getMessageOrBuilder();
      } else {
        return httpConfig_ == null
            ? com.google.cloud.iot.v1.HttpConfig.getDefaultInstance()
            : httpConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * The DeviceService (HTTP) configuration for this device registry.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.HttpConfig,
            com.google.cloud.iot.v1.HttpConfig.Builder,
            com.google.cloud.iot.v1.HttpConfigOrBuilder>
        getHttpConfigFieldBuilder() {
      if (httpConfigBuilder_ == null) {
        httpConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.iot.v1.HttpConfig,
                com.google.cloud.iot.v1.HttpConfig.Builder,
                com.google.cloud.iot.v1.HttpConfigOrBuilder>(
                getHttpConfig(), getParentForChildren(), isClean());
        httpConfig_ = null;
      }
      return httpConfigBuilder_;
    }

    private int logLevel_ = 0;
    /**
     *
     *
     * <pre>
     * **Beta Feature**
     * The default logging verbosity for activity from devices in this registry.
     * The verbosity level can be overridden by Device.log_level.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.LogLevel log_level = 11;</code>
     *
     * @return The enum numeric value on the wire for logLevel.
     */
    @java.lang.Override
    public int getLogLevelValue() {
      return logLevel_;
    }
    /**
     *
     *
     * <pre>
     * **Beta Feature**
     * The default logging verbosity for activity from devices in this registry.
     * The verbosity level can be overridden by Device.log_level.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.LogLevel log_level = 11;</code>
     *
     * @param value The enum numeric value on the wire for logLevel to set.
     * @return This builder for chaining.
     */
    public Builder setLogLevelValue(int value) {

      logLevel_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * **Beta Feature**
     * The default logging verbosity for activity from devices in this registry.
     * The verbosity level can be overridden by Device.log_level.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.LogLevel log_level = 11;</code>
     *
     * @return The logLevel.
     */
    @java.lang.Override
    public com.google.cloud.iot.v1.LogLevel getLogLevel() {
      @SuppressWarnings("deprecation")
      com.google.cloud.iot.v1.LogLevel result = com.google.cloud.iot.v1.LogLevel.valueOf(logLevel_);
      return result == null ? com.google.cloud.iot.v1.LogLevel.UNRECOGNIZED : result;
    }
    /**
     *
     *
     * <pre>
     * **Beta Feature**
     * The default logging verbosity for activity from devices in this registry.
     * The verbosity level can be overridden by Device.log_level.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.LogLevel log_level = 11;</code>
     *
     * @param value The logLevel to set.
     * @return This builder for chaining.
     */
    public Builder setLogLevel(com.google.cloud.iot.v1.LogLevel value) {
      if (value == null) {
        throw new NullPointerException();
      }

      logLevel_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * **Beta Feature**
     * The default logging verbosity for activity from devices in this registry.
     * The verbosity level can be overridden by Device.log_level.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.LogLevel log_level = 11;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearLogLevel() {

      logLevel_ = 0;
      onChanged();
      return this;
    }

    private java.util.List<com.google.cloud.iot.v1.RegistryCredential> credentials_ =
        java.util.Collections.emptyList();

    private void ensureCredentialsIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        credentials_ =
            new java.util.ArrayList<com.google.cloud.iot.v1.RegistryCredential>(credentials_);
        bitField0_ |= 0x00000002;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.RegistryCredential,
            com.google.cloud.iot.v1.RegistryCredential.Builder,
            com.google.cloud.iot.v1.RegistryCredentialOrBuilder>
        credentialsBuilder_;

    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.RegistryCredential> getCredentialsList() {
      if (credentialsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(credentials_);
      } else {
        return credentialsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public int getCredentialsCount() {
      if (credentialsBuilder_ == null) {
        return credentials_.size();
      } else {
        return credentialsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public com.google.cloud.iot.v1.RegistryCredential getCredentials(int index) {
      if (credentialsBuilder_ == null) {
        return credentials_.get(index);
      } else {
        return credentialsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public Builder setCredentials(int index, com.google.cloud.iot.v1.RegistryCredential value) {
      if (credentialsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCredentialsIsMutable();
        credentials_.set(index, value);
        onChanged();
      } else {
        credentialsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public Builder setCredentials(
        int index, com.google.cloud.iot.v1.RegistryCredential.Builder builderForValue) {
      if (credentialsBuilder_ == null) {
        ensureCredentialsIsMutable();
        credentials_.set(index, builderForValue.build());
        onChanged();
      } else {
        credentialsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public Builder addCredentials(com.google.cloud.iot.v1.RegistryCredential value) {
      if (credentialsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCredentialsIsMutable();
        credentials_.add(value);
        onChanged();
      } else {
        credentialsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public Builder addCredentials(int index, com.google.cloud.iot.v1.RegistryCredential value) {
      if (credentialsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCredentialsIsMutable();
        credentials_.add(index, value);
        onChanged();
      } else {
        credentialsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public Builder addCredentials(
        com.google.cloud.iot.v1.RegistryCredential.Builder builderForValue) {
      if (credentialsBuilder_ == null) {
        ensureCredentialsIsMutable();
        credentials_.add(builderForValue.build());
        onChanged();
      } else {
        credentialsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public Builder addCredentials(
        int index, com.google.cloud.iot.v1.RegistryCredential.Builder builderForValue) {
      if (credentialsBuilder_ == null) {
        ensureCredentialsIsMutable();
        credentials_.add(index, builderForValue.build());
        onChanged();
      } else {
        credentialsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public Builder addAllCredentials(
        java.lang.Iterable<? extends com.google.cloud.iot.v1.RegistryCredential> values) {
      if (credentialsBuilder_ == null) {
        ensureCredentialsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, credentials_);
        onChanged();
      } else {
        credentialsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public Builder clearCredentials() {
      if (credentialsBuilder_ == null) {
        credentials_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
      } else {
        credentialsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public Builder removeCredentials(int index) {
      if (credentialsBuilder_ == null) {
        ensureCredentialsIsMutable();
        credentials_.remove(index);
        onChanged();
      } else {
        credentialsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public com.google.cloud.iot.v1.RegistryCredential.Builder getCredentialsBuilder(int index) {
      return getCredentialsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public com.google.cloud.iot.v1.RegistryCredentialOrBuilder getCredentialsOrBuilder(int index) {
      if (credentialsBuilder_ == null) {
        return credentials_.get(index);
      } else {
        return credentialsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public java.util.List<? extends com.google.cloud.iot.v1.RegistryCredentialOrBuilder>
        getCredentialsOrBuilderList() {
      if (credentialsBuilder_ != null) {
        return credentialsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(credentials_);
      }
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public com.google.cloud.iot.v1.RegistryCredential.Builder addCredentialsBuilder() {
      return getCredentialsFieldBuilder()
          .addBuilder(com.google.cloud.iot.v1.RegistryCredential.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public com.google.cloud.iot.v1.RegistryCredential.Builder addCredentialsBuilder(int index) {
      return getCredentialsFieldBuilder()
          .addBuilder(index, com.google.cloud.iot.v1.RegistryCredential.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.RegistryCredential.Builder>
        getCredentialsBuilderList() {
      return getCredentialsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.RegistryCredential,
            com.google.cloud.iot.v1.RegistryCredential.Builder,
            com.google.cloud.iot.v1.RegistryCredentialOrBuilder>
        getCredentialsFieldBuilder() {
      if (credentialsBuilder_ == null) {
        credentialsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.iot.v1.RegistryCredential,
                com.google.cloud.iot.v1.RegistryCredential.Builder,
                com.google.cloud.iot.v1.RegistryCredentialOrBuilder>(
                credentials_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean());
        credentials_ = null;
      }
      return credentialsBuilder_;
    }

    @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.DeviceRegistry)
  }

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

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

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

  private static final com.google.protobuf.Parser<DeviceRegistry> PARSER =
      new com.google.protobuf.AbstractParser<DeviceRegistry>() {
        @java.lang.Override
        public DeviceRegistry parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new DeviceRegistry(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceRegistry getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class GetDeviceRegistryRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.GetDeviceRegistryRequest)
    GetDeviceRegistryRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use GetDeviceRegistryRequest.newBuilder() to construct.
  private GetDeviceRegistryRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private GetDeviceRegistryRequest() {
    name_ = "";
  }

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

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

  private GetDeviceRegistryRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_GetDeviceRegistryRequest_descriptor;
  }

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

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * Required. The name of the device registry. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 name of the device registry. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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;
    }
  }

  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(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    size += unknownFields.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.GetDeviceRegistryRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.GetDeviceRegistryRequest other =
        (com.google.cloud.iot.v1.GetDeviceRegistryRequest) obj;

    if (!getName().equals(other.getName())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.GetDeviceRegistryRequest 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.GetDeviceRegistryRequest 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.GetDeviceRegistryRequest 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.GetDeviceRegistryRequest 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>
   * Request for `GetDeviceRegistry`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.GetDeviceRegistryRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.GetDeviceRegistryRequest)
      com.google.cloud.iot.v1.GetDeviceRegistryRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_GetDeviceRegistryRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.GetDeviceRegistryRequest buildPartial() {
      com.google.cloud.iot.v1.GetDeviceRegistryRequest result =
          new com.google.cloud.iot.v1.GetDeviceRegistryRequest(this);
      result.name_ = name_;
      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.cloud.iot.v1.GetDeviceRegistryRequest) {
        return mergeFrom((com.google.cloud.iot.v1.GetDeviceRegistryRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.GetDeviceRegistryRequest other) {
      if (other == com.google.cloud.iot.v1.GetDeviceRegistryRequest.getDefaultInstance())
        return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.GetDeviceRegistryRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.GetDeviceRegistryRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the device registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      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.GetDeviceRegistryRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<GetDeviceRegistryRequest> PARSER =
      new com.google.protobuf.AbstractParser<GetDeviceRegistryRequest>() {
        @java.lang.Override
        public GetDeviceRegistryRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new GetDeviceRegistryRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.GetDeviceRegistryRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class GetDeviceRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.GetDeviceRequest)
    GetDeviceRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use GetDeviceRequest.newBuilder() to construct.
  private GetDeviceRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private GetDeviceRequest() {
    name_ = "";
  }

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

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

  private GetDeviceRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          case 18:
            {
              com.google.protobuf.FieldMask.Builder subBuilder = null;
              if (fieldMask_ != null) {
                subBuilder = fieldMask_.toBuilder();
              }
              fieldMask_ =
                  input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(fieldMask_);
                fieldMask_ = subBuilder.buildPartial();
              }

              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_GetDeviceRequest_descriptor;
  }

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

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * Required. The name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 FIELD_MASK_FIELD_NUMBER = 2;
  private com.google.protobuf.FieldMask fieldMask_;
  /**
   *
   *
   * <pre>
   * The fields of the `Device` resource to be returned in the response. If the
   * field mask is unset or empty, all fields are returned. Fields have to be
   * provided in snake_case format, for example: `last_heartbeat_time`.
   * </pre>
   *
   * <code>.google.protobuf.FieldMask field_mask = 2;</code>
   *
   * @return Whether the fieldMask field is set.
   */
  @java.lang.Override
  public boolean hasFieldMask() {
    return fieldMask_ != null;
  }
  /**
   *
   *
   * <pre>
   * The fields of the `Device` resource to be returned in the response. If the
   * field mask is unset or empty, all fields are returned. Fields have to be
   * provided in snake_case format, for example: `last_heartbeat_time`.
   * </pre>
   *
   * <code>.google.protobuf.FieldMask field_mask = 2;</code>
   *
   * @return The fieldMask.
   */
  @java.lang.Override
  public com.google.protobuf.FieldMask getFieldMask() {
    return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_;
  }
  /**
   *
   *
   * <pre>
   * The fields of the `Device` resource to be returned in the response. If the
   * field mask is unset or empty, all fields are returned. Fields have to be
   * provided in snake_case format, for example: `last_heartbeat_time`.
   * </pre>
   *
   * <code>.google.protobuf.FieldMask field_mask = 2;</code>
   */
  @java.lang.Override
  public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() {
    return getFieldMask();
  }

  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(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (fieldMask_ != null) {
      output.writeMessage(2, getFieldMask());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (fieldMask_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFieldMask());
    }
    size += unknownFields.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.GetDeviceRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.GetDeviceRequest other = (com.google.cloud.iot.v1.GetDeviceRequest) obj;

    if (!getName().equals(other.getName())) return false;
    if (hasFieldMask() != other.hasFieldMask()) return false;
    if (hasFieldMask()) {
      if (!getFieldMask().equals(other.getFieldMask())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) 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 (hasFieldMask()) {
      hash = (37 * hash) + FIELD_MASK_FIELD_NUMBER;
      hash = (53 * hash) + getFieldMask().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.GetDeviceRequest 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.GetDeviceRequest 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.GetDeviceRequest 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.GetDeviceRequest 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>
   * Request for `GetDevice`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.GetDeviceRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.GetDeviceRequest)
      com.google.cloud.iot.v1.GetDeviceRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_GetDeviceRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      if (fieldMaskBuilder_ == null) {
        fieldMask_ = null;
      } else {
        fieldMask_ = null;
        fieldMaskBuilder_ = null;
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.GetDeviceRequest buildPartial() {
      com.google.cloud.iot.v1.GetDeviceRequest result =
          new com.google.cloud.iot.v1.GetDeviceRequest(this);
      result.name_ = name_;
      if (fieldMaskBuilder_ == null) {
        result.fieldMask_ = fieldMask_;
      } else {
        result.fieldMask_ = fieldMaskBuilder_.build();
      }
      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.cloud.iot.v1.GetDeviceRequest) {
        return mergeFrom((com.google.cloud.iot.v1.GetDeviceRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.GetDeviceRequest other) {
      if (other == com.google.cloud.iot.v1.GetDeviceRequest.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.hasFieldMask()) {
        mergeFieldMask(other.getFieldMask());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.GetDeviceRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.GetDeviceRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }

    private com.google.protobuf.FieldMask fieldMask_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.FieldMask,
            com.google.protobuf.FieldMask.Builder,
            com.google.protobuf.FieldMaskOrBuilder>
        fieldMaskBuilder_;
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. If the
     * field mask is unset or empty, all fields are returned. Fields have to be
     * provided in snake_case format, for example: `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 2;</code>
     *
     * @return Whether the fieldMask field is set.
     */
    public boolean hasFieldMask() {
      return fieldMaskBuilder_ != null || fieldMask_ != null;
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. If the
     * field mask is unset or empty, all fields are returned. Fields have to be
     * provided in snake_case format, for example: `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 2;</code>
     *
     * @return The fieldMask.
     */
    public com.google.protobuf.FieldMask getFieldMask() {
      if (fieldMaskBuilder_ == null) {
        return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_;
      } else {
        return fieldMaskBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. If the
     * field mask is unset or empty, all fields are returned. Fields have to be
     * provided in snake_case format, for example: `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 2;</code>
     */
    public Builder setFieldMask(com.google.protobuf.FieldMask value) {
      if (fieldMaskBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        fieldMask_ = value;
        onChanged();
      } else {
        fieldMaskBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. If the
     * field mask is unset or empty, all fields are returned. Fields have to be
     * provided in snake_case format, for example: `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 2;</code>
     */
    public Builder setFieldMask(com.google.protobuf.FieldMask.Builder builderForValue) {
      if (fieldMaskBuilder_ == null) {
        fieldMask_ = builderForValue.build();
        onChanged();
      } else {
        fieldMaskBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. If the
     * field mask is unset or empty, all fields are returned. Fields have to be
     * provided in snake_case format, for example: `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 2;</code>
     */
    public Builder mergeFieldMask(com.google.protobuf.FieldMask value) {
      if (fieldMaskBuilder_ == null) {
        if (fieldMask_ != null) {
          fieldMask_ =
              com.google.protobuf.FieldMask.newBuilder(fieldMask_).mergeFrom(value).buildPartial();
        } else {
          fieldMask_ = value;
        }
        onChanged();
      } else {
        fieldMaskBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. If the
     * field mask is unset or empty, all fields are returned. Fields have to be
     * provided in snake_case format, for example: `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 2;</code>
     */
    public Builder clearFieldMask() {
      if (fieldMaskBuilder_ == null) {
        fieldMask_ = null;
        onChanged();
      } else {
        fieldMask_ = null;
        fieldMaskBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. If the
     * field mask is unset or empty, all fields are returned. Fields have to be
     * provided in snake_case format, for example: `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 2;</code>
     */
    public com.google.protobuf.FieldMask.Builder getFieldMaskBuilder() {

      onChanged();
      return getFieldMaskFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. If the
     * field mask is unset or empty, all fields are returned. Fields have to be
     * provided in snake_case format, for example: `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 2;</code>
     */
    public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() {
      if (fieldMaskBuilder_ != null) {
        return fieldMaskBuilder_.getMessageOrBuilder();
      } else {
        return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_;
      }
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. If the
     * field mask is unset or empty, all fields are returned. Fields have to be
     * provided in snake_case format, for example: `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.FieldMask,
            com.google.protobuf.FieldMask.Builder,
            com.google.protobuf.FieldMaskOrBuilder>
        getFieldMaskFieldBuilder() {
      if (fieldMaskBuilder_ == null) {
        fieldMaskBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.FieldMask,
                com.google.protobuf.FieldMask.Builder,
                com.google.protobuf.FieldMaskOrBuilder>(
                getFieldMask(), getParentForChildren(), isClean());
        fieldMask_ = null;
      }
      return fieldMaskBuilder_;
    }

    @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.GetDeviceRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<GetDeviceRequest> PARSER =
      new com.google.protobuf.AbstractParser<GetDeviceRequest>() {
        @java.lang.Override
        public GetDeviceRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new GetDeviceRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.GetDeviceRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class ListDeviceConfigVersionsRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.ListDeviceConfigVersionsRequest)
    ListDeviceConfigVersionsRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ListDeviceConfigVersionsRequest.newBuilder() to construct.
  private ListDeviceConfigVersionsRequest(
      com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ListDeviceConfigVersionsRequest() {
    name_ = "";
  }

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

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

  private ListDeviceConfigVersionsRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          case 16:
            {
              numVersions_ = input.readInt32();
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_ListDeviceConfigVersionsRequest_descriptor;
  }

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

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * Required. The name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 NUM_VERSIONS_FIELD_NUMBER = 2;
  private int numVersions_;
  /**
   *
   *
   * <pre>
   * The number of versions to list. Versions are listed in decreasing order of
   * the version number. The maximum number of versions retained is 10. If this
   * value is zero, it will return all the versions available.
   * </pre>
   *
   * <code>int32 num_versions = 2;</code>
   *
   * @return The numVersions.
   */
  @java.lang.Override
  public int getNumVersions() {
    return numVersions_;
  }

  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(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (numVersions_ != 0) {
      output.writeInt32(2, numVersions_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (numVersions_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, numVersions_);
    }
    size += unknownFields.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.ListDeviceConfigVersionsRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest other =
        (com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest) obj;

    if (!getName().equals(other.getName())) return false;
    if (getNumVersions() != other.getNumVersions()) return false;
    if (!unknownFields.equals(other.unknownFields)) 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();
    hash = (37 * hash) + NUM_VERSIONS_FIELD_NUMBER;
    hash = (53 * hash) + getNumVersions();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest 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.ListDeviceConfigVersionsRequest 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.ListDeviceConfigVersionsRequest 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.ListDeviceConfigVersionsRequest 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>
   * Request for `ListDeviceConfigVersions`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.ListDeviceConfigVersionsRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.ListDeviceConfigVersionsRequest)
      com.google.cloud.iot.v1.ListDeviceConfigVersionsRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_ListDeviceConfigVersionsRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      numVersions_ = 0;

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest buildPartial() {
      com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest result =
          new com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest(this);
      result.name_ = name_;
      result.numVersions_ = numVersions_;
      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.cloud.iot.v1.ListDeviceConfigVersionsRequest) {
        return mergeFrom((com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest other) {
      if (other == com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest.getDefaultInstance())
        return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.getNumVersions() != 0) {
        setNumVersions(other.getNumVersions());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }

    private int numVersions_;
    /**
     *
     *
     * <pre>
     * The number of versions to list. Versions are listed in decreasing order of
     * the version number. The maximum number of versions retained is 10. If this
     * value is zero, it will return all the versions available.
     * </pre>
     *
     * <code>int32 num_versions = 2;</code>
     *
     * @return The numVersions.
     */
    @java.lang.Override
    public int getNumVersions() {
      return numVersions_;
    }
    /**
     *
     *
     * <pre>
     * The number of versions to list. Versions are listed in decreasing order of
     * the version number. The maximum number of versions retained is 10. If this
     * value is zero, it will return all the versions available.
     * </pre>
     *
     * <code>int32 num_versions = 2;</code>
     *
     * @param value The numVersions to set.
     * @return This builder for chaining.
     */
    public Builder setNumVersions(int value) {

      numVersions_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The number of versions to list. Versions are listed in decreasing order of
     * the version number. The maximum number of versions retained is 10. If this
     * value is zero, it will return all the versions available.
     * </pre>
     *
     * <code>int32 num_versions = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearNumVersions() {

      numVersions_ = 0;
      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.ListDeviceConfigVersionsRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<ListDeviceConfigVersionsRequest> PARSER =
      new com.google.protobuf.AbstractParser<ListDeviceConfigVersionsRequest>() {
        @java.lang.Override
        public ListDeviceConfigVersionsRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ListDeviceConfigVersionsRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class ListDeviceConfigVersionsResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.ListDeviceConfigVersionsResponse)
    ListDeviceConfigVersionsResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ListDeviceConfigVersionsResponse.newBuilder() to construct.
  private ListDeviceConfigVersionsResponse(
      com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ListDeviceConfigVersionsResponse() {
    deviceConfigs_ = java.util.Collections.emptyList();
  }

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

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

  private ListDeviceConfigVersionsResponse(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                deviceConfigs_ = new java.util.ArrayList<com.google.cloud.iot.v1.DeviceConfig>();
                mutable_bitField0_ |= 0x00000001;
              }
              deviceConfigs_.add(
                  input.readMessage(
                      com.google.cloud.iot.v1.DeviceConfig.parser(), extensionRegistry));
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        deviceConfigs_ = java.util.Collections.unmodifiableList(deviceConfigs_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_ListDeviceConfigVersionsResponse_descriptor;
  }

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

  public static final int DEVICE_CONFIGS_FIELD_NUMBER = 1;
  private java.util.List<com.google.cloud.iot.v1.DeviceConfig> deviceConfigs_;
  /**
   *
   *
   * <pre>
   * The device configuration for the last few versions. Versions are listed
   * in decreasing order, starting from the most recent one.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.iot.v1.DeviceConfig> getDeviceConfigsList() {
    return deviceConfigs_;
  }
  /**
   *
   *
   * <pre>
   * The device configuration for the last few versions. Versions are listed
   * in decreasing order, starting from the most recent one.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.iot.v1.DeviceConfigOrBuilder>
      getDeviceConfigsOrBuilderList() {
    return deviceConfigs_;
  }
  /**
   *
   *
   * <pre>
   * The device configuration for the last few versions. Versions are listed
   * in decreasing order, starting from the most recent one.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
   */
  @java.lang.Override
  public int getDeviceConfigsCount() {
    return deviceConfigs_.size();
  }
  /**
   *
   *
   * <pre>
   * The device configuration for the last few versions. Versions are listed
   * in decreasing order, starting from the most recent one.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceConfig getDeviceConfigs(int index) {
    return deviceConfigs_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The device configuration for the last few versions. Versions are listed
   * in decreasing order, starting from the most recent one.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceConfigOrBuilder getDeviceConfigsOrBuilder(int index) {
    return deviceConfigs_.get(index);
  }

  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 {
    for (int i = 0; i < deviceConfigs_.size(); i++) {
      output.writeMessage(1, deviceConfigs_.get(i));
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    for (int i = 0; i < deviceConfigs_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, deviceConfigs_.get(i));
    }
    size += unknownFields.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.ListDeviceConfigVersionsResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse other =
        (com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse) obj;

    if (!getDeviceConfigsList().equals(other.getDeviceConfigsList())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getDeviceConfigsCount() > 0) {
      hash = (37 * hash) + DEVICE_CONFIGS_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceConfigsList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse 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.ListDeviceConfigVersionsResponse 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.ListDeviceConfigVersionsResponse 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.ListDeviceConfigVersionsResponse 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>
   * Response for `ListDeviceConfigVersions`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.ListDeviceConfigVersionsResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.ListDeviceConfigVersionsResponse)
      com.google.cloud.iot.v1.ListDeviceConfigVersionsResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_ListDeviceConfigVersionsResponse_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
        getDeviceConfigsFieldBuilder();
      }
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (deviceConfigsBuilder_ == null) {
        deviceConfigs_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        deviceConfigsBuilder_.clear();
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse buildPartial() {
      com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse result =
          new com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse(this);
      int from_bitField0_ = bitField0_;
      if (deviceConfigsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          deviceConfigs_ = java.util.Collections.unmodifiableList(deviceConfigs_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.deviceConfigs_ = deviceConfigs_;
      } else {
        result.deviceConfigs_ = deviceConfigsBuilder_.build();
      }
      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.cloud.iot.v1.ListDeviceConfigVersionsResponse) {
        return mergeFrom((com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse other) {
      if (other == com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse.getDefaultInstance())
        return this;
      if (deviceConfigsBuilder_ == null) {
        if (!other.deviceConfigs_.isEmpty()) {
          if (deviceConfigs_.isEmpty()) {
            deviceConfigs_ = other.deviceConfigs_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureDeviceConfigsIsMutable();
            deviceConfigs_.addAll(other.deviceConfigs_);
          }
          onChanged();
        }
      } else {
        if (!other.deviceConfigs_.isEmpty()) {
          if (deviceConfigsBuilder_.isEmpty()) {
            deviceConfigsBuilder_.dispose();
            deviceConfigsBuilder_ = null;
            deviceConfigs_ = other.deviceConfigs_;
            bitField0_ = (bitField0_ & ~0x00000001);
            deviceConfigsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getDeviceConfigsFieldBuilder()
                    : null;
          } else {
            deviceConfigsBuilder_.addAllMessages(other.deviceConfigs_);
          }
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.util.List<com.google.cloud.iot.v1.DeviceConfig> deviceConfigs_ =
        java.util.Collections.emptyList();

    private void ensureDeviceConfigsIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        deviceConfigs_ =
            new java.util.ArrayList<com.google.cloud.iot.v1.DeviceConfig>(deviceConfigs_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceConfig,
            com.google.cloud.iot.v1.DeviceConfig.Builder,
            com.google.cloud.iot.v1.DeviceConfigOrBuilder>
        deviceConfigsBuilder_;

    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.DeviceConfig> getDeviceConfigsList() {
      if (deviceConfigsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(deviceConfigs_);
      } else {
        return deviceConfigsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public int getDeviceConfigsCount() {
      if (deviceConfigsBuilder_ == null) {
        return deviceConfigs_.size();
      } else {
        return deviceConfigsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceConfig getDeviceConfigs(int index) {
      if (deviceConfigsBuilder_ == null) {
        return deviceConfigs_.get(index);
      } else {
        return deviceConfigsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public Builder setDeviceConfigs(int index, com.google.cloud.iot.v1.DeviceConfig value) {
      if (deviceConfigsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDeviceConfigsIsMutable();
        deviceConfigs_.set(index, value);
        onChanged();
      } else {
        deviceConfigsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public Builder setDeviceConfigs(
        int index, com.google.cloud.iot.v1.DeviceConfig.Builder builderForValue) {
      if (deviceConfigsBuilder_ == null) {
        ensureDeviceConfigsIsMutable();
        deviceConfigs_.set(index, builderForValue.build());
        onChanged();
      } else {
        deviceConfigsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public Builder addDeviceConfigs(com.google.cloud.iot.v1.DeviceConfig value) {
      if (deviceConfigsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDeviceConfigsIsMutable();
        deviceConfigs_.add(value);
        onChanged();
      } else {
        deviceConfigsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public Builder addDeviceConfigs(int index, com.google.cloud.iot.v1.DeviceConfig value) {
      if (deviceConfigsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDeviceConfigsIsMutable();
        deviceConfigs_.add(index, value);
        onChanged();
      } else {
        deviceConfigsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public Builder addDeviceConfigs(com.google.cloud.iot.v1.DeviceConfig.Builder builderForValue) {
      if (deviceConfigsBuilder_ == null) {
        ensureDeviceConfigsIsMutable();
        deviceConfigs_.add(builderForValue.build());
        onChanged();
      } else {
        deviceConfigsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public Builder addDeviceConfigs(
        int index, com.google.cloud.iot.v1.DeviceConfig.Builder builderForValue) {
      if (deviceConfigsBuilder_ == null) {
        ensureDeviceConfigsIsMutable();
        deviceConfigs_.add(index, builderForValue.build());
        onChanged();
      } else {
        deviceConfigsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public Builder addAllDeviceConfigs(
        java.lang.Iterable<? extends com.google.cloud.iot.v1.DeviceConfig> values) {
      if (deviceConfigsBuilder_ == null) {
        ensureDeviceConfigsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deviceConfigs_);
        onChanged();
      } else {
        deviceConfigsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public Builder clearDeviceConfigs() {
      if (deviceConfigsBuilder_ == null) {
        deviceConfigs_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        deviceConfigsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public Builder removeDeviceConfigs(int index) {
      if (deviceConfigsBuilder_ == null) {
        ensureDeviceConfigsIsMutable();
        deviceConfigs_.remove(index);
        onChanged();
      } else {
        deviceConfigsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceConfig.Builder getDeviceConfigsBuilder(int index) {
      return getDeviceConfigsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceConfigOrBuilder getDeviceConfigsOrBuilder(int index) {
      if (deviceConfigsBuilder_ == null) {
        return deviceConfigs_.get(index);
      } else {
        return deviceConfigsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public java.util.List<? extends com.google.cloud.iot.v1.DeviceConfigOrBuilder>
        getDeviceConfigsOrBuilderList() {
      if (deviceConfigsBuilder_ != null) {
        return deviceConfigsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(deviceConfigs_);
      }
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceConfig.Builder addDeviceConfigsBuilder() {
      return getDeviceConfigsFieldBuilder()
          .addBuilder(com.google.cloud.iot.v1.DeviceConfig.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceConfig.Builder addDeviceConfigsBuilder(int index) {
      return getDeviceConfigsFieldBuilder()
          .addBuilder(index, com.google.cloud.iot.v1.DeviceConfig.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The device configuration for the last few versions. Versions are listed
     * in decreasing order, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceConfig device_configs = 1;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.DeviceConfig.Builder>
        getDeviceConfigsBuilderList() {
      return getDeviceConfigsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceConfig,
            com.google.cloud.iot.v1.DeviceConfig.Builder,
            com.google.cloud.iot.v1.DeviceConfigOrBuilder>
        getDeviceConfigsFieldBuilder() {
      if (deviceConfigsBuilder_ == null) {
        deviceConfigsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.iot.v1.DeviceConfig,
                com.google.cloud.iot.v1.DeviceConfig.Builder,
                com.google.cloud.iot.v1.DeviceConfigOrBuilder>(
                deviceConfigs_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        deviceConfigs_ = null;
      }
      return deviceConfigsBuilder_;
    }

    @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.ListDeviceConfigVersionsResponse)
  }

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

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

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

  private static final com.google.protobuf.Parser<ListDeviceConfigVersionsResponse> PARSER =
      new com.google.protobuf.AbstractParser<ListDeviceConfigVersionsResponse>() {
        @java.lang.Override
        public ListDeviceConfigVersionsResponse parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ListDeviceConfigVersionsResponse(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class ListDeviceRegistriesRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.ListDeviceRegistriesRequest)
    ListDeviceRegistriesRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ListDeviceRegistriesRequest.newBuilder() to construct.
  private ListDeviceRegistriesRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ListDeviceRegistriesRequest() {
    parent_ = "";
    pageToken_ = "";
  }

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

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

  private ListDeviceRegistriesRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              parent_ = s;
              break;
            }
          case 16:
            {
              pageSize_ = input.readInt32();
              break;
            }
          case 26:
            {
              java.lang.String s = input.readStringRequireUtf8();

              pageToken_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_ListDeviceRegistriesRequest_descriptor;
  }

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

  public static final int PARENT_FIELD_NUMBER = 1;
  private volatile java.lang.Object parent_;
  /**
   *
   *
   * <pre>
   * Required. The project and cloud region path. For example,
   * `projects/example-project/locations/us-central1`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The parent.
   */
  @java.lang.Override
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    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();
      parent_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The project and cloud region path. For example,
   * `projects/example-project/locations/us-central1`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PAGE_SIZE_FIELD_NUMBER = 2;
  private int pageSize_;
  /**
   *
   *
   * <pre>
   * The maximum number of registries to return in the response. If this value
   * is zero, the service will select a default size. A call may return fewer
   * objects than requested. A non-empty `next_page_token` in the response
   * indicates that more data is available.
   * </pre>
   *
   * <code>int32 page_size = 2;</code>
   *
   * @return The pageSize.
   */
  @java.lang.Override
  public int getPageSize() {
    return pageSize_;
  }

  public static final int PAGE_TOKEN_FIELD_NUMBER = 3;
  private volatile java.lang.Object pageToken_;
  /**
   *
   *
   * <pre>
   * The value returned by the last `ListDeviceRegistriesResponse`; indicates
   * that this is a continuation of a prior `ListDeviceRegistries` call and
   * the system should return the next page of data.
   * </pre>
   *
   * <code>string page_token = 3;</code>
   *
   * @return The pageToken.
   */
  @java.lang.Override
  public java.lang.String getPageToken() {
    java.lang.Object ref = pageToken_;
    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();
      pageToken_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The value returned by the last `ListDeviceRegistriesResponse`; indicates
   * that this is a continuation of a prior `ListDeviceRegistries` call and
   * the system should return the next page of data.
   * </pre>
   *
   * <code>string page_token = 3;</code>
   *
   * @return The bytes for pageToken.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getPageTokenBytes() {
    java.lang.Object ref = pageToken_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      pageToken_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    }
    if (pageSize_ != 0) {
      output.writeInt32(2, pageSize_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    }
    if (pageSize_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_);
    }
    size += unknownFields.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.ListDeviceRegistriesRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.ListDeviceRegistriesRequest other =
        (com.google.cloud.iot.v1.ListDeviceRegistriesRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (getPageSize() != other.getPageSize()) return false;
    if (!getPageToken().equals(other.getPageToken())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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) + PARENT_FIELD_NUMBER;
    hash = (53 * hash) + getParent().hashCode();
    hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER;
    hash = (53 * hash) + getPageSize();
    hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER;
    hash = (53 * hash) + getPageToken().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.ListDeviceRegistriesRequest 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.ListDeviceRegistriesRequest 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.ListDeviceRegistriesRequest 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.ListDeviceRegistriesRequest 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>
   * Request for `ListDeviceRegistries`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.ListDeviceRegistriesRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.ListDeviceRegistriesRequest)
      com.google.cloud.iot.v1.ListDeviceRegistriesRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_ListDeviceRegistriesRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      pageSize_ = 0;

      pageToken_ = "";

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.ListDeviceRegistriesRequest buildPartial() {
      com.google.cloud.iot.v1.ListDeviceRegistriesRequest result =
          new com.google.cloud.iot.v1.ListDeviceRegistriesRequest(this);
      result.parent_ = parent_;
      result.pageSize_ = pageSize_;
      result.pageToken_ = pageToken_;
      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.cloud.iot.v1.ListDeviceRegistriesRequest) {
        return mergeFrom((com.google.cloud.iot.v1.ListDeviceRegistriesRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceRegistriesRequest other) {
      if (other == com.google.cloud.iot.v1.ListDeviceRegistriesRequest.getDefaultInstance())
        return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        onChanged();
      }
      if (other.getPageSize() != 0) {
        setPageSize(other.getPageSize());
      }
      if (!other.getPageToken().isEmpty()) {
        pageToken_ = other.pageToken_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.ListDeviceRegistriesRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.ListDeviceRegistriesRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Required. The project and cloud region path. For example,
     * `projects/example-project/locations/us-central1`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The parent.
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The project and cloud region path. For example,
     * `projects/example-project/locations/us-central1`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for parent.
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The project and cloud region path. For example,
     * `projects/example-project/locations/us-central1`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      parent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The project and cloud region path. For example,
     * `projects/example-project/locations/us-central1`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {

      parent_ = getDefaultInstance().getParent();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The project and cloud region path. For example,
     * `projects/example-project/locations/us-central1`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private int pageSize_;
    /**
     *
     *
     * <pre>
     * The maximum number of registries to return in the response. If this value
     * is zero, the service will select a default size. A call may return fewer
     * objects than requested. A non-empty `next_page_token` in the response
     * indicates that more data is available.
     * </pre>
     *
     * <code>int32 page_size = 2;</code>
     *
     * @return The pageSize.
     */
    @java.lang.Override
    public int getPageSize() {
      return pageSize_;
    }
    /**
     *
     *
     * <pre>
     * The maximum number of registries to return in the response. If this value
     * is zero, the service will select a default size. A call may return fewer
     * objects than requested. A non-empty `next_page_token` in the response
     * indicates that more data is available.
     * </pre>
     *
     * <code>int32 page_size = 2;</code>
     *
     * @param value The pageSize to set.
     * @return This builder for chaining.
     */
    public Builder setPageSize(int value) {

      pageSize_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The maximum number of registries to return in the response. If this value
     * is zero, the service will select a default size. A call may return fewer
     * objects than requested. A non-empty `next_page_token` in the response
     * indicates that more data is available.
     * </pre>
     *
     * <code>int32 page_size = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPageSize() {

      pageSize_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object pageToken_ = "";
    /**
     *
     *
     * <pre>
     * The value returned by the last `ListDeviceRegistriesResponse`; indicates
     * that this is a continuation of a prior `ListDeviceRegistries` call and
     * the system should return the next page of data.
     * </pre>
     *
     * <code>string page_token = 3;</code>
     *
     * @return The pageToken.
     */
    public java.lang.String getPageToken() {
      java.lang.Object ref = pageToken_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        pageToken_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The value returned by the last `ListDeviceRegistriesResponse`; indicates
     * that this is a continuation of a prior `ListDeviceRegistries` call and
     * the system should return the next page of data.
     * </pre>
     *
     * <code>string page_token = 3;</code>
     *
     * @return The bytes for pageToken.
     */
    public com.google.protobuf.ByteString getPageTokenBytes() {
      java.lang.Object ref = pageToken_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        pageToken_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The value returned by the last `ListDeviceRegistriesResponse`; indicates
     * that this is a continuation of a prior `ListDeviceRegistries` call and
     * the system should return the next page of data.
     * </pre>
     *
     * <code>string page_token = 3;</code>
     *
     * @param value The pageToken to set.
     * @return This builder for chaining.
     */
    public Builder setPageToken(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      pageToken_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The value returned by the last `ListDeviceRegistriesResponse`; indicates
     * that this is a continuation of a prior `ListDeviceRegistries` call and
     * the system should return the next page of data.
     * </pre>
     *
     * <code>string page_token = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPageToken() {

      pageToken_ = getDefaultInstance().getPageToken();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The value returned by the last `ListDeviceRegistriesResponse`; indicates
     * that this is a continuation of a prior `ListDeviceRegistries` call and
     * the system should return the next page of data.
     * </pre>
     *
     * <code>string page_token = 3;</code>
     *
     * @param value The bytes for pageToken to set.
     * @return This builder for chaining.
     */
    public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      pageToken_ = value;
      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.ListDeviceRegistriesRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<ListDeviceRegistriesRequest> PARSER =
      new com.google.protobuf.AbstractParser<ListDeviceRegistriesRequest>() {
        @java.lang.Override
        public ListDeviceRegistriesRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ListDeviceRegistriesRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.ListDeviceRegistriesRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class ListDeviceRegistriesResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.ListDeviceRegistriesResponse)
    ListDeviceRegistriesResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ListDeviceRegistriesResponse.newBuilder() to construct.
  private ListDeviceRegistriesResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ListDeviceRegistriesResponse() {
    deviceRegistries_ = java.util.Collections.emptyList();
    nextPageToken_ = "";
  }

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

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

  private ListDeviceRegistriesResponse(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                deviceRegistries_ =
                    new java.util.ArrayList<com.google.cloud.iot.v1.DeviceRegistry>();
                mutable_bitField0_ |= 0x00000001;
              }
              deviceRegistries_.add(
                  input.readMessage(
                      com.google.cloud.iot.v1.DeviceRegistry.parser(), extensionRegistry));
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

              nextPageToken_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        deviceRegistries_ = java.util.Collections.unmodifiableList(deviceRegistries_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_ListDeviceRegistriesResponse_descriptor;
  }

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

  public static final int DEVICE_REGISTRIES_FIELD_NUMBER = 1;
  private java.util.List<com.google.cloud.iot.v1.DeviceRegistry> deviceRegistries_;
  /**
   *
   *
   * <pre>
   * The registries that matched the query.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.iot.v1.DeviceRegistry> getDeviceRegistriesList() {
    return deviceRegistries_;
  }
  /**
   *
   *
   * <pre>
   * The registries that matched the query.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.iot.v1.DeviceRegistryOrBuilder>
      getDeviceRegistriesOrBuilderList() {
    return deviceRegistries_;
  }
  /**
   *
   *
   * <pre>
   * The registries that matched the query.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
   */
  @java.lang.Override
  public int getDeviceRegistriesCount() {
    return deviceRegistries_.size();
  }
  /**
   *
   *
   * <pre>
   * The registries that matched the query.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceRegistry getDeviceRegistries(int index) {
    return deviceRegistries_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The registries that matched the query.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceRegistryOrBuilder getDeviceRegistriesOrBuilder(int index) {
    return deviceRegistries_.get(index);
  }

  public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2;
  private volatile java.lang.Object nextPageToken_;
  /**
   *
   *
   * <pre>
   * If not empty, indicates that there may be more registries that match the
   * request; this value should be passed in a new
   * `ListDeviceRegistriesRequest`.
   * </pre>
   *
   * <code>string next_page_token = 2;</code>
   *
   * @return The nextPageToken.
   */
  @java.lang.Override
  public java.lang.String getNextPageToken() {
    java.lang.Object ref = nextPageToken_;
    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();
      nextPageToken_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * If not empty, indicates that there may be more registries that match the
   * request; this value should be passed in a new
   * `ListDeviceRegistriesRequest`.
   * </pre>
   *
   * <code>string next_page_token = 2;</code>
   *
   * @return The bytes for nextPageToken.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNextPageTokenBytes() {
    java.lang.Object ref = nextPageToken_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      nextPageToken_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    for (int i = 0; i < deviceRegistries_.size(); i++) {
      output.writeMessage(1, deviceRegistries_.get(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    for (int i = 0; i < deviceRegistries_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, deviceRegistries_.get(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
    }
    size += unknownFields.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.ListDeviceRegistriesResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.ListDeviceRegistriesResponse other =
        (com.google.cloud.iot.v1.ListDeviceRegistriesResponse) obj;

    if (!getDeviceRegistriesList().equals(other.getDeviceRegistriesList())) return false;
    if (!getNextPageToken().equals(other.getNextPageToken())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getDeviceRegistriesCount() > 0) {
      hash = (37 * hash) + DEVICE_REGISTRIES_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceRegistriesList().hashCode();
    }
    hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER;
    hash = (53 * hash) + getNextPageToken().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.ListDeviceRegistriesResponse 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.ListDeviceRegistriesResponse 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.ListDeviceRegistriesResponse 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.ListDeviceRegistriesResponse 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>
   * Response for `ListDeviceRegistries`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.ListDeviceRegistriesResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.ListDeviceRegistriesResponse)
      com.google.cloud.iot.v1.ListDeviceRegistriesResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_ListDeviceRegistriesResponse_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
        getDeviceRegistriesFieldBuilder();
      }
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (deviceRegistriesBuilder_ == null) {
        deviceRegistries_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        deviceRegistriesBuilder_.clear();
      }
      nextPageToken_ = "";

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.ListDeviceRegistriesResponse buildPartial() {
      com.google.cloud.iot.v1.ListDeviceRegistriesResponse result =
          new com.google.cloud.iot.v1.ListDeviceRegistriesResponse(this);
      int from_bitField0_ = bitField0_;
      if (deviceRegistriesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          deviceRegistries_ = java.util.Collections.unmodifiableList(deviceRegistries_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.deviceRegistries_ = deviceRegistries_;
      } else {
        result.deviceRegistries_ = deviceRegistriesBuilder_.build();
      }
      result.nextPageToken_ = nextPageToken_;
      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.cloud.iot.v1.ListDeviceRegistriesResponse) {
        return mergeFrom((com.google.cloud.iot.v1.ListDeviceRegistriesResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceRegistriesResponse other) {
      if (other == com.google.cloud.iot.v1.ListDeviceRegistriesResponse.getDefaultInstance())
        return this;
      if (deviceRegistriesBuilder_ == null) {
        if (!other.deviceRegistries_.isEmpty()) {
          if (deviceRegistries_.isEmpty()) {
            deviceRegistries_ = other.deviceRegistries_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureDeviceRegistriesIsMutable();
            deviceRegistries_.addAll(other.deviceRegistries_);
          }
          onChanged();
        }
      } else {
        if (!other.deviceRegistries_.isEmpty()) {
          if (deviceRegistriesBuilder_.isEmpty()) {
            deviceRegistriesBuilder_.dispose();
            deviceRegistriesBuilder_ = null;
            deviceRegistries_ = other.deviceRegistries_;
            bitField0_ = (bitField0_ & ~0x00000001);
            deviceRegistriesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getDeviceRegistriesFieldBuilder()
                    : null;
          } else {
            deviceRegistriesBuilder_.addAllMessages(other.deviceRegistries_);
          }
        }
      }
      if (!other.getNextPageToken().isEmpty()) {
        nextPageToken_ = other.nextPageToken_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.ListDeviceRegistriesResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.ListDeviceRegistriesResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.util.List<com.google.cloud.iot.v1.DeviceRegistry> deviceRegistries_ =
        java.util.Collections.emptyList();

    private void ensureDeviceRegistriesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        deviceRegistries_ =
            new java.util.ArrayList<com.google.cloud.iot.v1.DeviceRegistry>(deviceRegistries_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceRegistry,
            com.google.cloud.iot.v1.DeviceRegistry.Builder,
            com.google.cloud.iot.v1.DeviceRegistryOrBuilder>
        deviceRegistriesBuilder_;

    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.DeviceRegistry> getDeviceRegistriesList() {
      if (deviceRegistriesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(deviceRegistries_);
      } else {
        return deviceRegistriesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public int getDeviceRegistriesCount() {
      if (deviceRegistriesBuilder_ == null) {
        return deviceRegistries_.size();
      } else {
        return deviceRegistriesBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceRegistry getDeviceRegistries(int index) {
      if (deviceRegistriesBuilder_ == null) {
        return deviceRegistries_.get(index);
      } else {
        return deviceRegistriesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public Builder setDeviceRegistries(int index, com.google.cloud.iot.v1.DeviceRegistry value) {
      if (deviceRegistriesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDeviceRegistriesIsMutable();
        deviceRegistries_.set(index, value);
        onChanged();
      } else {
        deviceRegistriesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public Builder setDeviceRegistries(
        int index, com.google.cloud.iot.v1.DeviceRegistry.Builder builderForValue) {
      if (deviceRegistriesBuilder_ == null) {
        ensureDeviceRegistriesIsMutable();
        deviceRegistries_.set(index, builderForValue.build());
        onChanged();
      } else {
        deviceRegistriesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public Builder addDeviceRegistries(com.google.cloud.iot.v1.DeviceRegistry value) {
      if (deviceRegistriesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDeviceRegistriesIsMutable();
        deviceRegistries_.add(value);
        onChanged();
      } else {
        deviceRegistriesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public Builder addDeviceRegistries(int index, com.google.cloud.iot.v1.DeviceRegistry value) {
      if (deviceRegistriesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDeviceRegistriesIsMutable();
        deviceRegistries_.add(index, value);
        onChanged();
      } else {
        deviceRegistriesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public Builder addDeviceRegistries(
        com.google.cloud.iot.v1.DeviceRegistry.Builder builderForValue) {
      if (deviceRegistriesBuilder_ == null) {
        ensureDeviceRegistriesIsMutable();
        deviceRegistries_.add(builderForValue.build());
        onChanged();
      } else {
        deviceRegistriesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public Builder addDeviceRegistries(
        int index, com.google.cloud.iot.v1.DeviceRegistry.Builder builderForValue) {
      if (deviceRegistriesBuilder_ == null) {
        ensureDeviceRegistriesIsMutable();
        deviceRegistries_.add(index, builderForValue.build());
        onChanged();
      } else {
        deviceRegistriesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public Builder addAllDeviceRegistries(
        java.lang.Iterable<? extends com.google.cloud.iot.v1.DeviceRegistry> values) {
      if (deviceRegistriesBuilder_ == null) {
        ensureDeviceRegistriesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deviceRegistries_);
        onChanged();
      } else {
        deviceRegistriesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public Builder clearDeviceRegistries() {
      if (deviceRegistriesBuilder_ == null) {
        deviceRegistries_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        deviceRegistriesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public Builder removeDeviceRegistries(int index) {
      if (deviceRegistriesBuilder_ == null) {
        ensureDeviceRegistriesIsMutable();
        deviceRegistries_.remove(index);
        onChanged();
      } else {
        deviceRegistriesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceRegistry.Builder getDeviceRegistriesBuilder(int index) {
      return getDeviceRegistriesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceRegistryOrBuilder getDeviceRegistriesOrBuilder(int index) {
      if (deviceRegistriesBuilder_ == null) {
        return deviceRegistries_.get(index);
      } else {
        return deviceRegistriesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public java.util.List<? extends com.google.cloud.iot.v1.DeviceRegistryOrBuilder>
        getDeviceRegistriesOrBuilderList() {
      if (deviceRegistriesBuilder_ != null) {
        return deviceRegistriesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(deviceRegistries_);
      }
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceRegistry.Builder addDeviceRegistriesBuilder() {
      return getDeviceRegistriesFieldBuilder()
          .addBuilder(com.google.cloud.iot.v1.DeviceRegistry.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceRegistry.Builder addDeviceRegistriesBuilder(int index) {
      return getDeviceRegistriesFieldBuilder()
          .addBuilder(index, com.google.cloud.iot.v1.DeviceRegistry.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The registries that matched the query.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceRegistry device_registries = 1;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.DeviceRegistry.Builder>
        getDeviceRegistriesBuilderList() {
      return getDeviceRegistriesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceRegistry,
            com.google.cloud.iot.v1.DeviceRegistry.Builder,
            com.google.cloud.iot.v1.DeviceRegistryOrBuilder>
        getDeviceRegistriesFieldBuilder() {
      if (deviceRegistriesBuilder_ == null) {
        deviceRegistriesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.iot.v1.DeviceRegistry,
                com.google.cloud.iot.v1.DeviceRegistry.Builder,
                com.google.cloud.iot.v1.DeviceRegistryOrBuilder>(
                deviceRegistries_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        deviceRegistries_ = null;
      }
      return deviceRegistriesBuilder_;
    }

    private java.lang.Object nextPageToken_ = "";
    /**
     *
     *
     * <pre>
     * If not empty, indicates that there may be more registries that match the
     * request; this value should be passed in a new
     * `ListDeviceRegistriesRequest`.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     *
     * @return The nextPageToken.
     */
    public java.lang.String getNextPageToken() {
      java.lang.Object ref = nextPageToken_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        nextPageToken_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * If not empty, indicates that there may be more registries that match the
     * request; this value should be passed in a new
     * `ListDeviceRegistriesRequest`.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     *
     * @return The bytes for nextPageToken.
     */
    public com.google.protobuf.ByteString getNextPageTokenBytes() {
      java.lang.Object ref = nextPageToken_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        nextPageToken_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * If not empty, indicates that there may be more registries that match the
     * request; this value should be passed in a new
     * `ListDeviceRegistriesRequest`.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     *
     * @param value The nextPageToken to set.
     * @return This builder for chaining.
     */
    public Builder setNextPageToken(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      nextPageToken_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If not empty, indicates that there may be more registries that match the
     * request; this value should be passed in a new
     * `ListDeviceRegistriesRequest`.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearNextPageToken() {

      nextPageToken_ = getDefaultInstance().getNextPageToken();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If not empty, indicates that there may be more registries that match the
     * request; this value should be passed in a new
     * `ListDeviceRegistriesRequest`.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     *
     * @param value The bytes for nextPageToken to set.
     * @return This builder for chaining.
     */
    public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      nextPageToken_ = value;
      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.ListDeviceRegistriesResponse)
  }

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

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

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

  private static final com.google.protobuf.Parser<ListDeviceRegistriesResponse> PARSER =
      new com.google.protobuf.AbstractParser<ListDeviceRegistriesResponse>() {
        @java.lang.Override
        public ListDeviceRegistriesResponse parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ListDeviceRegistriesResponse(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.ListDeviceRegistriesResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class ListDeviceStatesRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.ListDeviceStatesRequest)
    ListDeviceStatesRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ListDeviceStatesRequest.newBuilder() to construct.
  private ListDeviceStatesRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ListDeviceStatesRequest() {
    name_ = "";
  }

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

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

  private ListDeviceStatesRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          case 16:
            {
              numStates_ = input.readInt32();
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_ListDeviceStatesRequest_descriptor;
  }

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

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * Required. The name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 NUM_STATES_FIELD_NUMBER = 2;
  private int numStates_;
  /**
   *
   *
   * <pre>
   * The number of states to list. States are listed in descending order of
   * update time. The maximum number of states retained is 10. If this
   * value is zero, it will return all the states available.
   * </pre>
   *
   * <code>int32 num_states = 2;</code>
   *
   * @return The numStates.
   */
  @java.lang.Override
  public int getNumStates() {
    return numStates_;
  }

  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(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (numStates_ != 0) {
      output.writeInt32(2, numStates_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (numStates_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, numStates_);
    }
    size += unknownFields.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.ListDeviceStatesRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.ListDeviceStatesRequest other =
        (com.google.cloud.iot.v1.ListDeviceStatesRequest) obj;

    if (!getName().equals(other.getName())) return false;
    if (getNumStates() != other.getNumStates()) return false;
    if (!unknownFields.equals(other.unknownFields)) 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();
    hash = (37 * hash) + NUM_STATES_FIELD_NUMBER;
    hash = (53 * hash) + getNumStates();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.ListDeviceStatesRequest 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.ListDeviceStatesRequest 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.ListDeviceStatesRequest 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.ListDeviceStatesRequest 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>
   * Request for `ListDeviceStates`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.ListDeviceStatesRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.ListDeviceStatesRequest)
      com.google.cloud.iot.v1.ListDeviceStatesRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_ListDeviceStatesRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      numStates_ = 0;

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.ListDeviceStatesRequest buildPartial() {
      com.google.cloud.iot.v1.ListDeviceStatesRequest result =
          new com.google.cloud.iot.v1.ListDeviceStatesRequest(this);
      result.name_ = name_;
      result.numStates_ = numStates_;
      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.cloud.iot.v1.ListDeviceStatesRequest) {
        return mergeFrom((com.google.cloud.iot.v1.ListDeviceStatesRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceStatesRequest other) {
      if (other == com.google.cloud.iot.v1.ListDeviceStatesRequest.getDefaultInstance())
        return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.getNumStates() != 0) {
        setNumStates(other.getNumStates());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.ListDeviceStatesRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.ListDeviceStatesRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }

    private int numStates_;
    /**
     *
     *
     * <pre>
     * The number of states to list. States are listed in descending order of
     * update time. The maximum number of states retained is 10. If this
     * value is zero, it will return all the states available.
     * </pre>
     *
     * <code>int32 num_states = 2;</code>
     *
     * @return The numStates.
     */
    @java.lang.Override
    public int getNumStates() {
      return numStates_;
    }
    /**
     *
     *
     * <pre>
     * The number of states to list. States are listed in descending order of
     * update time. The maximum number of states retained is 10. If this
     * value is zero, it will return all the states available.
     * </pre>
     *
     * <code>int32 num_states = 2;</code>
     *
     * @param value The numStates to set.
     * @return This builder for chaining.
     */
    public Builder setNumStates(int value) {

      numStates_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The number of states to list. States are listed in descending order of
     * update time. The maximum number of states retained is 10. If this
     * value is zero, it will return all the states available.
     * </pre>
     *
     * <code>int32 num_states = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearNumStates() {

      numStates_ = 0;
      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.ListDeviceStatesRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<ListDeviceStatesRequest> PARSER =
      new com.google.protobuf.AbstractParser<ListDeviceStatesRequest>() {
        @java.lang.Override
        public ListDeviceStatesRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ListDeviceStatesRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.ListDeviceStatesRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class ListDeviceStatesResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.ListDeviceStatesResponse)
    ListDeviceStatesResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ListDeviceStatesResponse.newBuilder() to construct.
  private ListDeviceStatesResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ListDeviceStatesResponse() {
    deviceStates_ = java.util.Collections.emptyList();
  }

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

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

  private ListDeviceStatesResponse(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                deviceStates_ = new java.util.ArrayList<com.google.cloud.iot.v1.DeviceState>();
                mutable_bitField0_ |= 0x00000001;
              }
              deviceStates_.add(
                  input.readMessage(
                      com.google.cloud.iot.v1.DeviceState.parser(), extensionRegistry));
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        deviceStates_ = java.util.Collections.unmodifiableList(deviceStates_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_ListDeviceStatesResponse_descriptor;
  }

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

  public static final int DEVICE_STATES_FIELD_NUMBER = 1;
  private java.util.List<com.google.cloud.iot.v1.DeviceState> deviceStates_;
  /**
   *
   *
   * <pre>
   * The last few device states. States are listed in descending order of server
   * update time, starting from the most recent one.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.iot.v1.DeviceState> getDeviceStatesList() {
    return deviceStates_;
  }
  /**
   *
   *
   * <pre>
   * The last few device states. States are listed in descending order of server
   * update time, starting from the most recent one.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.iot.v1.DeviceStateOrBuilder>
      getDeviceStatesOrBuilderList() {
    return deviceStates_;
  }
  /**
   *
   *
   * <pre>
   * The last few device states. States are listed in descending order of server
   * update time, starting from the most recent one.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
   */
  @java.lang.Override
  public int getDeviceStatesCount() {
    return deviceStates_.size();
  }
  /**
   *
   *
   * <pre>
   * The last few device states. States are listed in descending order of server
   * update time, starting from the most recent one.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceState getDeviceStates(int index) {
    return deviceStates_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The last few device states. States are listed in descending order of server
   * update time, starting from the most recent one.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceStateOrBuilder getDeviceStatesOrBuilder(int index) {
    return deviceStates_.get(index);
  }

  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 {
    for (int i = 0; i < deviceStates_.size(); i++) {
      output.writeMessage(1, deviceStates_.get(i));
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    for (int i = 0; i < deviceStates_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, deviceStates_.get(i));
    }
    size += unknownFields.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.ListDeviceStatesResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.ListDeviceStatesResponse other =
        (com.google.cloud.iot.v1.ListDeviceStatesResponse) obj;

    if (!getDeviceStatesList().equals(other.getDeviceStatesList())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getDeviceStatesCount() > 0) {
      hash = (37 * hash) + DEVICE_STATES_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceStatesList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.ListDeviceStatesResponse 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.ListDeviceStatesResponse 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.ListDeviceStatesResponse 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.ListDeviceStatesResponse 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>
   * Response for `ListDeviceStates`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.ListDeviceStatesResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.ListDeviceStatesResponse)
      com.google.cloud.iot.v1.ListDeviceStatesResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_ListDeviceStatesResponse_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
        getDeviceStatesFieldBuilder();
      }
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (deviceStatesBuilder_ == null) {
        deviceStates_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        deviceStatesBuilder_.clear();
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.ListDeviceStatesResponse buildPartial() {
      com.google.cloud.iot.v1.ListDeviceStatesResponse result =
          new com.google.cloud.iot.v1.ListDeviceStatesResponse(this);
      int from_bitField0_ = bitField0_;
      if (deviceStatesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          deviceStates_ = java.util.Collections.unmodifiableList(deviceStates_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.deviceStates_ = deviceStates_;
      } else {
        result.deviceStates_ = deviceStatesBuilder_.build();
      }
      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.cloud.iot.v1.ListDeviceStatesResponse) {
        return mergeFrom((com.google.cloud.iot.v1.ListDeviceStatesResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceStatesResponse other) {
      if (other == com.google.cloud.iot.v1.ListDeviceStatesResponse.getDefaultInstance())
        return this;
      if (deviceStatesBuilder_ == null) {
        if (!other.deviceStates_.isEmpty()) {
          if (deviceStates_.isEmpty()) {
            deviceStates_ = other.deviceStates_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureDeviceStatesIsMutable();
            deviceStates_.addAll(other.deviceStates_);
          }
          onChanged();
        }
      } else {
        if (!other.deviceStates_.isEmpty()) {
          if (deviceStatesBuilder_.isEmpty()) {
            deviceStatesBuilder_.dispose();
            deviceStatesBuilder_ = null;
            deviceStates_ = other.deviceStates_;
            bitField0_ = (bitField0_ & ~0x00000001);
            deviceStatesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getDeviceStatesFieldBuilder()
                    : null;
          } else {
            deviceStatesBuilder_.addAllMessages(other.deviceStates_);
          }
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.ListDeviceStatesResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.ListDeviceStatesResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.util.List<com.google.cloud.iot.v1.DeviceState> deviceStates_ =
        java.util.Collections.emptyList();

    private void ensureDeviceStatesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        deviceStates_ = new java.util.ArrayList<com.google.cloud.iot.v1.DeviceState>(deviceStates_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceState,
            com.google.cloud.iot.v1.DeviceState.Builder,
            com.google.cloud.iot.v1.DeviceStateOrBuilder>
        deviceStatesBuilder_;

    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.DeviceState> getDeviceStatesList() {
      if (deviceStatesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(deviceStates_);
      } else {
        return deviceStatesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public int getDeviceStatesCount() {
      if (deviceStatesBuilder_ == null) {
        return deviceStates_.size();
      } else {
        return deviceStatesBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceState getDeviceStates(int index) {
      if (deviceStatesBuilder_ == null) {
        return deviceStates_.get(index);
      } else {
        return deviceStatesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public Builder setDeviceStates(int index, com.google.cloud.iot.v1.DeviceState value) {
      if (deviceStatesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDeviceStatesIsMutable();
        deviceStates_.set(index, value);
        onChanged();
      } else {
        deviceStatesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public Builder setDeviceStates(
        int index, com.google.cloud.iot.v1.DeviceState.Builder builderForValue) {
      if (deviceStatesBuilder_ == null) {
        ensureDeviceStatesIsMutable();
        deviceStates_.set(index, builderForValue.build());
        onChanged();
      } else {
        deviceStatesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public Builder addDeviceStates(com.google.cloud.iot.v1.DeviceState value) {
      if (deviceStatesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDeviceStatesIsMutable();
        deviceStates_.add(value);
        onChanged();
      } else {
        deviceStatesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public Builder addDeviceStates(int index, com.google.cloud.iot.v1.DeviceState value) {
      if (deviceStatesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDeviceStatesIsMutable();
        deviceStates_.add(index, value);
        onChanged();
      } else {
        deviceStatesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public Builder addDeviceStates(com.google.cloud.iot.v1.DeviceState.Builder builderForValue) {
      if (deviceStatesBuilder_ == null) {
        ensureDeviceStatesIsMutable();
        deviceStates_.add(builderForValue.build());
        onChanged();
      } else {
        deviceStatesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public Builder addDeviceStates(
        int index, com.google.cloud.iot.v1.DeviceState.Builder builderForValue) {
      if (deviceStatesBuilder_ == null) {
        ensureDeviceStatesIsMutable();
        deviceStates_.add(index, builderForValue.build());
        onChanged();
      } else {
        deviceStatesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public Builder addAllDeviceStates(
        java.lang.Iterable<? extends com.google.cloud.iot.v1.DeviceState> values) {
      if (deviceStatesBuilder_ == null) {
        ensureDeviceStatesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deviceStates_);
        onChanged();
      } else {
        deviceStatesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public Builder clearDeviceStates() {
      if (deviceStatesBuilder_ == null) {
        deviceStates_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        deviceStatesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public Builder removeDeviceStates(int index) {
      if (deviceStatesBuilder_ == null) {
        ensureDeviceStatesIsMutable();
        deviceStates_.remove(index);
        onChanged();
      } else {
        deviceStatesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceState.Builder getDeviceStatesBuilder(int index) {
      return getDeviceStatesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceStateOrBuilder getDeviceStatesOrBuilder(int index) {
      if (deviceStatesBuilder_ == null) {
        return deviceStates_.get(index);
      } else {
        return deviceStatesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public java.util.List<? extends com.google.cloud.iot.v1.DeviceStateOrBuilder>
        getDeviceStatesOrBuilderList() {
      if (deviceStatesBuilder_ != null) {
        return deviceStatesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(deviceStates_);
      }
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceState.Builder addDeviceStatesBuilder() {
      return getDeviceStatesFieldBuilder()
          .addBuilder(com.google.cloud.iot.v1.DeviceState.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceState.Builder addDeviceStatesBuilder(int index) {
      return getDeviceStatesFieldBuilder()
          .addBuilder(index, com.google.cloud.iot.v1.DeviceState.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.DeviceState.Builder>
        getDeviceStatesBuilderList() {
      return getDeviceStatesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceState,
            com.google.cloud.iot.v1.DeviceState.Builder,
            com.google.cloud.iot.v1.DeviceStateOrBuilder>
        getDeviceStatesFieldBuilder() {
      if (deviceStatesBuilder_ == null) {
        deviceStatesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.iot.v1.DeviceState,
                com.google.cloud.iot.v1.DeviceState.Builder,
                com.google.cloud.iot.v1.DeviceStateOrBuilder>(
                deviceStates_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
        deviceStates_ = null;
      }
      return deviceStatesBuilder_;
    }

    @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.ListDeviceStatesResponse)
  }

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

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

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

  private static final com.google.protobuf.Parser<ListDeviceStatesResponse> PARSER =
      new com.google.protobuf.AbstractParser<ListDeviceStatesResponse>() {
        @java.lang.Override
        public ListDeviceStatesResponse parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ListDeviceStatesResponse(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.ListDeviceStatesResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class ListDevicesRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.ListDevicesRequest)
    ListDevicesRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ListDevicesRequest.newBuilder() to construct.
  private ListDevicesRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ListDevicesRequest() {
    parent_ = "";
    deviceNumIds_ = emptyLongList();
    deviceIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    pageToken_ = "";
  }

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

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

  private ListDevicesRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              parent_ = s;
              break;
            }
          case 16:
            {
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                deviceNumIds_ = newLongList();
                mutable_bitField0_ |= 0x00000001;
              }
              deviceNumIds_.addLong(input.readUInt64());
              break;
            }
          case 18:
            {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) {
                deviceNumIds_ = newLongList();
                mutable_bitField0_ |= 0x00000001;
              }
              while (input.getBytesUntilLimit() > 0) {
                deviceNumIds_.addLong(input.readUInt64());
              }
              input.popLimit(limit);
              break;
            }
          case 26:
            {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000002) != 0)) {
                deviceIds_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000002;
              }
              deviceIds_.add(s);
              break;
            }
          case 34:
            {
              com.google.protobuf.FieldMask.Builder subBuilder = null;
              if (fieldMask_ != null) {
                subBuilder = fieldMask_.toBuilder();
              }
              fieldMask_ =
                  input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(fieldMask_);
                fieldMask_ = subBuilder.buildPartial();
              }

              break;
            }
          case 50:
            {
              com.google.cloud.iot.v1.GatewayListOptions.Builder subBuilder = null;
              if (gatewayListOptions_ != null) {
                subBuilder = gatewayListOptions_.toBuilder();
              }
              gatewayListOptions_ =
                  input.readMessage(
                      com.google.cloud.iot.v1.GatewayListOptions.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(gatewayListOptions_);
                gatewayListOptions_ = subBuilder.buildPartial();
              }

              break;
            }
          case 800:
            {
              pageSize_ = input.readInt32();
              break;
            }
          case 810:
            {
              java.lang.String s = input.readStringRequireUtf8();

              pageToken_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        deviceNumIds_.makeImmutable(); // C
      }
      if (((mutable_bitField0_ & 0x00000002) != 0)) {
        deviceIds_ = deviceIds_.getUnmodifiableView();
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_ListDevicesRequest_descriptor;
  }

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

  public static final int PARENT_FIELD_NUMBER = 1;
  private volatile java.lang.Object parent_;
  /**
   *
   *
   * <pre>
   * Required. The device registry path. Required. For example,
   * `projects/my-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The parent.
   */
  @java.lang.Override
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    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();
      parent_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The device registry path. Required. For example,
   * `projects/my-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DEVICE_NUM_IDS_FIELD_NUMBER = 2;
  private com.google.protobuf.Internal.LongList deviceNumIds_;
  /**
   *
   *
   * <pre>
   * A list of device numeric IDs. If empty, this field is ignored. Maximum
   * IDs: 10,000.
   * </pre>
   *
   * <code>repeated uint64 device_num_ids = 2;</code>
   *
   * @return A list containing the deviceNumIds.
   */
  @java.lang.Override
  public java.util.List<java.lang.Long> getDeviceNumIdsList() {
    return deviceNumIds_;
  }
  /**
   *
   *
   * <pre>
   * A list of device numeric IDs. If empty, this field is ignored. Maximum
   * IDs: 10,000.
   * </pre>
   *
   * <code>repeated uint64 device_num_ids = 2;</code>
   *
   * @return The count of deviceNumIds.
   */
  public int getDeviceNumIdsCount() {
    return deviceNumIds_.size();
  }
  /**
   *
   *
   * <pre>
   * A list of device numeric IDs. If empty, this field is ignored. Maximum
   * IDs: 10,000.
   * </pre>
   *
   * <code>repeated uint64 device_num_ids = 2;</code>
   *
   * @param index The index of the element to return.
   * @return The deviceNumIds at the given index.
   */
  public long getDeviceNumIds(int index) {
    return deviceNumIds_.getLong(index);
  }

  private int deviceNumIdsMemoizedSerializedSize = -1;

  public static final int DEVICE_IDS_FIELD_NUMBER = 3;
  private com.google.protobuf.LazyStringList deviceIds_;
  /**
   *
   *
   * <pre>
   * A list of device string IDs. For example, `['device0', 'device12']`.
   * If empty, this field is ignored. Maximum IDs: 10,000
   * </pre>
   *
   * <code>repeated string device_ids = 3;</code>
   *
   * @return A list containing the deviceIds.
   */
  public com.google.protobuf.ProtocolStringList getDeviceIdsList() {
    return deviceIds_;
  }
  /**
   *
   *
   * <pre>
   * A list of device string IDs. For example, `['device0', 'device12']`.
   * If empty, this field is ignored. Maximum IDs: 10,000
   * </pre>
   *
   * <code>repeated string device_ids = 3;</code>
   *
   * @return The count of deviceIds.
   */
  public int getDeviceIdsCount() {
    return deviceIds_.size();
  }
  /**
   *
   *
   * <pre>
   * A list of device string IDs. For example, `['device0', 'device12']`.
   * If empty, this field is ignored. Maximum IDs: 10,000
   * </pre>
   *
   * <code>repeated string device_ids = 3;</code>
   *
   * @param index The index of the element to return.
   * @return The deviceIds at the given index.
   */
  public java.lang.String getDeviceIds(int index) {
    return deviceIds_.get(index);
  }
  /**
   *
   *
   * <pre>
   * A list of device string IDs. For example, `['device0', 'device12']`.
   * If empty, this field is ignored. Maximum IDs: 10,000
   * </pre>
   *
   * <code>repeated string device_ids = 3;</code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the deviceIds at the given index.
   */
  public com.google.protobuf.ByteString getDeviceIdsBytes(int index) {
    return deviceIds_.getByteString(index);
  }

  public static final int FIELD_MASK_FIELD_NUMBER = 4;
  private com.google.protobuf.FieldMask fieldMask_;
  /**
   *
   *
   * <pre>
   * The fields of the `Device` resource to be returned in the response. The
   * fields `id` and `num_id` are always returned, along with any
   * other fields specified in snake_case format, for example:
   * `last_heartbeat_time`.
   * </pre>
   *
   * <code>.google.protobuf.FieldMask field_mask = 4;</code>
   *
   * @return Whether the fieldMask field is set.
   */
  @java.lang.Override
  public boolean hasFieldMask() {
    return fieldMask_ != null;
  }
  /**
   *
   *
   * <pre>
   * The fields of the `Device` resource to be returned in the response. The
   * fields `id` and `num_id` are always returned, along with any
   * other fields specified in snake_case format, for example:
   * `last_heartbeat_time`.
   * </pre>
   *
   * <code>.google.protobuf.FieldMask field_mask = 4;</code>
   *
   * @return The fieldMask.
   */
  @java.lang.Override
  public com.google.protobuf.FieldMask getFieldMask() {
    return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_;
  }
  /**
   *
   *
   * <pre>
   * The fields of the `Device` resource to be returned in the response. The
   * fields `id` and `num_id` are always returned, along with any
   * other fields specified in snake_case format, for example:
   * `last_heartbeat_time`.
   * </pre>
   *
   * <code>.google.protobuf.FieldMask field_mask = 4;</code>
   */
  @java.lang.Override
  public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() {
    return getFieldMask();
  }

  public static final int GATEWAY_LIST_OPTIONS_FIELD_NUMBER = 6;
  private com.google.cloud.iot.v1.GatewayListOptions gatewayListOptions_;
  /**
   *
   *
   * <pre>
   * Options related to gateways.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
   *
   * @return Whether the gatewayListOptions field is set.
   */
  @java.lang.Override
  public boolean hasGatewayListOptions() {
    return gatewayListOptions_ != null;
  }
  /**
   *
   *
   * <pre>
   * Options related to gateways.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
   *
   * @return The gatewayListOptions.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.GatewayListOptions getGatewayListOptions() {
    return gatewayListOptions_ == null
        ? com.google.cloud.iot.v1.GatewayListOptions.getDefaultInstance()
        : gatewayListOptions_;
  }
  /**
   *
   *
   * <pre>
   * Options related to gateways.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.GatewayListOptionsOrBuilder getGatewayListOptionsOrBuilder() {
    return getGatewayListOptions();
  }

  public static final int PAGE_SIZE_FIELD_NUMBER = 100;
  private int pageSize_;
  /**
   *
   *
   * <pre>
   * The maximum number of devices to return in the response. If this value
   * is zero, the service will select a default size. A call may return fewer
   * objects than requested. A non-empty `next_page_token` in the response
   * indicates that more data is available.
   * </pre>
   *
   * <code>int32 page_size = 100;</code>
   *
   * @return The pageSize.
   */
  @java.lang.Override
  public int getPageSize() {
    return pageSize_;
  }

  public static final int PAGE_TOKEN_FIELD_NUMBER = 101;
  private volatile java.lang.Object pageToken_;
  /**
   *
   *
   * <pre>
   * The value returned by the last `ListDevicesResponse`; indicates
   * that this is a continuation of a prior `ListDevices` call and
   * the system should return the next page of data.
   * </pre>
   *
   * <code>string page_token = 101;</code>
   *
   * @return The pageToken.
   */
  @java.lang.Override
  public java.lang.String getPageToken() {
    java.lang.Object ref = pageToken_;
    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();
      pageToken_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The value returned by the last `ListDevicesResponse`; indicates
   * that this is a continuation of a prior `ListDevices` call and
   * the system should return the next page of data.
   * </pre>
   *
   * <code>string page_token = 101;</code>
   *
   * @return The bytes for pageToken.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getPageTokenBytes() {
    java.lang.Object ref = pageToken_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      pageToken_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    getSerializedSize();
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    }
    if (getDeviceNumIdsList().size() > 0) {
      output.writeUInt32NoTag(18);
      output.writeUInt32NoTag(deviceNumIdsMemoizedSerializedSize);
    }
    for (int i = 0; i < deviceNumIds_.size(); i++) {
      output.writeUInt64NoTag(deviceNumIds_.getLong(i));
    }
    for (int i = 0; i < deviceIds_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deviceIds_.getRaw(i));
    }
    if (fieldMask_ != null) {
      output.writeMessage(4, getFieldMask());
    }
    if (gatewayListOptions_ != null) {
      output.writeMessage(6, getGatewayListOptions());
    }
    if (pageSize_ != 0) {
      output.writeInt32(100, pageSize_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 101, pageToken_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < deviceNumIds_.size(); i++) {
        dataSize +=
            com.google.protobuf.CodedOutputStream.computeUInt64SizeNoTag(deviceNumIds_.getLong(i));
      }
      size += dataSize;
      if (!getDeviceNumIdsList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      deviceNumIdsMemoizedSerializedSize = dataSize;
    }
    {
      int dataSize = 0;
      for (int i = 0; i < deviceIds_.size(); i++) {
        dataSize += computeStringSizeNoTag(deviceIds_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getDeviceIdsList().size();
    }
    if (fieldMask_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getFieldMask());
    }
    if (gatewayListOptions_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getGatewayListOptions());
    }
    if (pageSize_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(100, pageSize_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(101, pageToken_);
    }
    size += unknownFields.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.ListDevicesRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.ListDevicesRequest other =
        (com.google.cloud.iot.v1.ListDevicesRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (!getDeviceNumIdsList().equals(other.getDeviceNumIdsList())) return false;
    if (!getDeviceIdsList().equals(other.getDeviceIdsList())) return false;
    if (hasFieldMask() != other.hasFieldMask()) return false;
    if (hasFieldMask()) {
      if (!getFieldMask().equals(other.getFieldMask())) return false;
    }
    if (hasGatewayListOptions() != other.hasGatewayListOptions()) return false;
    if (hasGatewayListOptions()) {
      if (!getGatewayListOptions().equals(other.getGatewayListOptions())) return false;
    }
    if (getPageSize() != other.getPageSize()) return false;
    if (!getPageToken().equals(other.getPageToken())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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) + PARENT_FIELD_NUMBER;
    hash = (53 * hash) + getParent().hashCode();
    if (getDeviceNumIdsCount() > 0) {
      hash = (37 * hash) + DEVICE_NUM_IDS_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceNumIdsList().hashCode();
    }
    if (getDeviceIdsCount() > 0) {
      hash = (37 * hash) + DEVICE_IDS_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceIdsList().hashCode();
    }
    if (hasFieldMask()) {
      hash = (37 * hash) + FIELD_MASK_FIELD_NUMBER;
      hash = (53 * hash) + getFieldMask().hashCode();
    }
    if (hasGatewayListOptions()) {
      hash = (37 * hash) + GATEWAY_LIST_OPTIONS_FIELD_NUMBER;
      hash = (53 * hash) + getGatewayListOptions().hashCode();
    }
    hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER;
    hash = (53 * hash) + getPageSize();
    hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER;
    hash = (53 * hash) + getPageToken().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.ListDevicesRequest 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.ListDevicesRequest 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.ListDevicesRequest 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.ListDevicesRequest 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>
   * Request for `ListDevices`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.ListDevicesRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.ListDevicesRequest)
      com.google.cloud.iot.v1.ListDevicesRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_ListDevicesRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      deviceNumIds_ = emptyLongList();
      bitField0_ = (bitField0_ & ~0x00000001);
      deviceIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      if (fieldMaskBuilder_ == null) {
        fieldMask_ = null;
      } else {
        fieldMask_ = null;
        fieldMaskBuilder_ = null;
      }
      if (gatewayListOptionsBuilder_ == null) {
        gatewayListOptions_ = null;
      } else {
        gatewayListOptions_ = null;
        gatewayListOptionsBuilder_ = null;
      }
      pageSize_ = 0;

      pageToken_ = "";

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.ListDevicesRequest buildPartial() {
      com.google.cloud.iot.v1.ListDevicesRequest result =
          new com.google.cloud.iot.v1.ListDevicesRequest(this);
      int from_bitField0_ = bitField0_;
      result.parent_ = parent_;
      if (((bitField0_ & 0x00000001) != 0)) {
        deviceNumIds_.makeImmutable();
        bitField0_ = (bitField0_ & ~0x00000001);
      }
      result.deviceNumIds_ = deviceNumIds_;
      if (((bitField0_ & 0x00000002) != 0)) {
        deviceIds_ = deviceIds_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.deviceIds_ = deviceIds_;
      if (fieldMaskBuilder_ == null) {
        result.fieldMask_ = fieldMask_;
      } else {
        result.fieldMask_ = fieldMaskBuilder_.build();
      }
      if (gatewayListOptionsBuilder_ == null) {
        result.gatewayListOptions_ = gatewayListOptions_;
      } else {
        result.gatewayListOptions_ = gatewayListOptionsBuilder_.build();
      }
      result.pageSize_ = pageSize_;
      result.pageToken_ = pageToken_;
      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.cloud.iot.v1.ListDevicesRequest) {
        return mergeFrom((com.google.cloud.iot.v1.ListDevicesRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.ListDevicesRequest other) {
      if (other == com.google.cloud.iot.v1.ListDevicesRequest.getDefaultInstance()) return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        onChanged();
      }
      if (!other.deviceNumIds_.isEmpty()) {
        if (deviceNumIds_.isEmpty()) {
          deviceNumIds_ = other.deviceNumIds_;
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          ensureDeviceNumIdsIsMutable();
          deviceNumIds_.addAll(other.deviceNumIds_);
        }
        onChanged();
      }
      if (!other.deviceIds_.isEmpty()) {
        if (deviceIds_.isEmpty()) {
          deviceIds_ = other.deviceIds_;
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          ensureDeviceIdsIsMutable();
          deviceIds_.addAll(other.deviceIds_);
        }
        onChanged();
      }
      if (other.hasFieldMask()) {
        mergeFieldMask(other.getFieldMask());
      }
      if (other.hasGatewayListOptions()) {
        mergeGatewayListOptions(other.getGatewayListOptions());
      }
      if (other.getPageSize() != 0) {
        setPageSize(other.getPageSize());
      }
      if (!other.getPageToken().isEmpty()) {
        pageToken_ = other.pageToken_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.ListDevicesRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.ListDevicesRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Required. The device registry path. Required. For example,
     * `projects/my-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The parent.
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry path. Required. For example,
     * `projects/my-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for parent.
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry path. Required. For example,
     * `projects/my-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      parent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry path. Required. For example,
     * `projects/my-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {

      parent_ = getDefaultInstance().getParent();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device registry path. Required. For example,
     * `projects/my-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private com.google.protobuf.Internal.LongList deviceNumIds_ = emptyLongList();

    private void ensureDeviceNumIdsIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        deviceNumIds_ = mutableCopy(deviceNumIds_);
        bitField0_ |= 0x00000001;
      }
    }
    /**
     *
     *
     * <pre>
     * A list of device numeric IDs. If empty, this field is ignored. Maximum
     * IDs: 10,000.
     * </pre>
     *
     * <code>repeated uint64 device_num_ids = 2;</code>
     *
     * @return A list containing the deviceNumIds.
     */
    public java.util.List<java.lang.Long> getDeviceNumIdsList() {
      return ((bitField0_ & 0x00000001) != 0)
          ? java.util.Collections.unmodifiableList(deviceNumIds_)
          : deviceNumIds_;
    }
    /**
     *
     *
     * <pre>
     * A list of device numeric IDs. If empty, this field is ignored. Maximum
     * IDs: 10,000.
     * </pre>
     *
     * <code>repeated uint64 device_num_ids = 2;</code>
     *
     * @return The count of deviceNumIds.
     */
    public int getDeviceNumIdsCount() {
      return deviceNumIds_.size();
    }
    /**
     *
     *
     * <pre>
     * A list of device numeric IDs. If empty, this field is ignored. Maximum
     * IDs: 10,000.
     * </pre>
     *
     * <code>repeated uint64 device_num_ids = 2;</code>
     *
     * @param index The index of the element to return.
     * @return The deviceNumIds at the given index.
     */
    public long getDeviceNumIds(int index) {
      return deviceNumIds_.getLong(index);
    }
    /**
     *
     *
     * <pre>
     * A list of device numeric IDs. If empty, this field is ignored. Maximum
     * IDs: 10,000.
     * </pre>
     *
     * <code>repeated uint64 device_num_ids = 2;</code>
     *
     * @param index The index to set the value at.
     * @param value The deviceNumIds to set.
     * @return This builder for chaining.
     */
    public Builder setDeviceNumIds(int index, long value) {
      ensureDeviceNumIdsIsMutable();
      deviceNumIds_.setLong(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of device numeric IDs. If empty, this field is ignored. Maximum
     * IDs: 10,000.
     * </pre>
     *
     * <code>repeated uint64 device_num_ids = 2;</code>
     *
     * @param value The deviceNumIds to add.
     * @return This builder for chaining.
     */
    public Builder addDeviceNumIds(long value) {
      ensureDeviceNumIdsIsMutable();
      deviceNumIds_.addLong(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of device numeric IDs. If empty, this field is ignored. Maximum
     * IDs: 10,000.
     * </pre>
     *
     * <code>repeated uint64 device_num_ids = 2;</code>
     *
     * @param values The deviceNumIds to add.
     * @return This builder for chaining.
     */
    public Builder addAllDeviceNumIds(java.lang.Iterable<? extends java.lang.Long> values) {
      ensureDeviceNumIdsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deviceNumIds_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of device numeric IDs. If empty, this field is ignored. Maximum
     * IDs: 10,000.
     * </pre>
     *
     * <code>repeated uint64 device_num_ids = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDeviceNumIds() {
      deviceNumIds_ = emptyLongList();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList deviceIds_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureDeviceIdsIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        deviceIds_ = new com.google.protobuf.LazyStringArrayList(deviceIds_);
        bitField0_ |= 0x00000002;
      }
    }
    /**
     *
     *
     * <pre>
     * A list of device string IDs. For example, `['device0', 'device12']`.
     * If empty, this field is ignored. Maximum IDs: 10,000
     * </pre>
     *
     * <code>repeated string device_ids = 3;</code>
     *
     * @return A list containing the deviceIds.
     */
    public com.google.protobuf.ProtocolStringList getDeviceIdsList() {
      return deviceIds_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * A list of device string IDs. For example, `['device0', 'device12']`.
     * If empty, this field is ignored. Maximum IDs: 10,000
     * </pre>
     *
     * <code>repeated string device_ids = 3;</code>
     *
     * @return The count of deviceIds.
     */
    public int getDeviceIdsCount() {
      return deviceIds_.size();
    }
    /**
     *
     *
     * <pre>
     * A list of device string IDs. For example, `['device0', 'device12']`.
     * If empty, this field is ignored. Maximum IDs: 10,000
     * </pre>
     *
     * <code>repeated string device_ids = 3;</code>
     *
     * @param index The index of the element to return.
     * @return The deviceIds at the given index.
     */
    public java.lang.String getDeviceIds(int index) {
      return deviceIds_.get(index);
    }
    /**
     *
     *
     * <pre>
     * A list of device string IDs. For example, `['device0', 'device12']`.
     * If empty, this field is ignored. Maximum IDs: 10,000
     * </pre>
     *
     * <code>repeated string device_ids = 3;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the deviceIds at the given index.
     */
    public com.google.protobuf.ByteString getDeviceIdsBytes(int index) {
      return deviceIds_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * A list of device string IDs. For example, `['device0', 'device12']`.
     * If empty, this field is ignored. Maximum IDs: 10,000
     * </pre>
     *
     * <code>repeated string device_ids = 3;</code>
     *
     * @param index The index to set the value at.
     * @param value The deviceIds to set.
     * @return This builder for chaining.
     */
    public Builder setDeviceIds(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureDeviceIdsIsMutable();
      deviceIds_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of device string IDs. For example, `['device0', 'device12']`.
     * If empty, this field is ignored. Maximum IDs: 10,000
     * </pre>
     *
     * <code>repeated string device_ids = 3;</code>
     *
     * @param value The deviceIds to add.
     * @return This builder for chaining.
     */
    public Builder addDeviceIds(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureDeviceIdsIsMutable();
      deviceIds_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of device string IDs. For example, `['device0', 'device12']`.
     * If empty, this field is ignored. Maximum IDs: 10,000
     * </pre>
     *
     * <code>repeated string device_ids = 3;</code>
     *
     * @param values The deviceIds to add.
     * @return This builder for chaining.
     */
    public Builder addAllDeviceIds(java.lang.Iterable<java.lang.String> values) {
      ensureDeviceIdsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deviceIds_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of device string IDs. For example, `['device0', 'device12']`.
     * If empty, this field is ignored. Maximum IDs: 10,000
     * </pre>
     *
     * <code>repeated string device_ids = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDeviceIds() {
      deviceIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of device string IDs. For example, `['device0', 'device12']`.
     * If empty, this field is ignored. Maximum IDs: 10,000
     * </pre>
     *
     * <code>repeated string device_ids = 3;</code>
     *
     * @param value The bytes of the deviceIds to add.
     * @return This builder for chaining.
     */
    public Builder addDeviceIdsBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureDeviceIdsIsMutable();
      deviceIds_.add(value);
      onChanged();
      return this;
    }

    private com.google.protobuf.FieldMask fieldMask_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.FieldMask,
            com.google.protobuf.FieldMask.Builder,
            com.google.protobuf.FieldMaskOrBuilder>
        fieldMaskBuilder_;
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. The
     * fields `id` and `num_id` are always returned, along with any
     * other fields specified in snake_case format, for example:
     * `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 4;</code>
     *
     * @return Whether the fieldMask field is set.
     */
    public boolean hasFieldMask() {
      return fieldMaskBuilder_ != null || fieldMask_ != null;
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. The
     * fields `id` and `num_id` are always returned, along with any
     * other fields specified in snake_case format, for example:
     * `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 4;</code>
     *
     * @return The fieldMask.
     */
    public com.google.protobuf.FieldMask getFieldMask() {
      if (fieldMaskBuilder_ == null) {
        return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_;
      } else {
        return fieldMaskBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. The
     * fields `id` and `num_id` are always returned, along with any
     * other fields specified in snake_case format, for example:
     * `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 4;</code>
     */
    public Builder setFieldMask(com.google.protobuf.FieldMask value) {
      if (fieldMaskBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        fieldMask_ = value;
        onChanged();
      } else {
        fieldMaskBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. The
     * fields `id` and `num_id` are always returned, along with any
     * other fields specified in snake_case format, for example:
     * `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 4;</code>
     */
    public Builder setFieldMask(com.google.protobuf.FieldMask.Builder builderForValue) {
      if (fieldMaskBuilder_ == null) {
        fieldMask_ = builderForValue.build();
        onChanged();
      } else {
        fieldMaskBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. The
     * fields `id` and `num_id` are always returned, along with any
     * other fields specified in snake_case format, for example:
     * `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 4;</code>
     */
    public Builder mergeFieldMask(com.google.protobuf.FieldMask value) {
      if (fieldMaskBuilder_ == null) {
        if (fieldMask_ != null) {
          fieldMask_ =
              com.google.protobuf.FieldMask.newBuilder(fieldMask_).mergeFrom(value).buildPartial();
        } else {
          fieldMask_ = value;
        }
        onChanged();
      } else {
        fieldMaskBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. The
     * fields `id` and `num_id` are always returned, along with any
     * other fields specified in snake_case format, for example:
     * `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 4;</code>
     */
    public Builder clearFieldMask() {
      if (fieldMaskBuilder_ == null) {
        fieldMask_ = null;
        onChanged();
      } else {
        fieldMask_ = null;
        fieldMaskBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. The
     * fields `id` and `num_id` are always returned, along with any
     * other fields specified in snake_case format, for example:
     * `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 4;</code>
     */
    public com.google.protobuf.FieldMask.Builder getFieldMaskBuilder() {

      onChanged();
      return getFieldMaskFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. The
     * fields `id` and `num_id` are always returned, along with any
     * other fields specified in snake_case format, for example:
     * `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 4;</code>
     */
    public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() {
      if (fieldMaskBuilder_ != null) {
        return fieldMaskBuilder_.getMessageOrBuilder();
      } else {
        return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_;
      }
    }
    /**
     *
     *
     * <pre>
     * The fields of the `Device` resource to be returned in the response. The
     * fields `id` and `num_id` are always returned, along with any
     * other fields specified in snake_case format, for example:
     * `last_heartbeat_time`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask field_mask = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.FieldMask,
            com.google.protobuf.FieldMask.Builder,
            com.google.protobuf.FieldMaskOrBuilder>
        getFieldMaskFieldBuilder() {
      if (fieldMaskBuilder_ == null) {
        fieldMaskBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.FieldMask,
                com.google.protobuf.FieldMask.Builder,
                com.google.protobuf.FieldMaskOrBuilder>(
                getFieldMask(), getParentForChildren(), isClean());
        fieldMask_ = null;
      }
      return fieldMaskBuilder_;
    }

    private com.google.cloud.iot.v1.GatewayListOptions gatewayListOptions_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.GatewayListOptions,
            com.google.cloud.iot.v1.GatewayListOptions.Builder,
            com.google.cloud.iot.v1.GatewayListOptionsOrBuilder>
        gatewayListOptionsBuilder_;
    /**
     *
     *
     * <pre>
     * Options related to gateways.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
     *
     * @return Whether the gatewayListOptions field is set.
     */
    public boolean hasGatewayListOptions() {
      return gatewayListOptionsBuilder_ != null || gatewayListOptions_ != null;
    }
    /**
     *
     *
     * <pre>
     * Options related to gateways.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
     *
     * @return The gatewayListOptions.
     */
    public com.google.cloud.iot.v1.GatewayListOptions getGatewayListOptions() {
      if (gatewayListOptionsBuilder_ == null) {
        return gatewayListOptions_ == null
            ? com.google.cloud.iot.v1.GatewayListOptions.getDefaultInstance()
            : gatewayListOptions_;
      } else {
        return gatewayListOptionsBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Options related to gateways.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
     */
    public Builder setGatewayListOptions(com.google.cloud.iot.v1.GatewayListOptions value) {
      if (gatewayListOptionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        gatewayListOptions_ = value;
        onChanged();
      } else {
        gatewayListOptionsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Options related to gateways.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
     */
    public Builder setGatewayListOptions(
        com.google.cloud.iot.v1.GatewayListOptions.Builder builderForValue) {
      if (gatewayListOptionsBuilder_ == null) {
        gatewayListOptions_ = builderForValue.build();
        onChanged();
      } else {
        gatewayListOptionsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Options related to gateways.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
     */
    public Builder mergeGatewayListOptions(com.google.cloud.iot.v1.GatewayListOptions value) {
      if (gatewayListOptionsBuilder_ == null) {
        if (gatewayListOptions_ != null) {
          gatewayListOptions_ =
              com.google.cloud.iot.v1.GatewayListOptions.newBuilder(gatewayListOptions_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          gatewayListOptions_ = value;
        }
        onChanged();
      } else {
        gatewayListOptionsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Options related to gateways.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
     */
    public Builder clearGatewayListOptions() {
      if (gatewayListOptionsBuilder_ == null) {
        gatewayListOptions_ = null;
        onChanged();
      } else {
        gatewayListOptions_ = null;
        gatewayListOptionsBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Options related to gateways.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
     */
    public com.google.cloud.iot.v1.GatewayListOptions.Builder getGatewayListOptionsBuilder() {

      onChanged();
      return getGatewayListOptionsFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Options related to gateways.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
     */
    public com.google.cloud.iot.v1.GatewayListOptionsOrBuilder getGatewayListOptionsOrBuilder() {
      if (gatewayListOptionsBuilder_ != null) {
        return gatewayListOptionsBuilder_.getMessageOrBuilder();
      } else {
        return gatewayListOptions_ == null
            ? com.google.cloud.iot.v1.GatewayListOptions.getDefaultInstance()
            : gatewayListOptions_;
      }
    }
    /**
     *
     *
     * <pre>
     * Options related to gateways.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.GatewayListOptions gateway_list_options = 6;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.GatewayListOptions,
            com.google.cloud.iot.v1.GatewayListOptions.Builder,
            com.google.cloud.iot.v1.GatewayListOptionsOrBuilder>
        getGatewayListOptionsFieldBuilder() {
      if (gatewayListOptionsBuilder_ == null) {
        gatewayListOptionsBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.iot.v1.GatewayListOptions,
                com.google.cloud.iot.v1.GatewayListOptions.Builder,
                com.google.cloud.iot.v1.GatewayListOptionsOrBuilder>(
                getGatewayListOptions(), getParentForChildren(), isClean());
        gatewayListOptions_ = null;
      }
      return gatewayListOptionsBuilder_;
    }

    private int pageSize_;
    /**
     *
     *
     * <pre>
     * The maximum number of devices to return in the response. If this value
     * is zero, the service will select a default size. A call may return fewer
     * objects than requested. A non-empty `next_page_token` in the response
     * indicates that more data is available.
     * </pre>
     *
     * <code>int32 page_size = 100;</code>
     *
     * @return The pageSize.
     */
    @java.lang.Override
    public int getPageSize() {
      return pageSize_;
    }
    /**
     *
     *
     * <pre>
     * The maximum number of devices to return in the response. If this value
     * is zero, the service will select a default size. A call may return fewer
     * objects than requested. A non-empty `next_page_token` in the response
     * indicates that more data is available.
     * </pre>
     *
     * <code>int32 page_size = 100;</code>
     *
     * @param value The pageSize to set.
     * @return This builder for chaining.
     */
    public Builder setPageSize(int value) {

      pageSize_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The maximum number of devices to return in the response. If this value
     * is zero, the service will select a default size. A call may return fewer
     * objects than requested. A non-empty `next_page_token` in the response
     * indicates that more data is available.
     * </pre>
     *
     * <code>int32 page_size = 100;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPageSize() {

      pageSize_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object pageToken_ = "";
    /**
     *
     *
     * <pre>
     * The value returned by the last `ListDevicesResponse`; indicates
     * that this is a continuation of a prior `ListDevices` call and
     * the system should return the next page of data.
     * </pre>
     *
     * <code>string page_token = 101;</code>
     *
     * @return The pageToken.
     */
    public java.lang.String getPageToken() {
      java.lang.Object ref = pageToken_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        pageToken_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The value returned by the last `ListDevicesResponse`; indicates
     * that this is a continuation of a prior `ListDevices` call and
     * the system should return the next page of data.
     * </pre>
     *
     * <code>string page_token = 101;</code>
     *
     * @return The bytes for pageToken.
     */
    public com.google.protobuf.ByteString getPageTokenBytes() {
      java.lang.Object ref = pageToken_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        pageToken_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The value returned by the last `ListDevicesResponse`; indicates
     * that this is a continuation of a prior `ListDevices` call and
     * the system should return the next page of data.
     * </pre>
     *
     * <code>string page_token = 101;</code>
     *
     * @param value The pageToken to set.
     * @return This builder for chaining.
     */
    public Builder setPageToken(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      pageToken_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The value returned by the last `ListDevicesResponse`; indicates
     * that this is a continuation of a prior `ListDevices` call and
     * the system should return the next page of data.
     * </pre>
     *
     * <code>string page_token = 101;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPageToken() {

      pageToken_ = getDefaultInstance().getPageToken();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The value returned by the last `ListDevicesResponse`; indicates
     * that this is a continuation of a prior `ListDevices` call and
     * the system should return the next page of data.
     * </pre>
     *
     * <code>string page_token = 101;</code>
     *
     * @param value The bytes for pageToken to set.
     * @return This builder for chaining.
     */
    public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      pageToken_ = value;
      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.ListDevicesRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<ListDevicesRequest> PARSER =
      new com.google.protobuf.AbstractParser<ListDevicesRequest>() {
        @java.lang.Override
        public ListDevicesRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ListDevicesRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.ListDevicesRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class ListDevicesResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.ListDevicesResponse)
    ListDevicesResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ListDevicesResponse.newBuilder() to construct.
  private ListDevicesResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ListDevicesResponse() {
    devices_ = java.util.Collections.emptyList();
    nextPageToken_ = "";
  }

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

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

  private ListDevicesResponse(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                devices_ = new java.util.ArrayList<com.google.cloud.iot.v1.Device>();
                mutable_bitField0_ |= 0x00000001;
              }
              devices_.add(
                  input.readMessage(com.google.cloud.iot.v1.Device.parser(), extensionRegistry));
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

              nextPageToken_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        devices_ = java.util.Collections.unmodifiableList(devices_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_ListDevicesResponse_descriptor;
  }

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

  public static final int DEVICES_FIELD_NUMBER = 1;
  private java.util.List<com.google.cloud.iot.v1.Device> devices_;
  /**
   *
   *
   * <pre>
   * The devices that match the request.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.iot.v1.Device> getDevicesList() {
    return devices_;
  }
  /**
   *
   *
   * <pre>
   * The devices that match the request.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.iot.v1.DeviceOrBuilder>
      getDevicesOrBuilderList() {
    return devices_;
  }
  /**
   *
   *
   * <pre>
   * The devices that match the request.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
   */
  @java.lang.Override
  public int getDevicesCount() {
    return devices_.size();
  }
  /**
   *
   *
   * <pre>
   * The devices that match the request.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.Device getDevices(int index) {
    return devices_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The devices that match the request.
   * </pre>
   *
   * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceOrBuilder getDevicesOrBuilder(int index) {
    return devices_.get(index);
  }

  public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2;
  private volatile java.lang.Object nextPageToken_;
  /**
   *
   *
   * <pre>
   * If not empty, indicates that there may be more devices that match the
   * request; this value should be passed in a new `ListDevicesRequest`.
   * </pre>
   *
   * <code>string next_page_token = 2;</code>
   *
   * @return The nextPageToken.
   */
  @java.lang.Override
  public java.lang.String getNextPageToken() {
    java.lang.Object ref = nextPageToken_;
    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();
      nextPageToken_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * If not empty, indicates that there may be more devices that match the
   * request; this value should be passed in a new `ListDevicesRequest`.
   * </pre>
   *
   * <code>string next_page_token = 2;</code>
   *
   * @return The bytes for nextPageToken.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNextPageTokenBytes() {
    java.lang.Object ref = nextPageToken_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      nextPageToken_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    for (int i = 0; i < devices_.size(); i++) {
      output.writeMessage(1, devices_.get(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    for (int i = 0; i < devices_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, devices_.get(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
    }
    size += unknownFields.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.ListDevicesResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.ListDevicesResponse other =
        (com.google.cloud.iot.v1.ListDevicesResponse) obj;

    if (!getDevicesList().equals(other.getDevicesList())) return false;
    if (!getNextPageToken().equals(other.getNextPageToken())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getDevicesCount() > 0) {
      hash = (37 * hash) + DEVICES_FIELD_NUMBER;
      hash = (53 * hash) + getDevicesList().hashCode();
    }
    hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER;
    hash = (53 * hash) + getNextPageToken().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.ListDevicesResponse 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.ListDevicesResponse 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.ListDevicesResponse 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.ListDevicesResponse 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>
   * Response for `ListDevices`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.ListDevicesResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.ListDevicesResponse)
      com.google.cloud.iot.v1.ListDevicesResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_ListDevicesResponse_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
        getDevicesFieldBuilder();
      }
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (devicesBuilder_ == null) {
        devices_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        devicesBuilder_.clear();
      }
      nextPageToken_ = "";

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.ListDevicesResponse buildPartial() {
      com.google.cloud.iot.v1.ListDevicesResponse result =
          new com.google.cloud.iot.v1.ListDevicesResponse(this);
      int from_bitField0_ = bitField0_;
      if (devicesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          devices_ = java.util.Collections.unmodifiableList(devices_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.devices_ = devices_;
      } else {
        result.devices_ = devicesBuilder_.build();
      }
      result.nextPageToken_ = nextPageToken_;
      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.cloud.iot.v1.ListDevicesResponse) {
        return mergeFrom((com.google.cloud.iot.v1.ListDevicesResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.ListDevicesResponse other) {
      if (other == com.google.cloud.iot.v1.ListDevicesResponse.getDefaultInstance()) return this;
      if (devicesBuilder_ == null) {
        if (!other.devices_.isEmpty()) {
          if (devices_.isEmpty()) {
            devices_ = other.devices_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureDevicesIsMutable();
            devices_.addAll(other.devices_);
          }
          onChanged();
        }
      } else {
        if (!other.devices_.isEmpty()) {
          if (devicesBuilder_.isEmpty()) {
            devicesBuilder_.dispose();
            devicesBuilder_ = null;
            devices_ = other.devices_;
            bitField0_ = (bitField0_ & ~0x00000001);
            devicesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getDevicesFieldBuilder()
                    : null;
          } else {
            devicesBuilder_.addAllMessages(other.devices_);
          }
        }
      }
      if (!other.getNextPageToken().isEmpty()) {
        nextPageToken_ = other.nextPageToken_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.ListDevicesResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.ListDevicesResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.util.List<com.google.cloud.iot.v1.Device> devices_ =
        java.util.Collections.emptyList();

    private void ensureDevicesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        devices_ = new java.util.ArrayList<com.google.cloud.iot.v1.Device>(devices_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.Device,
            com.google.cloud.iot.v1.Device.Builder,
            com.google.cloud.iot.v1.DeviceOrBuilder>
        devicesBuilder_;

    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.Device> getDevicesList() {
      if (devicesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(devices_);
      } else {
        return devicesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public int getDevicesCount() {
      if (devicesBuilder_ == null) {
        return devices_.size();
      } else {
        return devicesBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public com.google.cloud.iot.v1.Device getDevices(int index) {
      if (devicesBuilder_ == null) {
        return devices_.get(index);
      } else {
        return devicesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public Builder setDevices(int index, com.google.cloud.iot.v1.Device value) {
      if (devicesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDevicesIsMutable();
        devices_.set(index, value);
        onChanged();
      } else {
        devicesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public Builder setDevices(int index, com.google.cloud.iot.v1.Device.Builder builderForValue) {
      if (devicesBuilder_ == null) {
        ensureDevicesIsMutable();
        devices_.set(index, builderForValue.build());
        onChanged();
      } else {
        devicesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public Builder addDevices(com.google.cloud.iot.v1.Device value) {
      if (devicesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDevicesIsMutable();
        devices_.add(value);
        onChanged();
      } else {
        devicesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public Builder addDevices(int index, com.google.cloud.iot.v1.Device value) {
      if (devicesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDevicesIsMutable();
        devices_.add(index, value);
        onChanged();
      } else {
        devicesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public Builder addDevices(com.google.cloud.iot.v1.Device.Builder builderForValue) {
      if (devicesBuilder_ == null) {
        ensureDevicesIsMutable();
        devices_.add(builderForValue.build());
        onChanged();
      } else {
        devicesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public Builder addDevices(int index, com.google.cloud.iot.v1.Device.Builder builderForValue) {
      if (devicesBuilder_ == null) {
        ensureDevicesIsMutable();
        devices_.add(index, builderForValue.build());
        onChanged();
      } else {
        devicesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public Builder addAllDevices(
        java.lang.Iterable<? extends com.google.cloud.iot.v1.Device> values) {
      if (devicesBuilder_ == null) {
        ensureDevicesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, devices_);
        onChanged();
      } else {
        devicesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public Builder clearDevices() {
      if (devicesBuilder_ == null) {
        devices_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        devicesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public Builder removeDevices(int index) {
      if (devicesBuilder_ == null) {
        ensureDevicesIsMutable();
        devices_.remove(index);
        onChanged();
      } else {
        devicesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public com.google.cloud.iot.v1.Device.Builder getDevicesBuilder(int index) {
      return getDevicesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public com.google.cloud.iot.v1.DeviceOrBuilder getDevicesOrBuilder(int index) {
      if (devicesBuilder_ == null) {
        return devices_.get(index);
      } else {
        return devicesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public java.util.List<? extends com.google.cloud.iot.v1.DeviceOrBuilder>
        getDevicesOrBuilderList() {
      if (devicesBuilder_ != null) {
        return devicesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(devices_);
      }
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public com.google.cloud.iot.v1.Device.Builder addDevicesBuilder() {
      return getDevicesFieldBuilder()
          .addBuilder(com.google.cloud.iot.v1.Device.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public com.google.cloud.iot.v1.Device.Builder addDevicesBuilder(int index) {
      return getDevicesFieldBuilder()
          .addBuilder(index, com.google.cloud.iot.v1.Device.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The devices that match the request.
     * </pre>
     *
     * <code>repeated .google.cloud.iot.v1.Device devices = 1;</code>
     */
    public java.util.List<com.google.cloud.iot.v1.Device.Builder> getDevicesBuilderList() {
      return getDevicesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.iot.v1.Device,
            com.google.cloud.iot.v1.Device.Builder,
            com.google.cloud.iot.v1.DeviceOrBuilder>
        getDevicesFieldBuilder() {
      if (devicesBuilder_ == null) {
        devicesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.iot.v1.Device,
                com.google.cloud.iot.v1.Device.Builder,
                com.google.cloud.iot.v1.DeviceOrBuilder>(
                devices_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
        devices_ = null;
      }
      return devicesBuilder_;
    }

    private java.lang.Object nextPageToken_ = "";
    /**
     *
     *
     * <pre>
     * If not empty, indicates that there may be more devices that match the
     * request; this value should be passed in a new `ListDevicesRequest`.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     *
     * @return The nextPageToken.
     */
    public java.lang.String getNextPageToken() {
      java.lang.Object ref = nextPageToken_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        nextPageToken_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * If not empty, indicates that there may be more devices that match the
     * request; this value should be passed in a new `ListDevicesRequest`.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     *
     * @return The bytes for nextPageToken.
     */
    public com.google.protobuf.ByteString getNextPageTokenBytes() {
      java.lang.Object ref = nextPageToken_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        nextPageToken_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * If not empty, indicates that there may be more devices that match the
     * request; this value should be passed in a new `ListDevicesRequest`.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     *
     * @param value The nextPageToken to set.
     * @return This builder for chaining.
     */
    public Builder setNextPageToken(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      nextPageToken_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If not empty, indicates that there may be more devices that match the
     * request; this value should be passed in a new `ListDevicesRequest`.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearNextPageToken() {

      nextPageToken_ = getDefaultInstance().getNextPageToken();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If not empty, indicates that there may be more devices that match the
     * request; this value should be passed in a new `ListDevicesRequest`.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     *
     * @param value The bytes for nextPageToken to set.
     * @return This builder for chaining.
     */
    public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      nextPageToken_ = value;
      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.ListDevicesResponse)
  }

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

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

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

  private static final com.google.protobuf.Parser<ListDevicesResponse> PARSER =
      new com.google.protobuf.AbstractParser<ListDevicesResponse>() {
        @java.lang.Override
        public ListDevicesResponse parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ListDevicesResponse(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.ListDevicesResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class ModifyCloudToDeviceConfigRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest)
    ModifyCloudToDeviceConfigRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ModifyCloudToDeviceConfigRequest.newBuilder() to construct.
  private ModifyCloudToDeviceConfigRequest(
      com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ModifyCloudToDeviceConfigRequest() {
    name_ = "";
    binaryData_ = com.google.protobuf.ByteString.EMPTY;
  }

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

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

  private ModifyCloudToDeviceConfigRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          case 16:
            {
              versionToUpdate_ = input.readInt64();
              break;
            }
          case 26:
            {
              binaryData_ = input.readBytes();
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_ModifyCloudToDeviceConfigRequest_descriptor;
  }

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

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * Required. The name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 VERSION_TO_UPDATE_FIELD_NUMBER = 2;
  private long versionToUpdate_;
  /**
   *
   *
   * <pre>
   * The version number to update. If this value is zero, it will not check the
   * version number of the server and will always update the current version;
   * otherwise, this update will fail if the version number found on the server
   * does not match this version number. This is used to support multiple
   * simultaneous updates without losing data.
   * </pre>
   *
   * <code>int64 version_to_update = 2;</code>
   *
   * @return The versionToUpdate.
   */
  @java.lang.Override
  public long getVersionToUpdate() {
    return versionToUpdate_;
  }

  public static final int BINARY_DATA_FIELD_NUMBER = 3;
  private com.google.protobuf.ByteString binaryData_;
  /**
   *
   *
   * <pre>
   * Required. The configuration data for the device.
   * </pre>
   *
   * <code>bytes binary_data = 3 [(.google.api.field_behavior) = REQUIRED];</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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (versionToUpdate_ != 0L) {
      output.writeInt64(2, versionToUpdate_);
    }
    if (!binaryData_.isEmpty()) {
      output.writeBytes(3, binaryData_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (versionToUpdate_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, versionToUpdate_);
    }
    if (!binaryData_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, binaryData_);
    }
    size += unknownFields.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.ModifyCloudToDeviceConfigRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest other =
        (com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest) obj;

    if (!getName().equals(other.getName())) return false;
    if (getVersionToUpdate() != other.getVersionToUpdate()) return false;
    if (!getBinaryData().equals(other.getBinaryData())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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();
    hash = (37 * hash) + VERSION_TO_UPDATE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getVersionToUpdate());
    hash = (37 * hash) + BINARY_DATA_FIELD_NUMBER;
    hash = (53 * hash) + getBinaryData().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest 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.ModifyCloudToDeviceConfigRequest 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.ModifyCloudToDeviceConfigRequest 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.ModifyCloudToDeviceConfigRequest 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>
   * Request for `ModifyCloudToDeviceConfig`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest)
      com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_ModifyCloudToDeviceConfigRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      versionToUpdate_ = 0L;

      binaryData_ = com.google.protobuf.ByteString.EMPTY;

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest buildPartial() {
      com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest result =
          new com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest(this);
      result.name_ = name_;
      result.versionToUpdate_ = versionToUpdate_;
      result.binaryData_ = binaryData_;
      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.cloud.iot.v1.ModifyCloudToDeviceConfigRequest) {
        return mergeFrom((com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest other) {
      if (other == com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest.getDefaultInstance())
        return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.getVersionToUpdate() != 0L) {
        setVersionToUpdate(other.getVersionToUpdate());
      }
      if (other.getBinaryData() != com.google.protobuf.ByteString.EMPTY) {
        setBinaryData(other.getBinaryData());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }

    private long versionToUpdate_;
    /**
     *
     *
     * <pre>
     * The version number to update. If this value is zero, it will not check the
     * version number of the server and will always update the current version;
     * otherwise, this update will fail if the version number found on the server
     * does not match this version number. This is used to support multiple
     * simultaneous updates without losing data.
     * </pre>
     *
     * <code>int64 version_to_update = 2;</code>
     *
     * @return The versionToUpdate.
     */
    @java.lang.Override
    public long getVersionToUpdate() {
      return versionToUpdate_;
    }
    /**
     *
     *
     * <pre>
     * The version number to update. If this value is zero, it will not check the
     * version number of the server and will always update the current version;
     * otherwise, this update will fail if the version number found on the server
     * does not match this version number. This is used to support multiple
     * simultaneous updates without losing data.
     * </pre>
     *
     * <code>int64 version_to_update = 2;</code>
     *
     * @param value The versionToUpdate to set.
     * @return This builder for chaining.
     */
    public Builder setVersionToUpdate(long value) {

      versionToUpdate_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The version number to update. If this value is zero, it will not check the
     * version number of the server and will always update the current version;
     * otherwise, this update will fail if the version number found on the server
     * does not match this version number. This is used to support multiple
     * simultaneous updates without losing data.
     * </pre>
     *
     * <code>int64 version_to_update = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearVersionToUpdate() {

      versionToUpdate_ = 0L;
      onChanged();
      return this;
    }

    private com.google.protobuf.ByteString binaryData_ = com.google.protobuf.ByteString.EMPTY;
    /**
     *
     *
     * <pre>
     * Required. The configuration data for the device.
     * </pre>
     *
     * <code>bytes binary_data = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The binaryData.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getBinaryData() {
      return binaryData_;
    }
    /**
     *
     *
     * <pre>
     * Required. The configuration data for the device.
     * </pre>
     *
     * <code>bytes binary_data = 3 [(.google.api.field_behavior) = REQUIRED];</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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The configuration data for the device.
     * </pre>
     *
     * <code>bytes binary_data = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearBinaryData() {

      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.ModifyCloudToDeviceConfigRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<ModifyCloudToDeviceConfigRequest> PARSER =
      new com.google.protobuf.AbstractParser<ModifyCloudToDeviceConfigRequest>() {
        @java.lang.Override
        public ModifyCloudToDeviceConfigRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ModifyCloudToDeviceConfigRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class SendCommandToDeviceRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.SendCommandToDeviceRequest)
    SendCommandToDeviceRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SendCommandToDeviceRequest.newBuilder() to construct.
  private SendCommandToDeviceRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SendCommandToDeviceRequest() {
    name_ = "";
    binaryData_ = com.google.protobuf.ByteString.EMPTY;
    subfolder_ = "";
  }

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

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

  private SendCommandToDeviceRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          case 18:
            {
              binaryData_ = input.readBytes();
              break;
            }
          case 26:
            {
              java.lang.String s = input.readStringRequireUtf8();

              subfolder_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_SendCommandToDeviceRequest_descriptor;
  }

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

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * Required. The name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 name of the device. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </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 BINARY_DATA_FIELD_NUMBER = 2;
  private com.google.protobuf.ByteString binaryData_;
  /**
   *
   *
   * <pre>
   * Required. The command data to send to the device.
   * </pre>
   *
   * <code>bytes binary_data = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The binaryData.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getBinaryData() {
    return binaryData_;
  }

  public static final int SUBFOLDER_FIELD_NUMBER = 3;
  private volatile java.lang.Object subfolder_;
  /**
   *
   *
   * <pre>
   * Optional subfolder for the command. If empty, the command will be delivered
   * to the /devices/{device-id}/commands topic, otherwise it will be delivered
   * to the /devices/{device-id}/commands/{subfolder} topic. Multi-level
   * subfolders are allowed. This field must not have more than 256 characters,
   * and must not contain any MQTT wildcards ("+" or "#") or null characters.
   * </pre>
   *
   * <code>string subfolder = 3;</code>
   *
   * @return The subfolder.
   */
  @java.lang.Override
  public java.lang.String getSubfolder() {
    java.lang.Object ref = subfolder_;
    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();
      subfolder_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional subfolder for the command. If empty, the command will be delivered
   * to the /devices/{device-id}/commands topic, otherwise it will be delivered
   * to the /devices/{device-id}/commands/{subfolder} topic. Multi-level
   * subfolders are allowed. This field must not have more than 256 characters,
   * and must not contain any MQTT wildcards ("+" or "#") or null characters.
   * </pre>
   *
   * <code>string subfolder = 3;</code>
   *
   * @return The bytes for subfolder.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getSubfolderBytes() {
    java.lang.Object ref = subfolder_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      subfolder_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (!binaryData_.isEmpty()) {
      output.writeBytes(2, binaryData_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subfolder_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, subfolder_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (!binaryData_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, binaryData_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subfolder_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, subfolder_);
    }
    size += unknownFields.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.SendCommandToDeviceRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.SendCommandToDeviceRequest other =
        (com.google.cloud.iot.v1.SendCommandToDeviceRequest) obj;

    if (!getName().equals(other.getName())) return false;
    if (!getBinaryData().equals(other.getBinaryData())) return false;
    if (!getSubfolder().equals(other.getSubfolder())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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();
    hash = (37 * hash) + BINARY_DATA_FIELD_NUMBER;
    hash = (53 * hash) + getBinaryData().hashCode();
    hash = (37 * hash) + SUBFOLDER_FIELD_NUMBER;
    hash = (53 * hash) + getSubfolder().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.SendCommandToDeviceRequest 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.SendCommandToDeviceRequest 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.SendCommandToDeviceRequest 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.SendCommandToDeviceRequest 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>
   * Request for `SendCommandToDevice`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.SendCommandToDeviceRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.SendCommandToDeviceRequest)
      com.google.cloud.iot.v1.SendCommandToDeviceRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_SendCommandToDeviceRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      binaryData_ = com.google.protobuf.ByteString.EMPTY;

      subfolder_ = "";

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.SendCommandToDeviceRequest buildPartial() {
      com.google.cloud.iot.v1.SendCommandToDeviceRequest result =
          new com.google.cloud.iot.v1.SendCommandToDeviceRequest(this);
      result.name_ = name_;
      result.binaryData_ = binaryData_;
      result.subfolder_ = subfolder_;
      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.cloud.iot.v1.SendCommandToDeviceRequest) {
        return mergeFrom((com.google.cloud.iot.v1.SendCommandToDeviceRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.SendCommandToDeviceRequest other) {
      if (other == com.google.cloud.iot.v1.SendCommandToDeviceRequest.getDefaultInstance())
        return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.getBinaryData() != com.google.protobuf.ByteString.EMPTY) {
        setBinaryData(other.getBinaryData());
      }
      if (!other.getSubfolder().isEmpty()) {
        subfolder_ = other.subfolder_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.SendCommandToDeviceRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.SendCommandToDeviceRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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 name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the device. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </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;
      onChanged();
      return this;
    }

    private com.google.protobuf.ByteString binaryData_ = com.google.protobuf.ByteString.EMPTY;
    /**
     *
     *
     * <pre>
     * Required. The command data to send to the device.
     * </pre>
     *
     * <code>bytes binary_data = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The binaryData.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getBinaryData() {
      return binaryData_;
    }
    /**
     *
     *
     * <pre>
     * Required. The command data to send to the device.
     * </pre>
     *
     * <code>bytes binary_data = 2 [(.google.api.field_behavior) = REQUIRED];</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;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The command data to send to the device.
     * </pre>
     *
     * <code>bytes binary_data = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearBinaryData() {

      binaryData_ = getDefaultInstance().getBinaryData();
      onChanged();
      return this;
    }

    private java.lang.Object subfolder_ = "";
    /**
     *
     *
     * <pre>
     * Optional subfolder for the command. If empty, the command will be delivered
     * to the /devices/{device-id}/commands topic, otherwise it will be delivered
     * to the /devices/{device-id}/commands/{subfolder} topic. Multi-level
     * subfolders are allowed. This field must not have more than 256 characters,
     * and must not contain any MQTT wildcards ("+" or "#") or null characters.
     * </pre>
     *
     * <code>string subfolder = 3;</code>
     *
     * @return The subfolder.
     */
    public java.lang.String getSubfolder() {
      java.lang.Object ref = subfolder_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        subfolder_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional subfolder for the command. If empty, the command will be delivered
     * to the /devices/{device-id}/commands topic, otherwise it will be delivered
     * to the /devices/{device-id}/commands/{subfolder} topic. Multi-level
     * subfolders are allowed. This field must not have more than 256 characters,
     * and must not contain any MQTT wildcards ("+" or "#") or null characters.
     * </pre>
     *
     * <code>string subfolder = 3;</code>
     *
     * @return The bytes for subfolder.
     */
    public com.google.protobuf.ByteString getSubfolderBytes() {
      java.lang.Object ref = subfolder_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        subfolder_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional subfolder for the command. If empty, the command will be delivered
     * to the /devices/{device-id}/commands topic, otherwise it will be delivered
     * to the /devices/{device-id}/commands/{subfolder} topic. Multi-level
     * subfolders are allowed. This field must not have more than 256 characters,
     * and must not contain any MQTT wildcards ("+" or "#") or null characters.
     * </pre>
     *
     * <code>string subfolder = 3;</code>
     *
     * @param value The subfolder to set.
     * @return This builder for chaining.
     */
    public Builder setSubfolder(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      subfolder_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional subfolder for the command. If empty, the command will be delivered
     * to the /devices/{device-id}/commands topic, otherwise it will be delivered
     * to the /devices/{device-id}/commands/{subfolder} topic. Multi-level
     * subfolders are allowed. This field must not have more than 256 characters,
     * and must not contain any MQTT wildcards ("+" or "#") or null characters.
     * </pre>
     *
     * <code>string subfolder = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSubfolder() {

      subfolder_ = getDefaultInstance().getSubfolder();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional subfolder for the command. If empty, the command will be delivered
     * to the /devices/{device-id}/commands topic, otherwise it will be delivered
     * to the /devices/{device-id}/commands/{subfolder} topic. Multi-level
     * subfolders are allowed. This field must not have more than 256 characters,
     * and must not contain any MQTT wildcards ("+" or "#") or null characters.
     * </pre>
     *
     * <code>string subfolder = 3;</code>
     *
     * @param value The bytes for subfolder to set.
     * @return This builder for chaining.
     */
    public Builder setSubfolderBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      subfolder_ = value;
      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.SendCommandToDeviceRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<SendCommandToDeviceRequest> PARSER =
      new com.google.protobuf.AbstractParser<SendCommandToDeviceRequest>() {
        @java.lang.Override
        public SendCommandToDeviceRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new SendCommandToDeviceRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.SendCommandToDeviceRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class SendCommandToDeviceResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.SendCommandToDeviceResponse)
    SendCommandToDeviceResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SendCommandToDeviceResponse.newBuilder() to construct.
  private SendCommandToDeviceResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SendCommandToDeviceResponse() {}

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

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

  private SendCommandToDeviceResponse(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_SendCommandToDeviceResponse_descriptor;
  }

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

  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 {
    unknownFields.writeTo(output);
  }

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

    size = 0;
    size += unknownFields.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.SendCommandToDeviceResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.SendCommandToDeviceResponse other =
        (com.google.cloud.iot.v1.SendCommandToDeviceResponse) obj;

    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.SendCommandToDeviceResponse 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.SendCommandToDeviceResponse 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.SendCommandToDeviceResponse 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.SendCommandToDeviceResponse 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>
   * Response for `SendCommandToDevice`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.SendCommandToDeviceResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.SendCommandToDeviceResponse)
      com.google.cloud.iot.v1.SendCommandToDeviceResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_SendCommandToDeviceResponse_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.SendCommandToDeviceResponse buildPartial() {
      com.google.cloud.iot.v1.SendCommandToDeviceResponse result =
          new com.google.cloud.iot.v1.SendCommandToDeviceResponse(this);
      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.cloud.iot.v1.SendCommandToDeviceResponse) {
        return mergeFrom((com.google.cloud.iot.v1.SendCommandToDeviceResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.SendCommandToDeviceResponse other) {
      if (other == com.google.cloud.iot.v1.SendCommandToDeviceResponse.getDefaultInstance())
        return this;
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.SendCommandToDeviceResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.SendCommandToDeviceResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      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.SendCommandToDeviceResponse)
  }

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

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

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

  private static final com.google.protobuf.Parser<SendCommandToDeviceResponse> PARSER =
      new com.google.protobuf.AbstractParser<SendCommandToDeviceResponse>() {
        @java.lang.Override
        public SendCommandToDeviceResponse parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new SendCommandToDeviceResponse(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.SendCommandToDeviceResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class UnbindDeviceFromGatewayRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.UnbindDeviceFromGatewayRequest)
    UnbindDeviceFromGatewayRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use UnbindDeviceFromGatewayRequest.newBuilder() to construct.
  private UnbindDeviceFromGatewayRequest(
      com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private UnbindDeviceFromGatewayRequest() {
    parent_ = "";
    gatewayId_ = "";
    deviceId_ = "";
  }

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

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

  private UnbindDeviceFromGatewayRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              parent_ = s;
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

              gatewayId_ = s;
              break;
            }
          case 26:
            {
              java.lang.String s = input.readStringRequireUtf8();

              deviceId_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_UnbindDeviceFromGatewayRequest_descriptor;
  }

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

  public static final int PARENT_FIELD_NUMBER = 1;
  private volatile java.lang.Object parent_;
  /**
   *
   *
   * <pre>
   * Required. The name of the registry. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The parent.
   */
  @java.lang.Override
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    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();
      parent_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The name of the registry. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int GATEWAY_ID_FIELD_NUMBER = 2;
  private volatile java.lang.Object gatewayId_;
  /**
   *
   *
   * <pre>
   * Required. The value of `gateway_id` can be either the device numeric ID or the
   * user-defined device identifier.
   * </pre>
   *
   * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The gatewayId.
   */
  @java.lang.Override
  public java.lang.String getGatewayId() {
    java.lang.Object ref = gatewayId_;
    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();
      gatewayId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The value of `gateway_id` can be either the device numeric ID or the
   * user-defined device identifier.
   * </pre>
   *
   * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for gatewayId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getGatewayIdBytes() {
    java.lang.Object ref = gatewayId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      gatewayId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DEVICE_ID_FIELD_NUMBER = 3;
  private volatile java.lang.Object deviceId_;
  /**
   *
   *
   * <pre>
   * Required. The device to disassociate from the specified gateway. The value of
   * `device_id` can be either the device numeric ID or the user-defined device
   * identifier.
   * </pre>
   *
   * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The deviceId.
   */
  @java.lang.Override
  public java.lang.String getDeviceId() {
    java.lang.Object ref = deviceId_;
    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();
      deviceId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The device to disassociate from the specified gateway. The value of
   * `device_id` can be either the device numeric ID or the user-defined device
   * identifier.
   * </pre>
   *
   * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for deviceId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDeviceIdBytes() {
    java.lang.Object ref = deviceId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      deviceId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gatewayId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, gatewayId_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deviceId_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gatewayId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, gatewayId_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, deviceId_);
    }
    size += unknownFields.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.UnbindDeviceFromGatewayRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest other =
        (com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (!getGatewayId().equals(other.getGatewayId())) return false;
    if (!getDeviceId().equals(other.getDeviceId())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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) + PARENT_FIELD_NUMBER;
    hash = (53 * hash) + getParent().hashCode();
    hash = (37 * hash) + GATEWAY_ID_FIELD_NUMBER;
    hash = (53 * hash) + getGatewayId().hashCode();
    hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER;
    hash = (53 * hash) + getDeviceId().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest 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.UnbindDeviceFromGatewayRequest 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.UnbindDeviceFromGatewayRequest 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.UnbindDeviceFromGatewayRequest 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>
   * Request for `UnbindDeviceFromGateway`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.UnbindDeviceFromGatewayRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.UnbindDeviceFromGatewayRequest)
      com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_UnbindDeviceFromGatewayRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

      gatewayId_ = "";

      deviceId_ = "";

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest buildPartial() {
      com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest result =
          new com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest(this);
      result.parent_ = parent_;
      result.gatewayId_ = gatewayId_;
      result.deviceId_ = deviceId_;
      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.cloud.iot.v1.UnbindDeviceFromGatewayRequest) {
        return mergeFrom((com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest other) {
      if (other == com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest.getDefaultInstance())
        return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        onChanged();
      }
      if (!other.getGatewayId().isEmpty()) {
        gatewayId_ = other.gatewayId_;
        onChanged();
      }
      if (!other.getDeviceId().isEmpty()) {
        deviceId_ = other.deviceId_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The parent.
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for parent.
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      parent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {

      parent_ = getDefaultInstance().getParent();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the registry. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object gatewayId_ = "";
    /**
     *
     *
     * <pre>
     * Required. The value of `gateway_id` can be either the device numeric ID or the
     * user-defined device identifier.
     * </pre>
     *
     * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The gatewayId.
     */
    public java.lang.String getGatewayId() {
      java.lang.Object ref = gatewayId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        gatewayId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The value of `gateway_id` can be either the device numeric ID or the
     * user-defined device identifier.
     * </pre>
     *
     * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for gatewayId.
     */
    public com.google.protobuf.ByteString getGatewayIdBytes() {
      java.lang.Object ref = gatewayId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        gatewayId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The value of `gateway_id` can be either the device numeric ID or the
     * user-defined device identifier.
     * </pre>
     *
     * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The gatewayId to set.
     * @return This builder for chaining.
     */
    public Builder setGatewayId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      gatewayId_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The value of `gateway_id` can be either the device numeric ID or the
     * user-defined device identifier.
     * </pre>
     *
     * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearGatewayId() {

      gatewayId_ = getDefaultInstance().getGatewayId();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The value of `gateway_id` can be either the device numeric ID or the
     * user-defined device identifier.
     * </pre>
     *
     * <code>string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for gatewayId to set.
     * @return This builder for chaining.
     */
    public Builder setGatewayIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object deviceId_ = "";
    /**
     *
     *
     * <pre>
     * Required. The device to disassociate from the specified gateway. The value of
     * `device_id` can be either the device numeric ID or the user-defined device
     * identifier.
     * </pre>
     *
     * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The deviceId.
     */
    public java.lang.String getDeviceId() {
      java.lang.Object ref = deviceId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        deviceId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The device to disassociate from the specified gateway. The value of
     * `device_id` can be either the device numeric ID or the user-defined device
     * identifier.
     * </pre>
     *
     * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for deviceId.
     */
    public com.google.protobuf.ByteString getDeviceIdBytes() {
      java.lang.Object ref = deviceId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        deviceId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The device to disassociate from the specified gateway. The value of
     * `device_id` can be either the device numeric ID or the user-defined device
     * identifier.
     * </pre>
     *
     * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The deviceId to set.
     * @return This builder for chaining.
     */
    public Builder setDeviceId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      deviceId_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device to disassociate from the specified gateway. The value of
     * `device_id` can be either the device numeric ID or the user-defined device
     * identifier.
     * </pre>
     *
     * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDeviceId() {

      deviceId_ = getDefaultInstance().getDeviceId();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The device to disassociate from the specified gateway. The value of
     * `device_id` can be either the device numeric ID or the user-defined device
     * identifier.
     * </pre>
     *
     * <code>string device_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for deviceId to set.
     * @return This builder for chaining.
     */
    public Builder setDeviceIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      deviceId_ = value;
      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.UnbindDeviceFromGatewayRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<UnbindDeviceFromGatewayRequest> PARSER =
      new com.google.protobuf.AbstractParser<UnbindDeviceFromGatewayRequest>() {
        @java.lang.Override
        public UnbindDeviceFromGatewayRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new UnbindDeviceFromGatewayRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class UnbindDeviceFromGatewayResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.UnbindDeviceFromGatewayResponse)
    UnbindDeviceFromGatewayResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use UnbindDeviceFromGatewayResponse.newBuilder() to construct.
  private UnbindDeviceFromGatewayResponse(
      com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private UnbindDeviceFromGatewayResponse() {}

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

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

  private UnbindDeviceFromGatewayResponse(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_UnbindDeviceFromGatewayResponse_descriptor;
  }

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

  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 {
    unknownFields.writeTo(output);
  }

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

    size = 0;
    size += unknownFields.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.UnbindDeviceFromGatewayResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse other =
        (com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse) obj;

    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse 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.UnbindDeviceFromGatewayResponse 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.UnbindDeviceFromGatewayResponse 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.UnbindDeviceFromGatewayResponse 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>
   * Response for `UnbindDeviceFromGateway`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.UnbindDeviceFromGatewayResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.UnbindDeviceFromGatewayResponse)
      com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_UnbindDeviceFromGatewayResponse_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

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

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse buildPartial() {
      com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse result =
          new com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse(this);
      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.cloud.iot.v1.UnbindDeviceFromGatewayResponse) {
        return mergeFrom((com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse other) {
      if (other == com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse.getDefaultInstance())
        return this;
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      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.UnbindDeviceFromGatewayResponse)
  }

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

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

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

  private static final com.google.protobuf.Parser<UnbindDeviceFromGatewayResponse> PARSER =
      new com.google.protobuf.AbstractParser<UnbindDeviceFromGatewayResponse>() {
        @java.lang.Override
        public UnbindDeviceFromGatewayResponse parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new UnbindDeviceFromGatewayResponse(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class UpdateDeviceRegistryRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.UpdateDeviceRegistryRequest)
    UpdateDeviceRegistryRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use UpdateDeviceRegistryRequest.newBuilder() to construct.
  private UpdateDeviceRegistryRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private UpdateDeviceRegistryRequest() {}

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

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

  private UpdateDeviceRegistryRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              com.google.cloud.iot.v1.DeviceRegistry.Builder subBuilder = null;
              if (deviceRegistry_ != null) {
                subBuilder = deviceRegistry_.toBuilder();
              }
              deviceRegistry_ =
                  input.readMessage(
                      com.google.cloud.iot.v1.DeviceRegistry.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(deviceRegistry_);
                deviceRegistry_ = subBuilder.buildPartial();
              }

              break;
            }
          case 18:
            {
              com.google.protobuf.FieldMask.Builder subBuilder = null;
              if (updateMask_ != null) {
                subBuilder = updateMask_.toBuilder();
              }
              updateMask_ =
                  input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(updateMask_);
                updateMask_ = subBuilder.buildPartial();
              }

              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_UpdateDeviceRegistryRequest_descriptor;
  }

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

  public static final int DEVICE_REGISTRY_FIELD_NUMBER = 1;
  private com.google.cloud.iot.v1.DeviceRegistry deviceRegistry_;
  /**
   *
   *
   * <pre>
   * Required. The new values for the device registry. The `id` field must be empty, and
   * the `name` field must indicate the path of the resource. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return Whether the deviceRegistry field is set.
   */
  @java.lang.Override
  public boolean hasDeviceRegistry() {
    return deviceRegistry_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. The new values for the device registry. The `id` field must be empty, and
   * the `name` field must indicate the path of the resource. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The deviceRegistry.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceRegistry getDeviceRegistry() {
    return deviceRegistry_ == null
        ? com.google.cloud.iot.v1.DeviceRegistry.getDefaultInstance()
        : deviceRegistry_;
  }
  /**
   *
   *
   * <pre>
   * Required. The new values for the device registry. The `id` field must be empty, and
   * the `name` field must indicate the path of the resource. For example,
   * `projects/example-project/locations/us-central1/registries/my-registry`.
   * </pre>
   *
   * <code>
   * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceRegistryOrBuilder getDeviceRegistryOrBuilder() {
    return getDeviceRegistry();
  }

  public static final int UPDATE_MASK_FIELD_NUMBER = 2;
  private com.google.protobuf.FieldMask updateMask_;
  /**
   *
   *
   * <pre>
   * Required. Only updates the `device_registry` fields indicated by this mask.
   * The field mask must not be empty, and it must not contain fields that
   * are immutable or only set by the server.
   * Mutable top-level fields: `event_notification_config`, `http_config`,
   * `mqtt_config`, and `state_notification_config`.
   * </pre>
   *
   * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return Whether the updateMask field is set.
   */
  @java.lang.Override
  public boolean hasUpdateMask() {
    return updateMask_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. Only updates the `device_registry` fields indicated by this mask.
   * The field mask must not be empty, and it must not contain fields that
   * are immutable or only set by the server.
   * Mutable top-level fields: `event_notification_config`, `http_config`,
   * `mqtt_config`, and `state_notification_config`.
   * </pre>
   *
   * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The updateMask.
   */
  @java.lang.Override
  public com.google.protobuf.FieldMask getUpdateMask() {
    return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_;
  }
  /**
   *
   *
   * <pre>
   * Required. Only updates the `device_registry` fields indicated by this mask.
   * The field mask must not be empty, and it must not contain fields that
   * are immutable or only set by the server.
   * Mutable top-level fields: `event_notification_config`, `http_config`,
   * `mqtt_config`, and `state_notification_config`.
   * </pre>
   *
   * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
    return getUpdateMask();
  }

  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 (deviceRegistry_ != null) {
      output.writeMessage(1, getDeviceRegistry());
    }
    if (updateMask_ != null) {
      output.writeMessage(2, getUpdateMask());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (deviceRegistry_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDeviceRegistry());
    }
    if (updateMask_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask());
    }
    size += unknownFields.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.UpdateDeviceRegistryRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.UpdateDeviceRegistryRequest other =
        (com.google.cloud.iot.v1.UpdateDeviceRegistryRequest) obj;

    if (hasDeviceRegistry() != other.hasDeviceRegistry()) return false;
    if (hasDeviceRegistry()) {
      if (!getDeviceRegistry().equals(other.getDeviceRegistry())) return false;
    }
    if (hasUpdateMask() != other.hasUpdateMask()) return false;
    if (hasUpdateMask()) {
      if (!getUpdateMask().equals(other.getUpdateMask())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasDeviceRegistry()) {
      hash = (37 * hash) + DEVICE_REGISTRY_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceRegistry().hashCode();
    }
    if (hasUpdateMask()) {
      hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER;
      hash = (53 * hash) + getUpdateMask().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.UpdateDeviceRegistryRequest 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.UpdateDeviceRegistryRequest 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.UpdateDeviceRegistryRequest 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.UpdateDeviceRegistryRequest 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>
   * Request for `UpdateDeviceRegistry`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.UpdateDeviceRegistryRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.UpdateDeviceRegistryRequest)
      com.google.cloud.iot.v1.UpdateDeviceRegistryRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_UpdateDeviceRegistryRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (deviceRegistryBuilder_ == null) {
        deviceRegistry_ = null;
      } else {
        deviceRegistry_ = null;
        deviceRegistryBuilder_ = null;
      }
      if (updateMaskBuilder_ == null) {
        updateMask_ = null;
      } else {
        updateMask_ = null;
        updateMaskBuilder_ = null;
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.UpdateDeviceRegistryRequest buildPartial() {
      com.google.cloud.iot.v1.UpdateDeviceRegistryRequest result =
          new com.google.cloud.iot.v1.UpdateDeviceRegistryRequest(this);
      if (deviceRegistryBuilder_ == null) {
        result.deviceRegistry_ = deviceRegistry_;
      } else {
        result.deviceRegistry_ = deviceRegistryBuilder_.build();
      }
      if (updateMaskBuilder_ == null) {
        result.updateMask_ = updateMask_;
      } else {
        result.updateMask_ = updateMaskBuilder_.build();
      }
      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.cloud.iot.v1.UpdateDeviceRegistryRequest) {
        return mergeFrom((com.google.cloud.iot.v1.UpdateDeviceRegistryRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.UpdateDeviceRegistryRequest other) {
      if (other == com.google.cloud.iot.v1.UpdateDeviceRegistryRequest.getDefaultInstance())
        return this;
      if (other.hasDeviceRegistry()) {
        mergeDeviceRegistry(other.getDeviceRegistry());
      }
      if (other.hasUpdateMask()) {
        mergeUpdateMask(other.getUpdateMask());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.UpdateDeviceRegistryRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.iot.v1.UpdateDeviceRegistryRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private com.google.cloud.iot.v1.DeviceRegistry deviceRegistry_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceRegistry,
            com.google.cloud.iot.v1.DeviceRegistry.Builder,
            com.google.cloud.iot.v1.DeviceRegistryOrBuilder>
        deviceRegistryBuilder_;
    /**
     *
     *
     * <pre>
     * Required. The new values for the device registry. The `id` field must be empty, and
     * the `name` field must indicate the path of the resource. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the deviceRegistry field is set.
     */
    public boolean hasDeviceRegistry() {
      return deviceRegistryBuilder_ != null || deviceRegistry_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device registry. The `id` field must be empty, and
     * the `name` field must indicate the path of the resource. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The deviceRegistry.
     */
    public com.google.cloud.iot.v1.DeviceRegistry getDeviceRegistry() {
      if (deviceRegistryBuilder_ == null) {
        return deviceRegistry_ == null
            ? com.google.cloud.iot.v1.DeviceRegistry.getDefaultInstance()
            : deviceRegistry_;
      } else {
        return deviceRegistryBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device registry. The `id` field must be empty, and
     * the `name` field must indicate the path of the resource. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setDeviceRegistry(com.google.cloud.iot.v1.DeviceRegistry value) {
      if (deviceRegistryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        deviceRegistry_ = value;
        onChanged();
      } else {
        deviceRegistryBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device registry. The `id` field must be empty, and
     * the `name` field must indicate the path of the resource. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setDeviceRegistry(
        com.google.cloud.iot.v1.DeviceRegistry.Builder builderForValue) {
      if (deviceRegistryBuilder_ == null) {
        deviceRegistry_ = builderForValue.build();
        onChanged();
      } else {
        deviceRegistryBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device registry. The `id` field must be empty, and
     * the `name` field must indicate the path of the resource. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder mergeDeviceRegistry(com.google.cloud.iot.v1.DeviceRegistry value) {
      if (deviceRegistryBuilder_ == null) {
        if (deviceRegistry_ != null) {
          deviceRegistry_ =
              com.google.cloud.iot.v1.DeviceRegistry.newBuilder(deviceRegistry_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          deviceRegistry_ = value;
        }
        onChanged();
      } else {
        deviceRegistryBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device registry. The `id` field must be empty, and
     * the `name` field must indicate the path of the resource. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder clearDeviceRegistry() {
      if (deviceRegistryBuilder_ == null) {
        deviceRegistry_ = null;
        onChanged();
      } else {
        deviceRegistry_ = null;
        deviceRegistryBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device registry. The `id` field must be empty, and
     * the `name` field must indicate the path of the resource. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.iot.v1.DeviceRegistry.Builder getDeviceRegistryBuilder() {

      onChanged();
      return getDeviceRegistryFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device registry. The `id` field must be empty, and
     * the `name` field must indicate the path of the resource. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.iot.v1.DeviceRegistryOrBuilder getDeviceRegistryOrBuilder() {
      if (deviceRegistryBuilder_ != null) {
        return deviceRegistryBuilder_.getMessageOrBuilder();
      } else {
        return deviceRegistry_ == null
            ? com.google.cloud.iot.v1.DeviceRegistry.getDefaultInstance()
            : deviceRegistry_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device registry. The `id` field must be empty, and
     * the `name` field must indicate the path of the resource. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     * </pre>
     *
     * <code>
     * .google.cloud.iot.v1.DeviceRegistry device_registry = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.DeviceRegistry,
            com.google.cloud.iot.v1.DeviceRegistry.Builder,
            com.google.cloud.iot.v1.DeviceRegistryOrBuilder>
        getDeviceRegistryFieldBuilder() {
      if (deviceRegistryBuilder_ == null) {
        deviceRegistryBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.iot.v1.DeviceRegistry,
                com.google.cloud.iot.v1.DeviceRegistry.Builder,
                com.google.cloud.iot.v1.DeviceRegistryOrBuilder>(
                getDeviceRegistry(), getParentForChildren(), isClean());
        deviceRegistry_ = null;
      }
      return deviceRegistryBuilder_;
    }

    private com.google.protobuf.FieldMask updateMask_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.FieldMask,
            com.google.protobuf.FieldMask.Builder,
            com.google.protobuf.FieldMaskOrBuilder>
        updateMaskBuilder_;
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device_registry` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `event_notification_config`, `http_config`,
     * `mqtt_config`, and `state_notification_config`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the updateMask field is set.
     */
    public boolean hasUpdateMask() {
      return updateMaskBuilder_ != null || updateMask_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device_registry` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `event_notification_config`, `http_config`,
     * `mqtt_config`, and `state_notification_config`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The updateMask.
     */
    public com.google.protobuf.FieldMask getUpdateMask() {
      if (updateMaskBuilder_ == null) {
        return updateMask_ == null
            ? com.google.protobuf.FieldMask.getDefaultInstance()
            : updateMask_;
      } else {
        return updateMaskBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device_registry` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `event_notification_config`, `http_config`,
     * `mqtt_config`, and `state_notification_config`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setUpdateMask(com.google.protobuf.FieldMask value) {
      if (updateMaskBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        updateMask_ = value;
        onChanged();
      } else {
        updateMaskBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device_registry` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `event_notification_config`, `http_config`,
     * `mqtt_config`, and `state_notification_config`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) {
      if (updateMaskBuilder_ == null) {
        updateMask_ = builderForValue.build();
        onChanged();
      } else {
        updateMaskBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device_registry` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `event_notification_config`, `http_config`,
     * `mqtt_config`, and `state_notification_config`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) {
      if (updateMaskBuilder_ == null) {
        if (updateMask_ != null) {
          updateMask_ =
              com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial();
        } else {
          updateMask_ = value;
        }
        onChanged();
      } else {
        updateMaskBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device_registry` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `event_notification_config`, `http_config`,
     * `mqtt_config`, and `state_notification_config`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder clearUpdateMask() {
      if (updateMaskBuilder_ == null) {
        updateMask_ = null;
        onChanged();
      } else {
        updateMask_ = null;
        updateMaskBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device_registry` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `event_notification_config`, `http_config`,
     * `mqtt_config`, and `state_notification_config`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() {

      onChanged();
      return getUpdateMaskFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device_registry` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `event_notification_config`, `http_config`,
     * `mqtt_config`, and `state_notification_config`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
      if (updateMaskBuilder_ != null) {
        return updateMaskBuilder_.getMessageOrBuilder();
      } else {
        return updateMask_ == null
            ? com.google.protobuf.FieldMask.getDefaultInstance()
            : updateMask_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device_registry` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `event_notification_config`, `http_config`,
     * `mqtt_config`, and `state_notification_config`.
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.FieldMask,
            com.google.protobuf.FieldMask.Builder,
            com.google.protobuf.FieldMaskOrBuilder>
        getUpdateMaskFieldBuilder() {
      if (updateMaskBuilder_ == null) {
        updateMaskBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.FieldMask,
                com.google.protobuf.FieldMask.Builder,
                com.google.protobuf.FieldMaskOrBuilder>(
                getUpdateMask(), getParentForChildren(), isClean());
        updateMask_ = null;
      }
      return updateMaskBuilder_;
    }

    @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.UpdateDeviceRegistryRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<UpdateDeviceRegistryRequest> PARSER =
      new com.google.protobuf.AbstractParser<UpdateDeviceRegistryRequest>() {
        @java.lang.Override
        public UpdateDeviceRegistryRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new UpdateDeviceRegistryRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.UpdateDeviceRegistryRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class UpdateDeviceRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.UpdateDeviceRequest)
    UpdateDeviceRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use UpdateDeviceRequest.newBuilder() to construct.
  private UpdateDeviceRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private UpdateDeviceRequest() {}

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

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

  private UpdateDeviceRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 18:
            {
              com.google.cloud.iot.v1.Device.Builder subBuilder = null;
              if (device_ != null) {
                subBuilder = device_.toBuilder();
              }
              device_ =
                  input.readMessage(com.google.cloud.iot.v1.Device.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(device_);
                device_ = subBuilder.buildPartial();
              }

              break;
            }
          case 26:
            {
              com.google.protobuf.FieldMask.Builder subBuilder = null;
              if (updateMask_ != null) {
                subBuilder = updateMask_.toBuilder();
              }
              updateMask_ =
                  input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(updateMask_);
                updateMask_ = subBuilder.buildPartial();
              }

              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.iot.v1.DeviceManagerProto
        .internal_static_google_cloud_iot_v1_UpdateDeviceRequest_descriptor;
  }

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

  public static final int DEVICE_FIELD_NUMBER = 2;
  private com.google.cloud.iot.v1.Device device_;
  /**
   *
   *
   * <pre>
   * Required. The new values for the device. The `id` and `num_id` fields must
   * be empty, and the field `name` must specify the name path. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return Whether the device field is set.
   */
  @java.lang.Override
  public boolean hasDevice() {
    return device_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. The new values for the device. The `id` and `num_id` fields must
   * be empty, and the field `name` must specify the name path. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The device.
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.Device getDevice() {
    return device_ == null ? com.google.cloud.iot.v1.Device.getDefaultInstance() : device_;
  }
  /**
   *
   *
   * <pre>
   * Required. The new values for the device. The `id` and `num_id` fields must
   * be empty, and the field `name` must specify the name path. For example,
   * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
   * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   * </pre>
   *
   * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   */
  @java.lang.Override
  public com.google.cloud.iot.v1.DeviceOrBuilder getDeviceOrBuilder() {
    return getDevice();
  }

  public static final int UPDATE_MASK_FIELD_NUMBER = 3;
  private com.google.protobuf.FieldMask updateMask_;
  /**
   *
   *
   * <pre>
   * Required. Only updates the `device` fields indicated by this mask.
   * The field mask must not be empty, and it must not contain fields that
   * are immutable or only set by the server.
   * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
   * </pre>
   *
   * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return Whether the updateMask field is set.
   */
  @java.lang.Override
  public boolean hasUpdateMask() {
    return updateMask_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. Only updates the `device` fields indicated by this mask.
   * The field mask must not be empty, and it must not contain fields that
   * are immutable or only set by the server.
   * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
   * </pre>
   *
   * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The updateMask.
   */
  @java.lang.Override
  public com.google.protobuf.FieldMask getUpdateMask() {
    return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_;
  }
  /**
   *
   *
   * <pre>
   * Required. Only updates the `device` fields indicated by this mask.
   * The field mask must not be empty, and it must not contain fields that
   * are immutable or only set by the server.
   * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
   * </pre>
   *
   * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
    return getUpdateMask();
  }

  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 (device_ != null) {
      output.writeMessage(2, getDevice());
    }
    if (updateMask_ != null) {
      output.writeMessage(3, getUpdateMask());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (device_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDevice());
    }
    if (updateMask_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask());
    }
    size += unknownFields.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.UpdateDeviceRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.UpdateDeviceRequest other =
        (com.google.cloud.iot.v1.UpdateDeviceRequest) obj;

    if (hasDevice() != other.hasDevice()) return false;
    if (hasDevice()) {
      if (!getDevice().equals(other.getDevice())) return false;
    }
    if (hasUpdateMask() != other.hasUpdateMask()) return false;
    if (hasUpdateMask()) {
      if (!getUpdateMask().equals(other.getUpdateMask())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasDevice()) {
      hash = (37 * hash) + DEVICE_FIELD_NUMBER;
      hash = (53 * hash) + getDevice().hashCode();
    }
    if (hasUpdateMask()) {
      hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER;
      hash = (53 * hash) + getUpdateMask().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.iot.v1.UpdateDeviceRequest 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.UpdateDeviceRequest 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.UpdateDeviceRequest 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.UpdateDeviceRequest 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>
   * Request for `UpdateDevice`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.UpdateDeviceRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.UpdateDeviceRequest)
      com.google.cloud.iot.v1.UpdateDeviceRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.iot.v1.DeviceManagerProto
          .internal_static_google_cloud_iot_v1_UpdateDeviceRequest_descriptor;
    }

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

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (deviceBuilder_ == null) {
        device_ = null;
      } else {
        device_ = null;
        deviceBuilder_ = null;
      }
      if (updateMaskBuilder_ == null) {
        updateMask_ = null;
      } else {
        updateMask_ = null;
        updateMaskBuilder_ = null;
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.iot.v1.UpdateDeviceRequest buildPartial() {
      com.google.cloud.iot.v1.UpdateDeviceRequest result =
          new com.google.cloud.iot.v1.UpdateDeviceRequest(this);
      if (deviceBuilder_ == null) {
        result.device_ = device_;
      } else {
        result.device_ = deviceBuilder_.build();
      }
      if (updateMaskBuilder_ == null) {
        result.updateMask_ = updateMask_;
      } else {
        result.updateMask_ = updateMaskBuilder_.build();
      }
      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.cloud.iot.v1.UpdateDeviceRequest) {
        return mergeFrom((com.google.cloud.iot.v1.UpdateDeviceRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.UpdateDeviceRequest other) {
      if (other == com.google.cloud.iot.v1.UpdateDeviceRequest.getDefaultInstance()) return this;
      if (other.hasDevice()) {
        mergeDevice(other.getDevice());
      }
      if (other.hasUpdateMask()) {
        mergeUpdateMask(other.getUpdateMask());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.iot.v1.UpdateDeviceRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.iot.v1.UpdateDeviceRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private com.google.cloud.iot.v1.Device device_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.Device,
            com.google.cloud.iot.v1.Device.Builder,
            com.google.cloud.iot.v1.DeviceOrBuilder>
        deviceBuilder_;
    /**
     *
     *
     * <pre>
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the device field is set.
     */
    public boolean hasDevice() {
      return deviceBuilder_ != null || device_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The device.
     */
    public com.google.cloud.iot.v1.Device getDevice() {
      if (deviceBuilder_ == null) {
        return device_ == null ? com.google.cloud.iot.v1.Device.getDefaultInstance() : device_;
      } else {
        return deviceBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setDevice(com.google.cloud.iot.v1.Device value) {
      if (deviceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        device_ = value;
        onChanged();
      } else {
        deviceBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setDevice(com.google.cloud.iot.v1.Device.Builder builderForValue) {
      if (deviceBuilder_ == null) {
        device_ = builderForValue.build();
        onChanged();
      } else {
        deviceBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder mergeDevice(com.google.cloud.iot.v1.Device value) {
      if (deviceBuilder_ == null) {
        if (device_ != null) {
          device_ =
              com.google.cloud.iot.v1.Device.newBuilder(device_).mergeFrom(value).buildPartial();
        } else {
          device_ = value;
        }
        onChanged();
      } else {
        deviceBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder clearDevice() {
      if (deviceBuilder_ == null) {
        device_ = null;
        onChanged();
      } else {
        device_ = null;
        deviceBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.iot.v1.Device.Builder getDeviceBuilder() {

      onChanged();
      return getDeviceFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.iot.v1.DeviceOrBuilder getDeviceOrBuilder() {
      if (deviceBuilder_ != null) {
        return deviceBuilder_.getMessageOrBuilder();
      } else {
        return device_ == null ? com.google.cloud.iot.v1.Device.getDefaultInstance() : device_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     * </pre>
     *
     * <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.iot.v1.Device,
            com.google.cloud.iot.v1.Device.Builder,
            com.google.cloud.iot.v1.DeviceOrBuilder>
        getDeviceFieldBuilder() {
      if (deviceBuilder_ == null) {
        deviceBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.iot.v1.Device,
                com.google.cloud.iot.v1.Device.Builder,
                com.google.cloud.iot.v1.DeviceOrBuilder>(
                getDevice(), getParentForChildren(), isClean());
        device_ = null;
      }
      return deviceBuilder_;
    }

    private com.google.protobuf.FieldMask updateMask_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.FieldMask,
            com.google.protobuf.FieldMask.Builder,
            com.google.protobuf.FieldMaskOrBuilder>
        updateMaskBuilder_;
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the updateMask field is set.
     */
    public boolean hasUpdateMask() {
      return updateMaskBuilder_ != null || updateMask_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The updateMask.
     */
    public com.google.protobuf.FieldMask getUpdateMask() {
      if (updateMaskBuilder_ == null) {
        return updateMask_ == null
            ? com.google.protobuf.FieldMask.getDefaultInstance()
            : updateMask_;
      } else {
        return updateMaskBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setUpdateMask(com.google.protobuf.FieldMask value) {
      if (updateMaskBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        updateMask_ = value;
        onChanged();
      } else {
        updateMaskBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) {
      if (updateMaskBuilder_ == null) {
        updateMask_ = builderForValue.build();
        onChanged();
      } else {
        updateMaskBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) {
      if (updateMaskBuilder_ == null) {
        if (updateMask_ != null) {
          updateMask_ =
              com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial();
        } else {
          updateMask_ = value;
        }
        onChanged();
      } else {
        updateMaskBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder clearUpdateMask() {
      if (updateMaskBuilder_ == null) {
        updateMask_ = null;
        onChanged();
      } else {
        updateMask_ = null;
        updateMaskBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() {

      onChanged();
      return getUpdateMaskFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
      if (updateMaskBuilder_ != null) {
        return updateMaskBuilder_.getMessageOrBuilder();
      } else {
        return updateMask_ == null
            ? com.google.protobuf.FieldMask.getDefaultInstance()
            : updateMask_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.FieldMask,
            com.google.protobuf.FieldMask.Builder,
            com.google.protobuf.FieldMaskOrBuilder>
        getUpdateMaskFieldBuilder() {
      if (updateMaskBuilder_ == null) {
        updateMaskBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.FieldMask,
                com.google.protobuf.FieldMask.Builder,
                com.google.protobuf.FieldMaskOrBuilder>(
                getUpdateMask(), getParentForChildren(), isClean());
        updateMask_ = null;
      }
      return updateMaskBuilder_;
    }

    @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.UpdateDeviceRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<UpdateDeviceRequest> PARSER =
      new com.google.protobuf.AbstractParser<UpdateDeviceRequest>() {
        @java.lang.Override
        public UpdateDeviceRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new UpdateDeviceRequest(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.iot.v1.UpdateDeviceRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
import static com.google.cloud.iot.v1.DeviceManagerClient.ListDeviceRegistriesPagedResponse;
import static com.google.cloud.iot.v1.DeviceManagerClient.ListDevicesPagedResponse;
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.GaxGrpcProperties;
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.rpc.ApiCallContext;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.PagedListDescriptor;
import com.google.api.gax.rpc.PagedListResponseFactory;
import com.google.api.gax.rpc.StatusCode;
import com.google.api.gax.rpc.StubSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.iot.v1.BindDeviceToGatewayRequest;
import com.google.cloud.iot.v1.BindDeviceToGatewayResponse;
import com.google.cloud.iot.v1.CreateDeviceRegistryRequest;
import com.google.cloud.iot.v1.CreateDeviceRequest;
import com.google.cloud.iot.v1.DeleteDeviceRegistryRequest;
import com.google.cloud.iot.v1.DeleteDeviceRequest;
import com.google.cloud.iot.v1.Device;
import com.google.cloud.iot.v1.DeviceConfig;
import com.google.cloud.iot.v1.DeviceRegistry;
import com.google.cloud.iot.v1.GetDeviceRegistryRequest;
import com.google.cloud.iot.v1.GetDeviceRequest;
import com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest;
import com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse;
import com.google.cloud.iot.v1.ListDeviceRegistriesRequest;
import com.google.cloud.iot.v1.ListDeviceRegistriesResponse;
import com.google.cloud.iot.v1.ListDeviceStatesRequest;
import com.google.cloud.iot.v1.ListDeviceStatesResponse;
import com.google.cloud.iot.v1.ListDevicesRequest;
import com.google.cloud.iot.v1.ListDevicesResponse;
import com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest;
import com.google.cloud.iot.v1.SendCommandToDeviceRequest;
import com.google.cloud.iot.v1.SendCommandToDeviceResponse;
import com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest;
import com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse;
import com.google.cloud.iot.v1.UpdateDeviceRegistryRequest;
import com.google.cloud.iot.v1.UpdateDeviceRequest;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;
import org.threeten.bp.Duration;
/*
 * Copyright 2021 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.
 */

package com.google.cloud.iot.v1.stub;



// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * Settings class to configure an instance of {@link DeviceManagerStub}.
 *
 * <p>The default instance has everything set to sensible defaults:
 *
 * <ul>
 *   <li>The default service address (cloudiot.googleapis.com) and default port (443) are used.
 *   <li>Credentials are acquired automatically through Application Default Credentials.
 *   <li>Retries are configured for idempotent methods but not for non-idempotent methods.
 * </ul>
 *
 * <p>The builder of this class is recursive, so contained classes are themselves builders. When
 * build() is called, the tree of builders is called to create the complete settings object.
 *
 * <p>For example, to set the total timeout of createDeviceRegistry to 30 seconds:
 *
 * <pre>{@code
 * DeviceManagerStubSettings.Builder deviceManagerSettingsBuilder =
 *     DeviceManagerStubSettings.newBuilder();
 * deviceManagerSettingsBuilder
 *     .createDeviceRegistrySettings()
 *     .setRetrySettings(
 *         deviceManagerSettingsBuilder
 *             .createDeviceRegistrySettings()
 *             .getRetrySettings()
 *             .toBuilder()
 *             .setTotalTimeout(Duration.ofSeconds(30))
 *             .build());
 * DeviceManagerStubSettings deviceManagerSettings = deviceManagerSettingsBuilder.build();
 * }</pre>
 */
@Generated("by gapic-generator-java")
public class DeviceManagerStubSettings extends StubSettings<DeviceManagerStubSettings> {
  /** The default scopes of the service. */
  private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES =
      ImmutableList.<String>builder()
          .add("https://www.googleapis.com/auth/cloud-platform")
          .add("https://www.googleapis.com/auth/cloudiot")
          .build();

  private final UnaryCallSettings<CreateDeviceRegistryRequest, DeviceRegistry>
      createDeviceRegistrySettings;
  private final UnaryCallSettings<GetDeviceRegistryRequest, DeviceRegistry>
      getDeviceRegistrySettings;
  private final UnaryCallSettings<UpdateDeviceRegistryRequest, DeviceRegistry>
      updateDeviceRegistrySettings;
  private final UnaryCallSettings<DeleteDeviceRegistryRequest, Empty> deleteDeviceRegistrySettings;
  private final PagedCallSettings<
          ListDeviceRegistriesRequest,
          ListDeviceRegistriesResponse,
          ListDeviceRegistriesPagedResponse>
      listDeviceRegistriesSettings;
  private final UnaryCallSettings<CreateDeviceRequest, Device> createDeviceSettings;
  private final UnaryCallSettings<GetDeviceRequest, Device> getDeviceSettings;
  private final UnaryCallSettings<UpdateDeviceRequest, Device> updateDeviceSettings;