use of io.grafeas.v1beta1.DeleteOccurrenceRequest in project java-containeranalysis by googleapis.
the class GrafeasV1Beta1ClientTest method deleteOccurrenceTest.
@Test
@SuppressWarnings("all")
public void deleteOccurrenceTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockGrafeasV1Beta1.addResponse(expectedResponse);
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
client.deleteOccurrence(name);
List<AbstractMessage> actualRequests = mockGrafeasV1Beta1.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteOccurrenceRequest actualRequest = (DeleteOccurrenceRequest) actualRequests.get(0);
Assert.assertEquals(name, OccurrenceName.parse(actualRequest.getName()));
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of io.grafeas.v1beta1.DeleteOccurrenceRequest in project java-containeranalysis by googleapis.
the class GrafeasV1Beta1Client method deleteOccurrence.
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes the specified occurrence. For example, use this method to delete an occurrence when the
* occurrence is no longer applicable for the given resource.
*
* <p>Sample code:
*
* <pre><code>
* try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
* OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
* grafeasV1Beta1Client.deleteOccurrence(name);
* }
* </code></pre>
*
* @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
*/
public final void deleteOccurrence(OccurrenceName name) {
DeleteOccurrenceRequest request = DeleteOccurrenceRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteOccurrence(request);
}
use of io.grafeas.v1beta1.DeleteOccurrenceRequest in project java-containeranalysis by googleapis.
the class GrafeasV1Beta1Client method deleteOccurrence.
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes the specified occurrence. For example, use this method to delete an occurrence when the
* occurrence is no longer applicable for the given resource.
*
* <p>Sample code:
*
* <pre><code>
* try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
* OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
* grafeasV1Beta1Client.deleteOccurrence(name.toString());
* }
* </code></pre>
*
* @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
*/
public final void deleteOccurrence(String name) {
DeleteOccurrenceRequest request = DeleteOccurrenceRequest.newBuilder().setName(name).build();
deleteOccurrence(request);
}
Aggregations