use of io.grafeas.v1beta1.DeleteNoteRequest in project java-containeranalysis by googleapis.
the class GrafeasV1Beta1ClientTest method deleteNoteTest.
@Test
@SuppressWarnings("all")
public void deleteNoteTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockGrafeasV1Beta1.addResponse(expectedResponse);
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
client.deleteNote(name);
List<AbstractMessage> actualRequests = mockGrafeasV1Beta1.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteNoteRequest actualRequest = (DeleteNoteRequest) actualRequests.get(0);
Assert.assertEquals(name, NoteName.parse(actualRequest.getName()));
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of io.grafeas.v1beta1.DeleteNoteRequest in project java-containeranalysis by googleapis.
the class GrafeasV1Beta1Client method deleteNote.
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes the specified note.
*
* <p>Sample code:
*
* <pre><code>
* try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
* NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
* grafeasV1Beta1Client.deleteNote(name.toString());
* }
* </code></pre>
*
* @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
*/
public final void deleteNote(String name) {
DeleteNoteRequest request = DeleteNoteRequest.newBuilder().setName(name).build();
deleteNote(request);
}
use of io.grafeas.v1beta1.DeleteNoteRequest in project java-containeranalysis by googleapis.
the class GrafeasV1Beta1Client method deleteNote.
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes the specified note.
*
* <p>Sample code:
*
* <pre><code>
* try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
* NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
* grafeasV1Beta1Client.deleteNote(name);
* }
* </code></pre>
*
* @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
*/
public final void deleteNote(NoteName name) {
DeleteNoteRequest request = DeleteNoteRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteNote(request);
}
Aggregations