/** * Lists occurrences referencing the specified note. Provider projects can use this method to get * all occurrences across consumer projects referencing the specified note. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); * String filter = ""; * for (Occurrence element : grafeasV1Beta1Client.listNoteOccurrences(name, filter).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param name The name of the note to list occurrences for in the form of * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * @param filter The filter expression. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListNoteOccurrencesPagedResponse listNoteOccurrences(NoteName name, String filter) { ListNoteOccurrencesRequest request = ListNoteOccurrencesRequest.newBuilder() .setName(name == null ? null : name.toString()) .setFilter(filter) .build(); return listNoteOccurrences(request); }
/** * Lists occurrences referencing the specified note. Provider projects can use this method to get * all occurrences across consumer projects referencing the specified note. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); * String filter = ""; * for (Occurrence element : grafeasV1Beta1Client.listNoteOccurrences(name.toString(), filter).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param name The name of the note to list occurrences for in the form of * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * @param filter The filter expression. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListNoteOccurrencesPagedResponse listNoteOccurrences(String name, String filter) { ListNoteOccurrencesRequest request = ListNoteOccurrencesRequest.newBuilder().setName(name).setFilter(filter).build(); return listNoteOccurrences(request); }