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 .UnaryApiCallable ;
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,14 @@ 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 UnaryApiCallable <ListGroupStatsRequest , ListGroupStatsResponse >
95+ listGroupStatsCallable ;
96+ private final UnaryApiCallable <ListGroupStatsRequest , ListGroupStatsPagedResponse >
9897 listGroupStatsPagedCallable ;
99- private final ApiCallable <ListEventsRequest , ListEventsResponse > listEventsCallable ;
100- private final ApiCallable <
101- ListEventsRequest , PagedListResponse <ListEventsRequest , ListEventsResponse , ErrorEvent >>
98+ private final UnaryApiCallable <ListEventsRequest , ListEventsResponse > listEventsCallable ;
99+ private final UnaryApiCallable <ListEventsRequest , ListEventsPagedResponse >
102100 listEventsPagedCallable ;
103- private final ApiCallable <DeleteEventsRequest , DeleteEventsResponse > deleteEventsCallable ;
101+ private final UnaryApiCallable <DeleteEventsRequest , DeleteEventsResponse > deleteEventsCallable ;
104102
105103 private static final PathTemplate PROJECT_PATH_TEMPLATE =
106104 PathTemplate .createWithoutUrlEncoding ("projects/{project}" );
@@ -139,16 +137,17 @@ protected ErrorStatsServiceApi(ErrorStatsServiceSettings settings) throws IOExce
139137 this .channel = settings .getChannelProvider ().getOrBuildChannel (this .executor );
140138
141139 this .listGroupStatsCallable =
142- ApiCallable .create (settings .listGroupStatsSettings (), this .channel , this .executor );
140+ UnaryApiCallable .create (settings .listGroupStatsSettings (), this .channel , this .executor );
143141 this .listGroupStatsPagedCallable =
144- ApiCallable .createPagedVariant (
142+ UnaryApiCallable .createPagedVariant (
145143 settings .listGroupStatsSettings (), this .channel , this .executor );
146144 this .listEventsCallable =
147- ApiCallable .create (settings .listEventsSettings (), this .channel , this .executor );
145+ UnaryApiCallable .create (settings .listEventsSettings (), this .channel , this .executor );
148146 this .listEventsPagedCallable =
149- ApiCallable .createPagedVariant (settings .listEventsSettings (), this .channel , this .executor );
147+ UnaryApiCallable .createPagedVariant (
148+ settings .listEventsSettings (), this .channel , this .executor );
150149 this .deleteEventsCallable =
151- ApiCallable .create (settings .deleteEventsSettings (), this .channel , this .executor );
150+ UnaryApiCallable .create (settings .deleteEventsSettings (), this .channel , this .executor );
152151
153152 if (settings .getChannelProvider ().shouldAutoClose ()) {
154153 closeables .add (
@@ -195,13 +194,14 @@ public final ErrorStatsServiceSettings getSettings() {
195194 * href="https://support.google.com/cloud/answer/6158840">Google Cloud Platform project
196195 * ID</a>.
197196 * <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.
197+ * @param timeRange [Required] List data for the given time range. Only
198+ * <code>ErrorGroupStats</code> with a non-zero count in the given time range are
199+ * returned, unless the request contains an explicit group_id list. If a group_id list is
200+ * given, also <code>ErrorGroupStats</code> with zero occurrences are returned.
201201 * @throws com.google.api.gax.grpc.ApiException if the remote call fails
202202 */
203- public final PagedListResponse < ListGroupStatsRequest , ListGroupStatsResponse , ErrorGroupStats >
204- listGroupStats ( String projectName , QueryTimeRange timeRange ) {
203+ public final ListGroupStatsPagedResponse listGroupStats (
204+ String projectName , QueryTimeRange timeRange ) {
205205 PROJECT_PATH_TEMPLATE .validate (projectName , "listGroupStats" );
206206 ListGroupStatsRequest request =
207207 ListGroupStatsRequest .newBuilder ()
@@ -234,8 +234,7 @@ public final ErrorStatsServiceSettings getSettings() {
234234 * @param request The request object containing all of the parameters for the API call.
235235 * @throws com.google.api.gax.grpc.ApiException if the remote call fails
236236 */
237- public final PagedListResponse <ListGroupStatsRequest , ListGroupStatsResponse , ErrorGroupStats >
238- listGroupStats (ListGroupStatsRequest request ) {
237+ public final ListGroupStatsPagedResponse listGroupStats (ListGroupStatsRequest request ) {
239238 return listGroupStatsPagedCallable ().call (request );
240239 }
241240
@@ -253,17 +252,15 @@ public final ErrorStatsServiceSettings getSettings() {
253252 * .setProjectName(formattedProjectName)
254253 * .setTimeRange(timeRange)
255254 * .build();
256- * ListenableFuture<PagedListResponse<ListGroupStatsRequest,ListGroupStatsResponse,ErrorGroupStats> > future = errorStatsServiceApi.listGroupStatsPagedCallable().futureCall(request);
255+ * ListenableFuture<ListGroupStatsPagedResponse > future = errorStatsServiceApi.listGroupStatsPagedCallable().futureCall(request);
257256 * // Do something
258257 * for (ErrorGroupStats element : future.get().iterateAllElements()) {
259258 * // doThingsWith(element);
260259 * }
261260 * }
262261 * </code></pre>
263262 */
264- public final ApiCallable <
265- ListGroupStatsRequest ,
266- PagedListResponse <ListGroupStatsRequest , ListGroupStatsResponse , ErrorGroupStats >>
263+ public final UnaryApiCallable <ListGroupStatsRequest , ListGroupStatsPagedResponse >
267264 listGroupStatsPagedCallable () {
268265 return listGroupStatsPagedCallable ;
269266 }
@@ -297,7 +294,8 @@ public final ErrorStatsServiceSettings getSettings() {
297294 * }
298295 * </code></pre>
299296 */
300- public final ApiCallable <ListGroupStatsRequest , ListGroupStatsResponse > listGroupStatsCallable () {
297+ public final UnaryApiCallable <ListGroupStatsRequest , ListGroupStatsResponse >
298+ listGroupStatsCallable () {
301299 return listGroupStatsCallable ;
302300 }
303301
@@ -323,8 +321,7 @@ public final ApiCallable<ListGroupStatsRequest, ListGroupStatsResponse> listGrou
323321 * @param groupId [Required] The group for which events shall be returned.
324322 * @throws com.google.api.gax.grpc.ApiException if the remote call fails
325323 */
326- public final PagedListResponse <ListEventsRequest , ListEventsResponse , ErrorEvent > listEvents (
327- String projectName , String groupId ) {
324+ public final ListEventsPagedResponse listEvents (String projectName , String groupId ) {
328325 PROJECT_PATH_TEMPLATE .validate (projectName , "listEvents" );
329326 ListEventsRequest request =
330327 ListEventsRequest .newBuilder ().setProjectName (projectName ).setGroupId (groupId ).build ();
@@ -354,8 +351,7 @@ public final PagedListResponse<ListEventsRequest, ListEventsResponse, ErrorEvent
354351 * @param request The request object containing all of the parameters for the API call.
355352 * @throws com.google.api.gax.grpc.ApiException if the remote call fails
356353 */
357- public final PagedListResponse <ListEventsRequest , ListEventsResponse , ErrorEvent > listEvents (
358- ListEventsRequest request ) {
354+ public final ListEventsPagedResponse listEvents (ListEventsRequest request ) {
359355 return listEventsPagedCallable ().call (request );
360356 }
361357
@@ -373,16 +369,15 @@ public final PagedListResponse<ListEventsRequest, ListEventsResponse, ErrorEvent
373369 * .setProjectName(formattedProjectName)
374370 * .setGroupId(groupId)
375371 * .build();
376- * ListenableFuture<PagedListResponse<ListEventsRequest,ListEventsResponse,ErrorEvent> > future = errorStatsServiceApi.listEventsPagedCallable().futureCall(request);
372+ * ListenableFuture<ListEventsPagedResponse > future = errorStatsServiceApi.listEventsPagedCallable().futureCall(request);
377373 * // Do something
378374 * for (ErrorEvent element : future.get().iterateAllElements()) {
379375 * // doThingsWith(element);
380376 * }
381377 * }
382378 * </code></pre>
383379 */
384- public final ApiCallable <
385- ListEventsRequest , PagedListResponse <ListEventsRequest , ListEventsResponse , ErrorEvent >>
380+ public final UnaryApiCallable <ListEventsRequest , ListEventsPagedResponse >
386381 listEventsPagedCallable () {
387382 return listEventsPagedCallable ;
388383 }
@@ -416,7 +411,7 @@ public final PagedListResponse<ListEventsRequest, ListEventsResponse, ErrorEvent
416411 * }
417412 * </code></pre>
418413 */
419- public final ApiCallable <ListEventsRequest , ListEventsResponse > listEventsCallable () {
414+ public final UnaryApiCallable <ListEventsRequest , ListEventsResponse > listEventsCallable () {
420415 return listEventsCallable ;
421416 }
422417
@@ -486,7 +481,7 @@ private final DeleteEventsResponse deleteEvents(DeleteEventsRequest request) {
486481 * }
487482 * </code></pre>
488483 */
489- public final ApiCallable <DeleteEventsRequest , DeleteEventsResponse > deleteEventsCallable () {
484+ public final UnaryApiCallable <DeleteEventsRequest , DeleteEventsResponse > deleteEventsCallable () {
490485 return deleteEventsCallable ;
491486 }
492487
0 commit comments