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 = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash;
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.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();
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@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; }
/** * * * <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; } /**
/** * * * <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> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**
if (!getParentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); if (!getDeviceNumIdsList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); dataSize += computeStringSizeNoTag(deviceIds_.getRaw(i)); size += 1 * getDeviceIdsList().size(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getFieldMask()); size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getGatewayListOptions()); if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(101, pageToken_);
@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(); } })
@java.lang.Override public com.google.cloud.iot.v1.ListDevicesRequest getDefaultInstanceForType() { return com.google.cloud.iot.v1.ListDevicesRequest.getDefaultInstance(); }
@Override public Integer extractPageSize(ListDevicesRequest payload) { return payload.getPageSize(); }
@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_; int to_bitField0_ = 0;
@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; }
if (!getParentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); if (!getDeviceNumIdsList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); dataSize += computeStringSizeNoTag(deviceIds_.getRaw(i)); size += 1 * getDeviceIdsList().size(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getFieldMask()); size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getGatewayListOptions()); if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(101, pageToken_);
/** * * * <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; } /**
@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 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> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**
.setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.cloud.iot.v1.ListDevicesRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
@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_; int to_bitField0_ = 0;
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 = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash;
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.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();