@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
/** * Updates the specified note. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); * Note note = Note.newBuilder().build(); * FieldMask updateMask = FieldMask.newBuilder().build(); * Note response = grafeasV1Beta1Client.updateNote(name.toString(), note, updateMask); * } * </code></pre> * * @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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Note updateNote(String name, Note note, FieldMask updateMask) { UpdateNoteRequest request = UpdateNoteRequest.newBuilder() .setName(name) .setNote(note) .setUpdateMask(updateMask) .build(); return updateNote(request); }
/** * Updates the specified note. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); * Note note = Note.newBuilder().build(); * FieldMask updateMask = FieldMask.newBuilder().build(); * Note response = grafeasV1Beta1Client.updateNote(name, note, updateMask); * } * </code></pre> * * @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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Note updateNote(NoteName name, Note note, FieldMask updateMask) { UpdateNoteRequest request = UpdateNoteRequest.newBuilder() .setName(name == null ? null : name.toString()) .setNote(note) .setUpdateMask(updateMask) .build(); return updateNote(request); }
/** * Pushes an update to a Note that already exists on the server * @param client The Grafeas client used to perform the API requests. * @param updated a Note object representing the desired updates to push * @param noteId the identifier of the existing Note * @param projectId the GCP project the Note belongs to */ public static Note updateNote(GrafeasV1Beta1Client client, Note updated, String noteId, String projectId) { final NoteName noteName = NoteName.of(projectId, noteId); UpdateNoteRequest request = UpdateNoteRequest.newBuilder() .setName(noteName.toString()) .setNote(updated) .build(); return client.updateNote(request); } // [END update_note]
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }