@Override public Map<String, String> extract(ListDeviceStatesRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("name", String.valueOf(request.getName())); return params.build(); } })
@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; boolean result = true; result = result && getName().equals(other.getName()); result = result && (getNumStates() == other.getNumStates()); result = result && unknownFields.equals(other.unknownFields); return result; }
@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; }
/** * * * <pre> * 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;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); 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; }
@Test @SuppressWarnings("all") public void listDeviceStatesTest() { ListDeviceStatesResponse expectedResponse = ListDeviceStatesResponse.newBuilder().build(); mockDeviceManager.addResponse(expectedResponse); DeviceName name = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]"); ListDeviceStatesResponse actualResponse = client.listDeviceStates(name); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockDeviceManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListDeviceStatesRequest actualRequest = (ListDeviceStatesRequest) actualRequests.get(0); Assert.assertEquals(name, DeviceName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@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; boolean result = true; result = result && getName().equals(other.getName()); result = result && (getNumStates() == other.getNumStates()); result = result && unknownFields.equals(other.unknownFields); return result; }
@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; }
/** * * * <pre> * 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;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); 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; }