if (other == com.google.devtools.clouderrorreporting.v1beta1.ListGroupStatsRequest .getDefaultInstance()) return this; if (!other.getProjectName().isEmpty()) { projectName_ = other.projectName_; onChanged(); if (other.hasServiceFilter()) { mergeServiceFilter(other.getServiceFilter()); if (other.hasTimeRange()) { mergeTimeRange(other.getTimeRange()); if (other.hasTimedCountDuration()) { mergeTimedCountDuration(other.getTimedCountDuration()); setAlignmentValue(other.getAlignmentValue()); if (other.hasAlignmentTime()) { mergeAlignmentTime(other.getAlignmentTime()); setOrderValue(other.getOrderValue()); 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 com.google.devtools.clouderrorreporting.v1beta1.ListGroupStatsRequest buildPartial() { com.google.devtools.clouderrorreporting.v1beta1.ListGroupStatsRequest result = new com.google.devtools.clouderrorreporting.v1beta1.ListGroupStatsRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
result = result && getProjectName().equals(other.getProjectName()); result = result && getGroupIdList().equals(other.getGroupIdList()); result = result && (hasServiceFilter() == other.hasServiceFilter()); if (hasServiceFilter()) { result = result && getServiceFilter().equals(other.getServiceFilter()); result = result && (hasTimeRange() == other.hasTimeRange()); if (hasTimeRange()) { result = result && getTimeRange().equals(other.getTimeRange()); result = result && (hasTimedCountDuration() == other.hasTimedCountDuration()); if (hasTimedCountDuration()) { result = result && getTimedCountDuration().equals(other.getTimedCountDuration()); result = result && (hasAlignmentTime() == other.hasAlignmentTime()); if (hasAlignmentTime()) { result = result && getAlignmentTime().equals(other.getAlignmentTime()); result = result && (getPageSize() == other.getPageSize()); result = result && getPageToken().equals(other.getPageToken()); result = result && unknownFields.equals(other.unknownFields); return result;
/** * * * <pre> * [Optional] A `next_page_token` provided by a previous response. To view * additional results, pass this token along with the identical query * parameters as the first request. * </pre> * * <code>string page_token = 12;</code> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**
/** * * * <pre> * [Required] The resource name of the Google Cloud Platform project. Written * as <code>projects/</code> plus the * <a href="https://support.google.com/cloud/answer/6158840">Google Cloud * Platform project ID</a>. * Example: <code>projects/my-project-123</code>. * </pre> * * <code>string project_name = 1;</code> */ public Builder clearProjectName() { projectName_ = getDefaultInstance().getProjectName(); onChanged(); return this; } /**
if (!getProjectNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectName_); dataSize += computeStringSizeNoTag(groupId_.getRaw(i)); size += 1 * getGroupIdList().size(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getServiceFilter()); size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getTimeRange()); size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getTimedCountDuration()); size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getAlignmentTime()); size += com.google.protobuf.CodedOutputStream.computeInt32Size(11, pageSize_); if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, pageToken_);
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getProjectNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectName_); output.writeMessage(3, getServiceFilter()); output.writeMessage(5, getTimeRange()); output.writeMessage(6, getTimedCountDuration()); output.writeMessage(8, getAlignmentTime()); output.writeInt32(11, pageSize_); if (!getPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 12, pageToken_);
@Test @SuppressWarnings("all") public void listGroupStatsTest() { String nextPageToken = ""; ErrorGroupStats errorGroupStatsElement = ErrorGroupStats.newBuilder().build(); List<ErrorGroupStats> errorGroupStats = Arrays.asList(errorGroupStatsElement); ListGroupStatsResponse expectedResponse = ListGroupStatsResponse.newBuilder() .setNextPageToken(nextPageToken) .addAllErrorGroupStats(errorGroupStats) .build(); mockErrorStatsService.addResponse(expectedResponse); ProjectName projectName = ProjectName.of("[PROJECT]"); QueryTimeRange timeRange = QueryTimeRange.newBuilder().build(); ListGroupStatsPagedResponse pagedListResponse = client.listGroupStats(projectName, timeRange); List<ErrorGroupStats> resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getErrorGroupStatsList().get(0), resources.get(0)); List<GeneratedMessageV3> actualRequests = mockErrorStatsService.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListGroupStatsRequest actualRequest = (ListGroupStatsRequest) actualRequests.get(0); Assert.assertEquals(projectName, ProjectName.parse(actualRequest.getProjectName())); Assert.assertEquals(timeRange, actualRequest.getTimeRange()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@java.lang.Override public com.google.devtools.clouderrorreporting.v1beta1.ListGroupStatsRequest getDefaultInstanceForType() { return com.google.devtools.clouderrorreporting.v1beta1.ListGroupStatsRequest .getDefaultInstance(); }
/** * * * <pre> * [Optional] List data for the given time range. * If not set a default time range is used. The field time_range_begin * in the response will specify the beginning of this time range. * Only <code>ErrorGroupStats</code> with a non-zero count in the given time * range are returned, unless the request contains an explicit group_id list. * If a group_id list is given, also <code>ErrorGroupStats</code> with zero * occurrences are returned. * </pre> * * <code>.google.devtools.clouderrorreporting.v1beta1.QueryTimeRange time_range = 5;</code> */ public com.google.devtools.clouderrorreporting.v1beta1.QueryTimeRangeOrBuilder getTimeRangeOrBuilder() { return getTimeRange(); }
@Override public Integer extractPageSize(ListGroupStatsRequest payload) { return payload.getPageSize(); }
/** * * * <pre> * [Optional] Time where the timed counts shall be aligned if rounded * alignment is chosen. Default is 00:00 UTC. * </pre> * * <code>.google.protobuf.Timestamp alignment_time = 8;</code> */ public com.google.protobuf.TimestampOrBuilder getAlignmentTimeOrBuilder() { return getAlignmentTime(); }
hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PROJECT_NAME_FIELD_NUMBER; hash = (53 * hash) + getProjectName().hashCode(); if (getGroupIdCount() > 0) { hash = (37 * hash) + GROUP_ID_FIELD_NUMBER; hash = (53 * hash) + getGroupIdList().hashCode(); if (hasServiceFilter()) { hash = (37 * hash) + SERVICE_FILTER_FIELD_NUMBER; hash = (53 * hash) + getServiceFilter().hashCode(); if (hasTimeRange()) { hash = (37 * hash) + TIME_RANGE_FIELD_NUMBER; hash = (53 * hash) + getTimeRange().hashCode(); if (hasTimedCountDuration()) { hash = (37 * hash) + TIMED_COUNT_DURATION_FIELD_NUMBER; hash = (53 * hash) + getTimedCountDuration().hashCode(); if (hasAlignmentTime()) { hash = (37 * hash) + ALIGNMENT_TIME_FIELD_NUMBER; hash = (53 * hash) + getAlignmentTime().hashCode(); hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash;
if (!getProjectNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectName_); dataSize += computeStringSizeNoTag(groupId_.getRaw(i)); size += 1 * getGroupIdList().size(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getServiceFilter()); size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getTimeRange()); size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getTimedCountDuration()); size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getAlignmentTime()); size += com.google.protobuf.CodedOutputStream.computeInt32Size(11, pageSize_); if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, pageToken_);
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getProjectNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectName_); output.writeMessage(3, getServiceFilter()); output.writeMessage(5, getTimeRange()); output.writeMessage(6, getTimedCountDuration()); output.writeMessage(8, getAlignmentTime()); output.writeInt32(11, pageSize_); if (!getPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 12, pageToken_);
/** * * * <pre> * [Required] The resource name of the Google Cloud Platform project. Written * as <code>projects/</code> plus the * <a href="https://support.google.com/cloud/answer/6158840">Google Cloud * Platform project ID</a>. * Example: <code>projects/my-project-123</code>. * </pre> * * <code>string project_name = 1;</code> */ public Builder clearProjectName() { projectName_ = getDefaultInstance().getProjectName(); onChanged(); return this; } /**
/** * * * <pre> * [Optional] A `next_page_token` provided by a previous response. To view * additional results, pass this token along with the identical query * parameters as the first request. * </pre> * * <code>string page_token = 12;</code> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**
io.grpc.protobuf.ProtoUtils.marshaller( com.google.devtools.clouderrorreporting.v1beta1.ListGroupStatsRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
/** * * * <pre> * [Optional] List data for the given time range. * If not set a default time range is used. The field time_range_begin * in the response will specify the beginning of this time range. * Only <code>ErrorGroupStats</code> with a non-zero count in the given time * range are returned, unless the request contains an explicit group_id list. * If a group_id list is given, also <code>ErrorGroupStats</code> with zero * occurrences are returned. * </pre> * * <code>.google.devtools.clouderrorreporting.v1beta1.QueryTimeRange time_range = 5;</code> */ public com.google.devtools.clouderrorreporting.v1beta1.QueryTimeRangeOrBuilder getTimeRangeOrBuilder() { return getTimeRange(); }