/** * * * <pre> * The error events which match the given request. * </pre> * * <code>repeated .google.devtools.clouderrorreporting.v1beta1.ErrorEvent error_events = 1; * </code> */ public Builder addErrorEvents( com.google.devtools.clouderrorreporting.v1beta1.ErrorEvent.Builder builderForValue) { if (errorEventsBuilder_ == null) { ensureErrorEventsIsMutable(); errorEvents_.add(builderForValue.build()); onChanged(); } else { errorEventsBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * The error events which match the given request. * </pre> * * <code>repeated .google.devtools.clouderrorreporting.v1beta1.ErrorEvent error_events = 1; * </code> */ public Builder addErrorEvents( int index, com.google.devtools.clouderrorreporting.v1beta1.ErrorEvent.Builder builderForValue) { if (errorEventsBuilder_ == null) { ensureErrorEventsIsMutable(); errorEvents_.add(index, builderForValue.build()); onChanged(); } else { errorEventsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * The error events which match the given request. * </pre> * * <code>repeated .google.devtools.clouderrorreporting.v1beta1.ErrorEvent error_events = 1; * </code> */ public Builder setErrorEvents( int index, com.google.devtools.clouderrorreporting.v1beta1.ErrorEvent.Builder builderForValue) { if (errorEventsBuilder_ == null) { ensureErrorEventsIsMutable(); errorEvents_.set(index, builderForValue.build()); onChanged(); } else { errorEventsBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * An arbitrary event that is chosen as representative for the whole group. * The representative event is intended to be used as a quick preview for * the whole group. Events in the group are usually sufficiently similar * to each other such that showing an arbitrary representative provides * insight into the characteristics of the group as a whole. * </pre> * * <code>.google.devtools.clouderrorreporting.v1beta1.ErrorEvent representative = 9;</code> */ public Builder setRepresentative( com.google.devtools.clouderrorreporting.v1beta1.ErrorEvent.Builder builderForValue) { if (representativeBuilder_ == null) { representative_ = builderForValue.build(); onChanged(); } else { representativeBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * The error events which match the given request. * </pre> * * <code>repeated .google.devtools.clouderrorreporting.v1beta1.ErrorEvent error_events = 1; * </code> */ public Builder setErrorEvents( int index, com.google.devtools.clouderrorreporting.v1beta1.ErrorEvent.Builder builderForValue) { if (errorEventsBuilder_ == null) { ensureErrorEventsIsMutable(); errorEvents_.set(index, builderForValue.build()); onChanged(); } else { errorEventsBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * The error events which match the given request. * </pre> * * <code>repeated .google.devtools.clouderrorreporting.v1beta1.ErrorEvent error_events = 1; * </code> */ public Builder addErrorEvents( com.google.devtools.clouderrorreporting.v1beta1.ErrorEvent.Builder builderForValue) { if (errorEventsBuilder_ == null) { ensureErrorEventsIsMutable(); errorEvents_.add(builderForValue.build()); onChanged(); } else { errorEventsBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * The error events which match the given request. * </pre> * * <code>repeated .google.devtools.clouderrorreporting.v1beta1.ErrorEvent error_events = 1; * </code> */ public Builder addErrorEvents( int index, com.google.devtools.clouderrorreporting.v1beta1.ErrorEvent.Builder builderForValue) { if (errorEventsBuilder_ == null) { ensureErrorEventsIsMutable(); errorEvents_.add(index, builderForValue.build()); onChanged(); } else { errorEventsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
@Test @SuppressWarnings("all") public void listEventsTest() { String nextPageToken = ""; ErrorEvent errorEventsElement = ErrorEvent.newBuilder().build(); List<ErrorEvent> errorEvents = Arrays.asList(errorEventsElement); ListEventsResponse expectedResponse = ListEventsResponse.newBuilder() .setNextPageToken(nextPageToken) .addAllErrorEvents(errorEvents) .build(); mockErrorStatsService.addResponse(expectedResponse); ProjectName projectName = ProjectName.of("[PROJECT]"); String groupId = "groupId506361563"; ListEventsPagedResponse pagedListResponse = client.listEvents(projectName, groupId); List<ErrorEvent> resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getErrorEventsList().get(0), resources.get(0)); List<GeneratedMessageV3> actualRequests = mockErrorStatsService.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListEventsRequest actualRequest = (ListEventsRequest) actualRequests.get(0); Assert.assertEquals(projectName, ProjectName.parse(actualRequest.getProjectName())); Assert.assertEquals(groupId, actualRequest.getGroupId()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
/** * * * <pre> * An arbitrary event that is chosen as representative for the whole group. * The representative event is intended to be used as a quick preview for * the whole group. Events in the group are usually sufficiently similar * to each other such that showing an arbitrary representative provides * insight into the characteristics of the group as a whole. * </pre> * * <code>.google.devtools.clouderrorreporting.v1beta1.ErrorEvent representative = 9;</code> */ public Builder setRepresentative( com.google.devtools.clouderrorreporting.v1beta1.ErrorEvent.Builder builderForValue) { if (representativeBuilder_ == null) { representative_ = builderForValue.build(); onChanged(); } else { representativeBuilder_.setMessage(builderForValue.build()); } return this; } /**