diff --git a/src/main/java/io/grafeas/v1/GrafeasClient.java b/src/main/java/io/grafeas/v1/GrafeasClient.java index 8444948a..2b06b172 100644 --- a/src/main/java/io/grafeas/v1/GrafeasClient.java +++ b/src/main/java/io/grafeas/v1/GrafeasClient.java @@ -55,6 +55,13 @@ *
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); + * Occurrence response = grafeasClient.getOccurrence(name); + * } + * }+ * *
Note: close() needs to be called on the GrafeasClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -155,6 +162,15 @@ public GrafeasStub getStub() { /** * Gets the specified occurrence. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); + * Occurrence response = grafeasClient.getOccurrence(name); + * } + * }+ * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -169,6 +185,15 @@ public final Occurrence getOccurrence(OccurrenceName name) { /** * Gets the specified occurrence. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString(); + * Occurrence response = grafeasClient.getOccurrence(name); + * } + * }+ * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -182,6 +207,18 @@ public final Occurrence getOccurrence(String name) { /** * Gets the specified occurrence. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * GetOccurrenceRequest request = + * GetOccurrenceRequest.newBuilder() + * .setName(OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString()) + * .build(); + * Occurrence response = grafeasClient.getOccurrence(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -194,6 +231,18 @@ public final Occurrence getOccurrence(GetOccurrenceRequest request) { * Gets the specified occurrence. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * GetOccurrenceRequest request = + * GetOccurrenceRequest.newBuilder() + * .setName(OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = grafeasClient.getOccurrenceCallable().futureCall(request); + * // Do something. + * Occurrence response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * String filter = "filter-1274492040"; + * for (Occurrence element : grafeasClient.listOccurrences(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent The name of the project to list occurrences for in the form of * `projects/[PROJECT_ID]`. * @param filter The filter expression. @@ -221,6 +282,18 @@ public final ListOccurrencesPagedResponse listOccurrences(ProjectName parent, St /** * Lists occurrences for the specified project. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * String filter = "filter-1274492040"; + * for (Occurrence element : grafeasClient.listOccurrences(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent The name of the project to list occurrences for in the form of * `projects/[PROJECT_ID]`. * @param filter The filter expression. @@ -236,6 +309,23 @@ public final ListOccurrencesPagedResponse listOccurrences(String parent, String /** * Lists occurrences for the specified project. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ListOccurrencesRequest request = + * ListOccurrencesRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Occurrence element : grafeasClient.listOccurrences(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -248,6 +338,24 @@ public final ListOccurrencesPagedResponse listOccurrences(ListOccurrencesRequest * Lists occurrences for the specified project. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ListOccurrencesRequest request = + * ListOccurrencesRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * grafeasClient.listOccurrencesPagedCallable().futureCall(request); + * // Do something. + * for (Occurrence element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * while (true) { + * ListOccurrencesResponse response = grafeasClient.listOccurrencesCallable().call(request); + * for (Occurrence element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); + * grafeasClient.deleteOccurrence(name); + * } + * }+ * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -285,6 +419,15 @@ public final void deleteOccurrence(OccurrenceName name) { * Deletes the specified occurrence. For example, use this method to delete an occurrence when the * occurrence is no longer applicable for the given resource. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString(); + * grafeasClient.deleteOccurrence(name); + * } + * }+ * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -299,6 +442,18 @@ public final void deleteOccurrence(String name) { * Deletes the specified occurrence. For example, use this method to delete an occurrence when the * occurrence is no longer applicable for the given resource. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * DeleteOccurrenceRequest request = + * DeleteOccurrenceRequest.newBuilder() + * .setName(OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString()) + * .build(); + * grafeasClient.deleteOccurrence(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -312,6 +467,18 @@ public final void deleteOccurrence(DeleteOccurrenceRequest request) { * occurrence is no longer applicable for the given resource. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * DeleteOccurrenceRequest request = + * DeleteOccurrenceRequest.newBuilder() + * .setName(OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = grafeasClient.deleteOccurrenceCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * Occurrence occurrence = Occurrence.newBuilder().build(); + * Occurrence response = grafeasClient.createOccurrence(parent, occurrence); + * } + * }+ * * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the * occurrence is to be created. * @param occurrence The occurrence to create. @@ -339,6 +516,16 @@ public final Occurrence createOccurrence(ProjectName parent, Occurrence occurren /** * Creates a new occurrence. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * Occurrence occurrence = Occurrence.newBuilder().build(); + * Occurrence response = grafeasClient.createOccurrence(parent, occurrence); + * } + * }+ * * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the * occurrence is to be created. * @param occurrence The occurrence to create. @@ -354,6 +541,19 @@ public final Occurrence createOccurrence(String parent, Occurrence occurrence) { /** * Creates a new occurrence. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * CreateOccurrenceRequest request = + * CreateOccurrenceRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setOccurrence(Occurrence.newBuilder().build()) + * .build(); + * Occurrence response = grafeasClient.createOccurrence(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -366,6 +566,19 @@ public final Occurrence createOccurrence(CreateOccurrenceRequest request) { * Creates a new occurrence. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * CreateOccurrenceRequest request = + * CreateOccurrenceRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setOccurrence(Occurrence.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = grafeasClient.createOccurrenceCallable().futureCall(request); + * // Do something. + * Occurrence response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * List+ * * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the * occurrences are to be created. * @param occurrences The occurrences to create. Max allowed length is 1000. @@ -394,6 +618,17 @@ public final BatchCreateOccurrencesResponse batchCreateOccurrences( /** * Creates new occurrences in batch. * + *occurrences = new ArrayList<>(); + * BatchCreateOccurrencesResponse response = + * grafeasClient.batchCreateOccurrences(parent, occurrences); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * List+ * * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the * occurrences are to be created. * @param occurrences The occurrences to create. Max allowed length is 1000. @@ -413,6 +648,19 @@ public final BatchCreateOccurrencesResponse batchCreateOccurrences( /** * Creates new occurrences in batch. * + *occurrences = new ArrayList<>(); + * BatchCreateOccurrencesResponse response = + * grafeasClient.batchCreateOccurrences(parent, occurrences); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * BatchCreateOccurrencesRequest request = + * BatchCreateOccurrencesRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .addAllOccurrences(new ArrayList+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -426,6 +674,20 @@ public final BatchCreateOccurrencesResponse batchCreateOccurrences( * Creates new occurrences in batch. * *()) + * .build(); + * BatchCreateOccurrencesResponse response = grafeasClient.batchCreateOccurrences(request); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * BatchCreateOccurrencesRequest request = + * BatchCreateOccurrencesRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .addAllOccurrences(new ArrayList*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * grafeasClient.batchCreateOccurrencesCallable().futureCall(request); + * // Do something. + * BatchCreateOccurrencesResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); + * Occurrence occurrence = Occurrence.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Occurrence response = grafeasClient.updateOccurrence(name, occurrence, updateMask); + * } + * }+ * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @param occurrence The updated occurrence. @@ -457,6 +730,17 @@ public final Occurrence updateOccurrence( /** * Updates the specified occurrence. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString(); + * Occurrence occurrence = Occurrence.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Occurrence response = grafeasClient.updateOccurrence(name, occurrence, updateMask); + * } + * }+ * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @param occurrence The updated occurrence. @@ -478,6 +762,20 @@ public final Occurrence updateOccurrence( /** * Updates the specified occurrence. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * UpdateOccurrenceRequest request = + * UpdateOccurrenceRequest.newBuilder() + * .setName(OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString()) + * .setOccurrence(Occurrence.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Occurrence response = grafeasClient.updateOccurrence(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -490,6 +788,20 @@ public final Occurrence updateOccurrence(UpdateOccurrenceRequest request) { * Updates the specified occurrence. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * UpdateOccurrenceRequest request = + * UpdateOccurrenceRequest.newBuilder() + * .setName(OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString()) + * .setOccurrence(Occurrence.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = grafeasClient.updateOccurrenceCallable().futureCall(request); + * // Do something. + * Occurrence response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); + * Note response = grafeasClient.getOccurrenceNote(name); + * } + * }+ * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -517,6 +838,15 @@ public final Note getOccurrenceNote(OccurrenceName name) { * Gets the note attached to the specified occurrence. Consumer projects can use this method to * get a note that belongs to a provider project. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString(); + * Note response = grafeasClient.getOccurrenceNote(name); + * } + * }+ * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -531,6 +861,18 @@ public final Note getOccurrenceNote(String name) { * Gets the note attached to the specified occurrence. Consumer projects can use this method to * get a note that belongs to a provider project. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * GetOccurrenceNoteRequest request = + * GetOccurrenceNoteRequest.newBuilder() + * .setName(OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString()) + * .build(); + * Note response = grafeasClient.getOccurrenceNote(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -544,6 +886,18 @@ public final Note getOccurrenceNote(GetOccurrenceNoteRequest request) { * get a note that belongs to a provider project. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * GetOccurrenceNoteRequest request = + * GetOccurrenceNoteRequest.newBuilder() + * .setName(OccurrenceName.of("[PROJECT]", "[OCCURRENCE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = grafeasClient.getOccurrenceNoteCallable().futureCall(request); + * // Do something. + * Note response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); + * Note response = grafeasClient.getNote(name); + * } + * }+ * * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -566,6 +929,15 @@ public final Note getNote(NoteName name) { /** * Gets the specified note. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String name = NoteName.of("[PROJECT]", "[NOTE]").toString(); + * Note response = grafeasClient.getNote(name); + * } + * }+ * * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -578,6 +950,18 @@ public final Note getNote(String name) { /** * Gets the specified note. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * GetNoteRequest request = + * GetNoteRequest.newBuilder() + * .setName(NoteName.of("[PROJECT]", "[NOTE]").toString()) + * .build(); + * Note response = grafeasClient.getNote(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -590,6 +974,18 @@ public final Note getNote(GetNoteRequest request) { * Gets the specified note. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * GetNoteRequest request = + * GetNoteRequest.newBuilder() + * .setName(NoteName.of("[PROJECT]", "[NOTE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = grafeasClient.getNoteCallable().futureCall(request); + * // Do something. + * Note response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * String filter = "filter-1274492040"; + * for (Note element : grafeasClient.listNotes(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent The name of the project to list notes 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 @@ -616,6 +1024,18 @@ public final ListNotesPagedResponse listNotes(ProjectName parent, String filter) /** * Lists notes for the specified project. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * String filter = "filter-1274492040"; + * for (Note element : grafeasClient.listNotes(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent The name of the project to list notes 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 @@ -630,6 +1050,23 @@ public final ListNotesPagedResponse listNotes(String parent, String filter) { /** * Lists notes for the specified project. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ListNotesRequest request = + * ListNotesRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Note element : grafeasClient.listNotes(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -642,6 +1079,23 @@ public final ListNotesPagedResponse listNotes(ListNotesRequest request) { * Lists notes for the specified project. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ListNotesRequest request = + * ListNotesRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = grafeasClient.listNotesPagedCallable().futureCall(request); + * // Do something. + * for (Note element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * while (true) { + * ListNotesResponse response = grafeasClient.listNotesCallable().call(request); + * for (Note element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); + * grafeasClient.deleteNote(name); + * } + * }+ * * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -674,6 +1154,15 @@ public final void deleteNote(NoteName name) { /** * Deletes the specified note. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String name = NoteName.of("[PROJECT]", "[NOTE]").toString(); + * grafeasClient.deleteNote(name); + * } + * }+ * * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -686,6 +1175,18 @@ public final void deleteNote(String name) { /** * Deletes the specified note. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * DeleteNoteRequest request = + * DeleteNoteRequest.newBuilder() + * .setName(NoteName.of("[PROJECT]", "[NOTE]").toString()) + * .build(); + * grafeasClient.deleteNote(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -698,6 +1199,18 @@ public final void deleteNote(DeleteNoteRequest request) { * Deletes the specified note. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * DeleteNoteRequest request = + * DeleteNoteRequest.newBuilder() + * .setName(NoteName.of("[PROJECT]", "[NOTE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = grafeasClient.deleteNoteCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * String noteId = "noteId-1039694675"; + * Note note = Note.newBuilder().build(); + * Note response = grafeasClient.createNote(parent, noteId, note); + * } + * }+ * * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the * note is to be created. * @param noteId The ID to use for this note. @@ -727,6 +1251,17 @@ public final Note createNote(ProjectName parent, String noteId, Note note) { /** * Creates a new note. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * String noteId = "noteId-1039694675"; + * Note note = Note.newBuilder().build(); + * Note response = grafeasClient.createNote(parent, noteId, note); + * } + * }+ * * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the * note is to be created. * @param noteId The ID to use for this note. @@ -743,6 +1278,20 @@ public final Note createNote(String parent, String noteId, Note note) { /** * Creates a new note. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * CreateNoteRequest request = + * CreateNoteRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setNoteId("noteId-1039694675") + * .setNote(Note.newBuilder().build()) + * .build(); + * Note response = grafeasClient.createNote(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -755,6 +1304,20 @@ public final Note createNote(CreateNoteRequest request) { * Creates a new note. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * CreateNoteRequest request = + * CreateNoteRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setNoteId("noteId-1039694675") + * .setNote(Note.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = grafeasClient.createNoteCallable().futureCall(request); + * // Do something. + * Note response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * Map+ * * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the * notes are to be created. * @param notes The notes to create. Max allowed length is 1000. @@ -783,6 +1356,16 @@ public final BatchCreateNotesResponse batchCreateNotes( /** * Creates new notes in batch. * + *notes = new HashMap<>(); + * BatchCreateNotesResponse response = grafeasClient.batchCreateNotes(parent, notes); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * Map+ * * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the * notes are to be created. * @param notes The notes to create. Max allowed length is 1000. @@ -798,6 +1381,19 @@ public final BatchCreateNotesResponse batchCreateNotes(String parent, Mapnotes = new HashMap<>(); + * BatchCreateNotesResponse response = grafeasClient.batchCreateNotes(parent, notes); + * } + * }
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * BatchCreateNotesRequest request = + * BatchCreateNotesRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .putAllNotes(new HashMap+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -810,6 +1406,20 @@ public final BatchCreateNotesResponse batchCreateNotes(BatchCreateNotesRequest r * Creates new notes in batch. * *()) + * .build(); + * BatchCreateNotesResponse response = grafeasClient.batchCreateNotes(request); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * BatchCreateNotesRequest request = + * BatchCreateNotesRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .putAllNotes(new HashMap*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * grafeasClient.batchCreateNotesCallable().futureCall(request); + * // Do something. + * BatchCreateNotesResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); + * Note note = Note.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Note response = grafeasClient.updateNote(name, note, updateMask); + * } + * }+ * * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * @param note The updated note. * @param updateMask The fields to update. @@ -839,6 +1460,17 @@ public final Note updateNote(NoteName name, Note note, FieldMask updateMask) { /** * Updates the specified note. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String name = NoteName.of("[PROJECT]", "[NOTE]").toString(); + * Note note = Note.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Note response = grafeasClient.updateNote(name, note, updateMask); + * } + * }+ * * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * @param note The updated note. * @param updateMask The fields to update. @@ -858,6 +1490,20 @@ public final Note updateNote(String name, Note note, FieldMask updateMask) { /** * Updates the specified note. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * UpdateNoteRequest request = + * UpdateNoteRequest.newBuilder() + * .setName(NoteName.of("[PROJECT]", "[NOTE]").toString()) + * .setNote(Note.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Note response = grafeasClient.updateNote(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -870,6 +1516,20 @@ public final Note updateNote(UpdateNoteRequest request) { * Updates the specified note. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * UpdateNoteRequest request = + * UpdateNoteRequest.newBuilder() + * .setName(NoteName.of("[PROJECT]", "[NOTE]").toString()) + * .setNote(Note.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = grafeasClient.updateNoteCallable().futureCall(request); + * // Do something. + * Note response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); + * String filter = "filter-1274492040"; + * for (Occurrence element : grafeasClient.listNoteOccurrences(name, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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. @@ -899,6 +1571,18 @@ public final ListNoteOccurrencesPagedResponse listNoteOccurrences(NoteName name, * Lists occurrences referencing the specified note. Provider projects can use this method to get * all occurrences across consumer projects referencing the specified note. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * String name = NoteName.of("[PROJECT]", "[NOTE]").toString(); + * String filter = "filter-1274492040"; + * for (Occurrence element : grafeasClient.listNoteOccurrences(name, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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. @@ -915,6 +1599,23 @@ public final ListNoteOccurrencesPagedResponse listNoteOccurrences(String name, S * Lists occurrences referencing the specified note. Provider projects can use this method to get * all occurrences across consumer projects referencing the specified note. * + *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ListNoteOccurrencesRequest request = + * ListNoteOccurrencesRequest.newBuilder() + * .setName(NoteName.of("[PROJECT]", "[NOTE]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Occurrence element : grafeasClient.listNoteOccurrences(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -929,6 +1630,24 @@ public final ListNoteOccurrencesPagedResponse listNoteOccurrences( * all occurrences across consumer projects referencing the specified note. * *
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * ListNoteOccurrencesRequest request = + * ListNoteOccurrencesRequest.newBuilder() + * .setName(NoteName.of("[PROJECT]", "[NOTE]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * grafeasClient.listNoteOccurrencesPagedCallable().futureCall(request); + * // Do something. + * for (Occurrence element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * while (true) { + * ListNoteOccurrencesResponse response = + * grafeasClient.listNoteOccurrencesCallable().call(request); + * for (Occurrence element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample for GrafeasClient: + * + *
{@code + * try (GrafeasClient grafeasClient = GrafeasClient.create()) { + * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); + * Occurrence response = grafeasClient.getOccurrence(name); + * } + * }*/ @Generated("by gapic-generator-java") package io.grafeas.v1; diff --git a/synth.metadata b/synth.metadata index 593021aa..acfc002f 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-grafeas.git", - "sha": "be04db3a0ff273446ebd0ba6ac7db9b4c0b19054" + "sha": "edae083b567f703fea43df36e2d829b3a8136115" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {