@Override public Map<String, String> extract(ListDevicesRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } })
/** * * * <pre> * The device registry path. Required. For example, * `projects/my-project/locations/us-central1/registries/my-registry`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
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;
@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; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getDeviceNumIdsList().equals(other.getDeviceNumIdsList()); result = result && getDeviceIdsList().equals(other.getDeviceIdsList()); result = result && (hasFieldMask() == other.hasFieldMask()); if (hasFieldMask()) { result = result && getFieldMask().equals(other.getFieldMask()); } result = result && (hasGatewayListOptions() == other.hasGatewayListOptions()); if (hasGatewayListOptions()) { result = result && getGatewayListOptions().equals(other.getGatewayListOptions()); } result = result && (getPageSize() == other.getPageSize()); result = result && getPageToken().equals(other.getPageToken()); result = result && unknownFields.equals(other.unknownFields); return result; }
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();
@Test @SuppressWarnings("all") public void listDevicesTest() { String nextPageToken = ""; Device devicesElement = Device.newBuilder().build(); List<Device> devices = Arrays.asList(devicesElement); ListDevicesResponse expectedResponse = ListDevicesResponse.newBuilder() .setNextPageToken(nextPageToken) .addAllDevices(devices) .build(); mockDeviceManager.addResponse(expectedResponse); RegistryName parent = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]"); ListDevicesPagedResponse pagedListResponse = client.listDevices(parent); List<Device> resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getDevicesList().get(0), resources.get(0)); List<GeneratedMessageV3> actualRequests = mockDeviceManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListDevicesRequest actualRequest = (ListDevicesRequest) actualRequests.get(0); Assert.assertEquals(parent, RegistryName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
/** * * * <pre> * The device registry path. Required. For example, * `projects/my-project/locations/us-central1/registries/my-registry`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
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;
@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; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getDeviceNumIdsList().equals(other.getDeviceNumIdsList()); result = result && getDeviceIdsList().equals(other.getDeviceIdsList()); result = result && (hasFieldMask() == other.hasFieldMask()); if (hasFieldMask()) { result = result && getFieldMask().equals(other.getFieldMask()); } result = result && (hasGatewayListOptions() == other.hasGatewayListOptions()); if (hasGatewayListOptions()) { result = result && getGatewayListOptions().equals(other.getGatewayListOptions()); } result = result && (getPageSize() == other.getPageSize()); result = result && getPageToken().equals(other.getPageToken()); result = result && unknownFields.equals(other.unknownFields); return result; }
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();