/** * Lists occurrences for the specified project. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); * String filter = ""; * for (Occurrence element : grafeasV1Beta1Client.listOccurrences(parent, filter).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent The name of the project to list occurrences for in the form of * `projects/[PROJECT_ID]`. * @param filter The filter expression. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListOccurrencesPagedResponse listOccurrences(ProjectName parent, String filter) { ListOccurrencesRequest request = ListOccurrencesRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setFilter(filter) .build(); return listOccurrences(request); }
/** * Lists occurrences for the specified project. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); * String filter = ""; * for (Occurrence element : grafeasV1Beta1Client.listOccurrences(parent.toString(), filter).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent The name of the project to list occurrences for in the form of * `projects/[PROJECT_ID]`. * @param filter The filter expression. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListOccurrencesPagedResponse listOccurrences(String parent, String filter) { ListOccurrencesRequest request = ListOccurrencesRequest.newBuilder().setParent(parent).setFilter(filter).build(); return listOccurrences(request); }