@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; boolean result = true; result = result && (hasDeviceRegistry() == other.hasDeviceRegistry()); if (hasDeviceRegistry()) { result = result && getDeviceRegistry().equals(other.getDeviceRegistry()); } result = result && (hasUpdateMask() == other.hasUpdateMask()); if (hasUpdateMask()) { result = result && getUpdateMask().equals(other.getUpdateMask()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public com.google.cloud.iot.v1.UpdateDeviceRegistryRequest getDefaultInstanceForType() { return com.google.cloud.iot.v1.UpdateDeviceRegistryRequest.getDefaultInstance(); }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@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); }
/** * * * <pre> * 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;</code> */ public com.google.cloud.iot.v1.DeviceRegistryOrBuilder getDeviceRegistryOrBuilder() { return getDeviceRegistry(); }
/** * * * <pre> * 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;</code> */ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); }
@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 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; }
@Override public Map<String, String> extract(UpdateDeviceRegistryRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put( "device_registry.name", String.valueOf(request.getDeviceRegistry().getName())); return params.build(); } })
/** * * * <pre> * 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;</code> */ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); }
@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 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; }
@Test @SuppressWarnings("all") public void updateDeviceRegistryTest() { String id = "id3355"; RegistryName name = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]"); DeviceRegistry expectedResponse = DeviceRegistry.newBuilder().setId(id).setName(name.toString()).build(); mockDeviceManager.addResponse(expectedResponse); DeviceRegistry deviceRegistry = DeviceRegistry.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); DeviceRegistry actualResponse = client.updateDeviceRegistry(deviceRegistry, updateMask); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockDeviceManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateDeviceRegistryRequest actualRequest = (UpdateDeviceRegistryRequest) actualRequests.get(0); Assert.assertEquals(deviceRegistry, actualRequest.getDeviceRegistry()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
/** * * * <pre> * 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;</code> */ public com.google.cloud.iot.v1.DeviceRegistryOrBuilder getDeviceRegistryOrBuilder() { return getDeviceRegistry(); }
io.grpc.protobuf.ProtoUtils.marshaller( com.google.cloud.iot.v1.UpdateDeviceRegistryRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
UpdateDeviceRegistryRequest.newBuilder() .setDeviceRegistry(deviceRegistry) .setUpdateMask(updateMask)
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 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); }