1313 */
1414package com .google .cloud .errorreporting .spi .v1beta1 ;
1515
16- import com .google .api .gax .core .PagedListResponse ;
17- import com .google .api .gax .grpc .ApiCallable ;
16+ import static com .google .cloud .errorreporting .spi .v1beta1 .PagedResponseWrappers .ListEventsPagedResponse ;
17+ import static com .google .cloud .errorreporting .spi .v1beta1 .PagedResponseWrappers .ListGroupStatsPagedResponse ;
18+
19+ import com .google .api .gax .grpc .UnaryCallable ;
1820import com .google .api .gax .protobuf .PathTemplate ;
1921import com .google .devtools .clouderrorreporting .v1beta1 .DeleteEventsRequest ;
2022import com .google .devtools .clouderrorreporting .v1beta1 .DeleteEventsResponse ;
21- import com .google .devtools .clouderrorreporting .v1beta1 .ErrorEvent ;
22- import com .google .devtools .clouderrorreporting .v1beta1 .ErrorGroupStats ;
2323import com .google .devtools .clouderrorreporting .v1beta1 .ListEventsRequest ;
2424import com .google .devtools .clouderrorreporting .v1beta1 .ListEventsResponse ;
2525import com .google .devtools .clouderrorreporting .v1beta1 .ListGroupStatsRequest ;
6262 * <li> A "request object" method. This type of method only takes one parameter, a request object,
6363 * which must be constructed before the call. Not every API method will have a request object
6464 * method.
65- * <li> A "callable" method. This type of method takes no parameters and returns an immutable
66- * ApiCallable object, which can be used to initiate calls to the service.
65+ * <li> A "callable" method. This type of method takes no parameters and returns an immutable API
66+ * callable object, which can be used to initiate calls to the service.
6767 * </ol>
6868 *
6969 * <p>See the individual methods for example code.
@@ -91,16 +91,12 @@ public class ErrorStatsServiceApi implements AutoCloseable {
9191 private final ScheduledExecutorService executor ;
9292 private final List <AutoCloseable > closeables = new ArrayList <>();
9393
94- private final ApiCallable <ListGroupStatsRequest , ListGroupStatsResponse > listGroupStatsCallable ;
95- private final ApiCallable <
96- ListGroupStatsRequest ,
97- PagedListResponse <ListGroupStatsRequest , ListGroupStatsResponse , ErrorGroupStats >>
94+ private final UnaryCallable <ListGroupStatsRequest , ListGroupStatsResponse > listGroupStatsCallable ;
95+ private final UnaryCallable <ListGroupStatsRequest , ListGroupStatsPagedResponse >
9896 listGroupStatsPagedCallable ;
99- private final ApiCallable <ListEventsRequest , ListEventsResponse > listEventsCallable ;
100- private final ApiCallable <
101- ListEventsRequest , PagedListResponse <ListEventsRequest , ListEventsResponse , ErrorEvent >>
102- listEventsPagedCallable ;
103- private final ApiCallable <DeleteEventsRequest , DeleteEventsResponse > deleteEventsCallable ;
97+ private final UnaryCallable <ListEventsRequest , ListEventsResponse > listEventsCallable ;
98+ private final UnaryCallable <ListEventsRequest , ListEventsPagedResponse > listEventsPagedCallable ;
99+ private final UnaryCallable <DeleteEventsRequest , DeleteEventsResponse > deleteEventsCallable ;
104100
105101 private static final PathTemplate PROJECT_PATH_TEMPLATE =
106102 PathTemplate .createWithoutUrlEncoding ("projects/{project}" );
@@ -139,16 +135,17 @@ protected ErrorStatsServiceApi(ErrorStatsServiceSettings settings) throws IOExce
139135 this .channel = settings .getChannelProvider ().getOrBuildChannel (this .executor );
140136
141137 this .listGroupStatsCallable =
142- ApiCallable .create (settings .listGroupStatsSettings (), this .channel , this .executor );
138+ UnaryCallable .create (settings .listGroupStatsSettings (), this .channel , this .executor );
143139 this .listGroupStatsPagedCallable =
144- ApiCallable .createPagedVariant (
140+ UnaryCallable .createPagedVariant (
145141 settings .listGroupStatsSettings (), this .channel , this .executor );
146142 this .listEventsCallable =
147- ApiCallable .create (settings .listEventsSettings (), this .channel , this .executor );
143+ UnaryCallable .create (settings .listEventsSettings (), this .channel , this .executor );
148144 this .listEventsPagedCallable =
149- ApiCallable .createPagedVariant (settings .listEventsSettings (), this .channel , this .executor );
145+ UnaryCallable .createPagedVariant (
146+ settings .listEventsSettings (), this .channel , this .executor );
150147 this .deleteEventsCallable =
151- ApiCallable .create (settings .deleteEventsSettings (), this .channel , this .executor );
148+ UnaryCallable .create (settings .deleteEventsSettings (), this .channel , this .executor );
152149
153150 if (settings .getChannelProvider ().shouldAutoClose ()) {
154151 closeables .add (
@@ -195,13 +192,14 @@ public final ErrorStatsServiceSettings getSettings() {
195192 * href="https://support.google.com/cloud/answer/6158840">Google Cloud Platform project
196193 * ID</a>.
197194 * <p>Example: <code>projects/my-project-123</code>.
198- * @param timeRange [Required] List data for the given time range. The service is tuned for
199- * retrieving data up to (approximately) 'now'. Retrieving data for arbitrary time periods in
200- * the past can result in higher response times or in returning incomplete results.
195+ * @param timeRange [Required] List data for the given time range. Only
196+ * <code>ErrorGroupStats</code> with a non-zero count in the given time range are
197+ * returned, unless the request contains an explicit group_id list. If a group_id list is
198+ * given, also <code>ErrorGroupStats</code> with zero occurrences are returned.
201199 * @throws com.google.api.gax.grpc.ApiException if the remote call fails
202200 */
203- public final PagedListResponse < ListGroupStatsRequest , ListGroupStatsResponse , ErrorGroupStats >
204- listGroupStats ( String projectName , QueryTimeRange timeRange ) {
201+ public final ListGroupStatsPagedResponse listGroupStats (
202+ String projectName , QueryTimeRange timeRange ) {
205203 PROJECT_PATH_TEMPLATE .validate (projectName , "listGroupStats" );
206204 ListGroupStatsRequest request =
207205 ListGroupStatsRequest .newBuilder ()
@@ -234,8 +232,7 @@ public final ErrorStatsServiceSettings getSettings() {
234232 * @param request The request object containing all of the parameters for the API call.
235233 * @throws com.google.api.gax.grpc.ApiException if the remote call fails
236234 */
237- public final PagedListResponse <ListGroupStatsRequest , ListGroupStatsResponse , ErrorGroupStats >
238- listGroupStats (ListGroupStatsRequest request ) {
235+ public final ListGroupStatsPagedResponse listGroupStats (ListGroupStatsRequest request ) {
239236 return listGroupStatsPagedCallable ().call (request );
240237 }
241238
@@ -253,17 +250,15 @@ public final ErrorStatsServiceSettings getSettings() {
253250 * .setProjectName(formattedProjectName)
254251 * .setTimeRange(timeRange)
255252 * .build();
256- * ListenableFuture<PagedListResponse<ListGroupStatsRequest,ListGroupStatsResponse,ErrorGroupStats> > future = errorStatsServiceApi.listGroupStatsPagedCallable().futureCall(request);
253+ * ListenableFuture<ListGroupStatsPagedResponse > future = errorStatsServiceApi.listGroupStatsPagedCallable().futureCall(request);
257254 * // Do something
258255 * for (ErrorGroupStats element : future.get().iterateAllElements()) {
259256 * // doThingsWith(element);
260257 * }
261258 * }
262259 * </code></pre>
263260 */
264- public final ApiCallable <
265- ListGroupStatsRequest ,
266- PagedListResponse <ListGroupStatsRequest , ListGroupStatsResponse , ErrorGroupStats >>
261+ public final UnaryCallable <ListGroupStatsRequest , ListGroupStatsPagedResponse >
267262 listGroupStatsPagedCallable () {
268263 return listGroupStatsPagedCallable ;
269264 }
@@ -297,7 +292,8 @@ public final ErrorStatsServiceSettings getSettings() {
297292 * }
298293 * </code></pre>
299294 */
300- public final ApiCallable <ListGroupStatsRequest , ListGroupStatsResponse > listGroupStatsCallable () {
295+ public final UnaryCallable <ListGroupStatsRequest , ListGroupStatsResponse >
296+ listGroupStatsCallable () {
301297 return listGroupStatsCallable ;
302298 }
303299
@@ -323,8 +319,7 @@ public final ApiCallable<ListGroupStatsRequest, ListGroupStatsResponse> listGrou
323319 * @param groupId [Required] The group for which events shall be returned.
324320 * @throws com.google.api.gax.grpc.ApiException if the remote call fails
325321 */
326- public final PagedListResponse <ListEventsRequest , ListEventsResponse , ErrorEvent > listEvents (
327- String projectName , String groupId ) {
322+ public final ListEventsPagedResponse listEvents (String projectName , String groupId ) {
328323 PROJECT_PATH_TEMPLATE .validate (projectName , "listEvents" );
329324 ListEventsRequest request =
330325 ListEventsRequest .newBuilder ().setProjectName (projectName ).setGroupId (groupId ).build ();
@@ -354,8 +349,7 @@ public final PagedListResponse<ListEventsRequest, ListEventsResponse, ErrorEvent
354349 * @param request The request object containing all of the parameters for the API call.
355350 * @throws com.google.api.gax.grpc.ApiException if the remote call fails
356351 */
357- public final PagedListResponse <ListEventsRequest , ListEventsResponse , ErrorEvent > listEvents (
358- ListEventsRequest request ) {
352+ public final ListEventsPagedResponse listEvents (ListEventsRequest request ) {
359353 return listEventsPagedCallable ().call (request );
360354 }
361355
@@ -373,17 +367,15 @@ public final PagedListResponse<ListEventsRequest, ListEventsResponse, ErrorEvent
373367 * .setProjectName(formattedProjectName)
374368 * .setGroupId(groupId)
375369 * .build();
376- * ListenableFuture<PagedListResponse<ListEventsRequest,ListEventsResponse,ErrorEvent> > future = errorStatsServiceApi.listEventsPagedCallable().futureCall(request);
370+ * ListenableFuture<ListEventsPagedResponse > future = errorStatsServiceApi.listEventsPagedCallable().futureCall(request);
377371 * // Do something
378372 * for (ErrorEvent element : future.get().iterateAllElements()) {
379373 * // doThingsWith(element);
380374 * }
381375 * }
382376 * </code></pre>
383377 */
384- public final ApiCallable <
385- ListEventsRequest , PagedListResponse <ListEventsRequest , ListEventsResponse , ErrorEvent >>
386- listEventsPagedCallable () {
378+ public final UnaryCallable <ListEventsRequest , ListEventsPagedResponse > listEventsPagedCallable () {
387379 return listEventsPagedCallable ;
388380 }
389381
@@ -416,7 +408,7 @@ public final PagedListResponse<ListEventsRequest, ListEventsResponse, ErrorEvent
416408 * }
417409 * </code></pre>
418410 */
419- public final ApiCallable <ListEventsRequest , ListEventsResponse > listEventsCallable () {
411+ public final UnaryCallable <ListEventsRequest , ListEventsResponse > listEventsCallable () {
420412 return listEventsCallable ;
421413 }
422414
@@ -486,7 +478,7 @@ private final DeleteEventsResponse deleteEvents(DeleteEventsRequest request) {
486478 * }
487479 * </code></pre>
488480 */
489- public final ApiCallable <DeleteEventsRequest , DeleteEventsResponse > deleteEventsCallable () {
481+ public final UnaryCallable <DeleteEventsRequest , DeleteEventsResponse > deleteEventsCallable () {
490482 return deleteEventsCallable ;
491483 }
492484
0 commit comments