/** * Lists the specified events. * * <p>Sample code: * * <pre><code> * try (ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient.create()) { * ProjectName projectName = ProjectName.of("[PROJECT]"); * String groupId = ""; * for (ErrorEvent element : errorStatsServiceClient.listEvents(projectName, groupId).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param projectName [Required] The resource name of the Google Cloud Platform project. Written * as `projects/` plus the [Google Cloud Platform project * ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`. * @param groupId [Required] The group for which events shall be returned. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListEventsPagedResponse listEvents(ProjectName projectName, String groupId) { ListEventsRequest request = ListEventsRequest.newBuilder() .setProjectName(projectName == null ? null : projectName.toString()) .setGroupId(groupId) .build(); return listEvents(request); }
/** * Lists the specified events. * * <p>Sample code: * * <pre><code> * try (ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient.create()) { * ProjectName projectName = ProjectName.of("[PROJECT]"); * String groupId = ""; * for (ErrorEvent element : errorStatsServiceClient.listEvents(projectName.toString(), groupId).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param projectName [Required] The resource name of the Google Cloud Platform project. Written * as `projects/` plus the [Google Cloud Platform project * ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`. * @param groupId [Required] The group for which events shall be returned. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListEventsPagedResponse listEvents(String projectName, String groupId) { ListEventsRequest request = ListEventsRequest.newBuilder().setProjectName(projectName).setGroupId(groupId).build(); return listEvents(request); }
@Override public ListEventsRequest injectToken(ListEventsRequest payload, String token) { return ListEventsRequest.newBuilder(payload).setPageToken(token).build(); }
@Override public ListEventsRequest injectPageSize(ListEventsRequest payload, int pageSize) { return ListEventsRequest.newBuilder(payload).setPageSize(pageSize).build(); }