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 Builder newBuilderForType() { return newBuilder(); }
@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 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; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getGatewayId().equals(other.getGatewayId()); result = result && getDeviceId().equals(other.getDeviceId()); result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * The name of the registry. For example, * `projects/example-project/locations/us-central1/registries/my-registry`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getParentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); } if (!getGatewayIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, gatewayId_); } if (!getDeviceIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deviceId_); } unknownFields.writeTo(output); }
@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; }
/** * * * <pre> * The value of `gateway_id` can be either the device numeric ID or the * user-defined device identifier. * </pre> * * <code>string gateway_id = 2;</code> */ public Builder clearGatewayId() { gatewayId_ = getDefaultInstance().getGatewayId(); onChanged(); return this; } /**
/** * * * <pre> * 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;</code> */ public Builder clearDeviceId() { deviceId_ = getDefaultInstance().getDeviceId(); onChanged(); return this; } /**
@Override public Map<String, String> extract(BindDeviceToGatewayRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } })
@java.lang.Override public com.google.cloud.iot.v1.BindDeviceToGatewayRequest getDefaultInstanceForType() { return com.google.cloud.iot.v1.BindDeviceToGatewayRequest.getDefaultInstance(); }
@Test @SuppressWarnings("all") public void bindDeviceToGatewayTest() { BindDeviceToGatewayResponse expectedResponse = BindDeviceToGatewayResponse.newBuilder().build(); mockDeviceManager.addResponse(expectedResponse); RegistryName parent = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]"); String gatewayId = "gatewayId955798774"; String deviceId = "deviceId25209764"; BindDeviceToGatewayResponse actualResponse = client.bindDeviceToGateway(parent, gatewayId, deviceId); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockDeviceManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); BindDeviceToGatewayRequest actualRequest = (BindDeviceToGatewayRequest) actualRequests.get(0); Assert.assertEquals(parent, RegistryName.parse(actualRequest.getParent())); Assert.assertEquals(gatewayId, actualRequest.getGatewayId()); Assert.assertEquals(deviceId, actualRequest.getDeviceId()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@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; }
/** * * * <pre> * The name of the registry. For example, * `projects/example-project/locations/us-central1/registries/my-registry`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getParentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); } if (!getGatewayIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, gatewayId_); } if (!getDeviceIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, deviceId_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * * * <pre> * The value of `gateway_id` can be either the device numeric ID or the * user-defined device identifier. * </pre> * * <code>string gateway_id = 2;</code> */ public Builder clearGatewayId() { gatewayId_ = getDefaultInstance().getGatewayId(); onChanged(); return this; } /**
/** * * * <pre> * 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;</code> */ public Builder clearDeviceId() { deviceId_ = getDefaultInstance().getDeviceId(); onChanged(); return this; } /**
io.grpc.protobuf.ProtoUtils.marshaller( com.google.cloud.iot.v1.BindDeviceToGatewayRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
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 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; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getGatewayId().equals(other.getGatewayId()); result = result && getDeviceId().equals(other.getDeviceId()); result = result && unknownFields.equals(other.unknownFields); return result; }