@Generated(value="by gapic-generator") @BetaApi public class GrafeasV1Beta1Client extends Object implements BackgroundResource
Retrieves analysis results of Cloud components such as Docker container images.
Analysis results are stored as a series of occurrences. An `Occurrence` contains information about a specific analysis instance on a resource. An occurrence refers to a `Note`. A note contains details describing the analysis and is generally stored in a separate project, called a `Provider`. Multiple occurrences can refer to the same note.
For example, an SSL vulnerability could affect multiple images. In this case, there would be one note for the vulnerability and an occurrence for each image with the vulnerability referring to that note.
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:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
Occurrence response = grafeasV1Beta1Client.getOccurrence(name);
}
Note: close() needs to be called on the grafeasV1Beta1Client object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of GrafeasV1Beta1Settings to create(). For example:
To customize credentials:
GrafeasV1Beta1Settings grafeasV1Beta1Settings =
GrafeasV1Beta1Settings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
GrafeasV1Beta1Client grafeasV1Beta1Client =
GrafeasV1Beta1Client.create(grafeasV1Beta1Settings);
To customize the endpoint:
GrafeasV1Beta1Settings grafeasV1Beta1Settings =
GrafeasV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build();
GrafeasV1Beta1Client grafeasV1Beta1Client =
GrafeasV1Beta1Client.create(grafeasV1Beta1Settings);
Modifier and Type | Class and Description |
---|---|
static class |
GrafeasV1Beta1Client.ListNoteOccurrencesFixedSizeCollection |
static class |
GrafeasV1Beta1Client.ListNoteOccurrencesPage |
static class |
GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse |
static class |
GrafeasV1Beta1Client.ListNotesFixedSizeCollection |
static class |
GrafeasV1Beta1Client.ListNotesPage |
static class |
GrafeasV1Beta1Client.ListNotesPagedResponse |
static class |
GrafeasV1Beta1Client.ListOccurrencesFixedSizeCollection |
static class |
GrafeasV1Beta1Client.ListOccurrencesPage |
static class |
GrafeasV1Beta1Client.ListOccurrencesPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
GrafeasV1Beta1Client(GrafeasV1Beta1Settings settings)
Constructs an instance of GrafeasV1Beta1Client, using the given settings.
|
protected |
GrafeasV1Beta1Client(GrafeasV1Beta1Stub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
io.grafeas.v1beta1.BatchCreateNotesResponse |
batchCreateNotes(io.grafeas.v1beta1.BatchCreateNotesRequest request)
Creates new notes in batch.
|
io.grafeas.v1beta1.BatchCreateNotesResponse |
batchCreateNotes(com.google.containeranalysis.v1beta1.ProjectName parent,
Map<String,io.grafeas.v1beta1.Note> notes)
Creates new notes in batch.
|
io.grafeas.v1beta1.BatchCreateNotesResponse |
batchCreateNotes(String parent,
Map<String,io.grafeas.v1beta1.Note> notes)
Creates new notes in batch.
|
UnaryCallable<io.grafeas.v1beta1.BatchCreateNotesRequest,io.grafeas.v1beta1.BatchCreateNotesResponse> |
batchCreateNotesCallable()
Creates new notes in batch.
|
io.grafeas.v1beta1.BatchCreateOccurrencesResponse |
batchCreateOccurrences(io.grafeas.v1beta1.BatchCreateOccurrencesRequest request)
Creates new occurrences in batch.
|
io.grafeas.v1beta1.BatchCreateOccurrencesResponse |
batchCreateOccurrences(com.google.containeranalysis.v1beta1.ProjectName parent,
List<io.grafeas.v1beta1.Occurrence> occurrences)
Creates new occurrences in batch.
|
io.grafeas.v1beta1.BatchCreateOccurrencesResponse |
batchCreateOccurrences(String parent,
List<io.grafeas.v1beta1.Occurrence> occurrences)
Creates new occurrences in batch.
|
UnaryCallable<io.grafeas.v1beta1.BatchCreateOccurrencesRequest,io.grafeas.v1beta1.BatchCreateOccurrencesResponse> |
batchCreateOccurrencesCallable()
Creates new occurrences in batch.
|
void |
close() |
static GrafeasV1Beta1Client |
create()
Constructs an instance of GrafeasV1Beta1Client with default settings.
|
static GrafeasV1Beta1Client |
create(GrafeasV1Beta1Settings settings)
Constructs an instance of GrafeasV1Beta1Client, using the given settings.
|
static GrafeasV1Beta1Client |
create(GrafeasV1Beta1Stub stub)
Constructs an instance of GrafeasV1Beta1Client, using the given stub for making calls.
|
io.grafeas.v1beta1.Note |
createNote(io.grafeas.v1beta1.CreateNoteRequest request)
Creates a new note.
|
io.grafeas.v1beta1.Note |
createNote(com.google.containeranalysis.v1beta1.ProjectName parent,
String noteId,
io.grafeas.v1beta1.Note note)
Creates a new note.
|
io.grafeas.v1beta1.Note |
createNote(String parent,
String noteId,
io.grafeas.v1beta1.Note note)
Creates a new note.
|
UnaryCallable<io.grafeas.v1beta1.CreateNoteRequest,io.grafeas.v1beta1.Note> |
createNoteCallable()
Creates a new note.
|
io.grafeas.v1beta1.Occurrence |
createOccurrence(io.grafeas.v1beta1.CreateOccurrenceRequest request)
Creates a new occurrence.
|
io.grafeas.v1beta1.Occurrence |
createOccurrence(com.google.containeranalysis.v1beta1.ProjectName parent,
io.grafeas.v1beta1.Occurrence occurrence)
Creates a new occurrence.
|
io.grafeas.v1beta1.Occurrence |
createOccurrence(String parent,
io.grafeas.v1beta1.Occurrence occurrence)
Creates a new occurrence.
|
UnaryCallable<io.grafeas.v1beta1.CreateOccurrenceRequest,io.grafeas.v1beta1.Occurrence> |
createOccurrenceCallable()
Creates a new occurrence.
|
void |
deleteNote(io.grafeas.v1beta1.DeleteNoteRequest request)
Deletes the specified note.
|
void |
deleteNote(com.google.containeranalysis.v1beta1.NoteName name)
Deletes the specified note.
|
void |
deleteNote(String name)
Deletes the specified note.
|
UnaryCallable<io.grafeas.v1beta1.DeleteNoteRequest,Empty> |
deleteNoteCallable()
Deletes the specified note.
|
void |
deleteOccurrence(io.grafeas.v1beta1.DeleteOccurrenceRequest request)
Deletes the specified occurrence.
|
void |
deleteOccurrence(com.google.containeranalysis.v1beta1.OccurrenceName name)
Deletes the specified occurrence.
|
void |
deleteOccurrence(String name)
Deletes the specified occurrence.
|
UnaryCallable<io.grafeas.v1beta1.DeleteOccurrenceRequest,Empty> |
deleteOccurrenceCallable()
Deletes the specified occurrence.
|
io.grafeas.v1beta1.Note |
getNote(io.grafeas.v1beta1.GetNoteRequest request)
Gets the specified note.
|
io.grafeas.v1beta1.Note |
getNote(com.google.containeranalysis.v1beta1.NoteName name)
Gets the specified note.
|
io.grafeas.v1beta1.Note |
getNote(String name)
Gets the specified note.
|
UnaryCallable<io.grafeas.v1beta1.GetNoteRequest,io.grafeas.v1beta1.Note> |
getNoteCallable()
Gets the specified note.
|
io.grafeas.v1beta1.Occurrence |
getOccurrence(io.grafeas.v1beta1.GetOccurrenceRequest request)
Gets the specified occurrence.
|
io.grafeas.v1beta1.Occurrence |
getOccurrence(com.google.containeranalysis.v1beta1.OccurrenceName name)
Gets the specified occurrence.
|
io.grafeas.v1beta1.Occurrence |
getOccurrence(String name)
Gets the specified occurrence.
|
UnaryCallable<io.grafeas.v1beta1.GetOccurrenceRequest,io.grafeas.v1beta1.Occurrence> |
getOccurrenceCallable()
Gets the specified occurrence.
|
io.grafeas.v1beta1.Note |
getOccurrenceNote(io.grafeas.v1beta1.GetOccurrenceNoteRequest request)
Gets the note attached to the specified occurrence.
|
io.grafeas.v1beta1.Note |
getOccurrenceNote(com.google.containeranalysis.v1beta1.OccurrenceName name)
Gets the note attached to the specified occurrence.
|
io.grafeas.v1beta1.Note |
getOccurrenceNote(String name)
Gets the note attached to the specified occurrence.
|
UnaryCallable<io.grafeas.v1beta1.GetOccurrenceNoteRequest,io.grafeas.v1beta1.Note> |
getOccurrenceNoteCallable()
Gets the note attached to the specified occurrence.
|
GrafeasV1Beta1Settings |
getSettings() |
GrafeasV1Beta1Stub |
getStub() |
io.grafeas.v1beta1.VulnerabilityOccurrencesSummary |
getVulnerabilityOccurrencesSummary(io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest request)
Gets a summary of the number and severity of occurrences.
|
io.grafeas.v1beta1.VulnerabilityOccurrencesSummary |
getVulnerabilityOccurrencesSummary(com.google.containeranalysis.v1beta1.ProjectName parent,
String filter)
Gets a summary of the number and severity of occurrences.
|
io.grafeas.v1beta1.VulnerabilityOccurrencesSummary |
getVulnerabilityOccurrencesSummary(String parent,
String filter)
Gets a summary of the number and severity of occurrences.
|
UnaryCallable<io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest,io.grafeas.v1beta1.VulnerabilityOccurrencesSummary> |
getVulnerabilityOccurrencesSummaryCallable()
Gets a summary of the number and severity of occurrences.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse |
listNoteOccurrences(io.grafeas.v1beta1.ListNoteOccurrencesRequest request)
Lists occurrences referencing the specified note.
|
GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse |
listNoteOccurrences(com.google.containeranalysis.v1beta1.NoteName name,
String filter)
Lists occurrences referencing the specified note.
|
GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse |
listNoteOccurrences(String name,
String filter)
Lists occurrences referencing the specified note.
|
UnaryCallable<io.grafeas.v1beta1.ListNoteOccurrencesRequest,io.grafeas.v1beta1.ListNoteOccurrencesResponse> |
listNoteOccurrencesCallable()
Lists occurrences referencing the specified note.
|
UnaryCallable<io.grafeas.v1beta1.ListNoteOccurrencesRequest,GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse> |
listNoteOccurrencesPagedCallable()
Lists occurrences referencing the specified note.
|
GrafeasV1Beta1Client.ListNotesPagedResponse |
listNotes(io.grafeas.v1beta1.ListNotesRequest request)
Lists notes for the specified project.
|
GrafeasV1Beta1Client.ListNotesPagedResponse |
listNotes(com.google.containeranalysis.v1beta1.ProjectName parent,
String filter)
Lists notes for the specified project.
|
GrafeasV1Beta1Client.ListNotesPagedResponse |
listNotes(String parent,
String filter)
Lists notes for the specified project.
|
UnaryCallable<io.grafeas.v1beta1.ListNotesRequest,io.grafeas.v1beta1.ListNotesResponse> |
listNotesCallable()
Lists notes for the specified project.
|
UnaryCallable<io.grafeas.v1beta1.ListNotesRequest,GrafeasV1Beta1Client.ListNotesPagedResponse> |
listNotesPagedCallable()
Lists notes for the specified project.
|
GrafeasV1Beta1Client.ListOccurrencesPagedResponse |
listOccurrences(io.grafeas.v1beta1.ListOccurrencesRequest request)
Lists occurrences for the specified project.
|
GrafeasV1Beta1Client.ListOccurrencesPagedResponse |
listOccurrences(com.google.containeranalysis.v1beta1.ProjectName parent,
String filter)
Lists occurrences for the specified project.
|
GrafeasV1Beta1Client.ListOccurrencesPagedResponse |
listOccurrences(String parent,
String filter)
Lists occurrences for the specified project.
|
UnaryCallable<io.grafeas.v1beta1.ListOccurrencesRequest,io.grafeas.v1beta1.ListOccurrencesResponse> |
listOccurrencesCallable()
Lists occurrences for the specified project.
|
UnaryCallable<io.grafeas.v1beta1.ListOccurrencesRequest,GrafeasV1Beta1Client.ListOccurrencesPagedResponse> |
listOccurrencesPagedCallable()
Lists occurrences for the specified project.
|
void |
shutdown() |
void |
shutdownNow() |
io.grafeas.v1beta1.Note |
updateNote(com.google.containeranalysis.v1beta1.NoteName name,
io.grafeas.v1beta1.Note note,
FieldMask updateMask)
Updates the specified note.
|
io.grafeas.v1beta1.Note |
updateNote(String name,
io.grafeas.v1beta1.Note note,
FieldMask updateMask)
Updates the specified note.
|
io.grafeas.v1beta1.Note |
updateNote(io.grafeas.v1beta1.UpdateNoteRequest request)
Updates the specified note.
|
UnaryCallable<io.grafeas.v1beta1.UpdateNoteRequest,io.grafeas.v1beta1.Note> |
updateNoteCallable()
Updates the specified note.
|
io.grafeas.v1beta1.Occurrence |
updateOccurrence(com.google.containeranalysis.v1beta1.OccurrenceName name,
io.grafeas.v1beta1.Occurrence occurrence,
FieldMask updateMask)
Updates the specified occurrence.
|
io.grafeas.v1beta1.Occurrence |
updateOccurrence(String name,
io.grafeas.v1beta1.Occurrence occurrence,
FieldMask updateMask)
Updates the specified occurrence.
|
io.grafeas.v1beta1.Occurrence |
updateOccurrence(io.grafeas.v1beta1.UpdateOccurrenceRequest request)
Updates the specified occurrence.
|
UnaryCallable<io.grafeas.v1beta1.UpdateOccurrenceRequest,io.grafeas.v1beta1.Occurrence> |
updateOccurrenceCallable()
Updates the specified occurrence.
|
protected GrafeasV1Beta1Client(GrafeasV1Beta1Settings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected GrafeasV1Beta1Client(GrafeasV1Beta1Stub stub)
public static final GrafeasV1Beta1Client create() throws IOException
IOException
public static final GrafeasV1Beta1Client create(GrafeasV1Beta1Settings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final GrafeasV1Beta1Client create(GrafeasV1Beta1Stub stub)
public final GrafeasV1Beta1Settings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public GrafeasV1Beta1Stub getStub()
public final io.grafeas.v1beta1.Occurrence getOccurrence(com.google.containeranalysis.v1beta1.OccurrenceName name)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
Occurrence response = grafeasV1Beta1Client.getOccurrence(name);
}
name
- The name of the occurrence in the form of
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Occurrence getOccurrence(String name)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
Occurrence response = grafeasV1Beta1Client.getOccurrence(name.toString());
}
name
- The name of the occurrence in the form of
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Occurrence getOccurrence(io.grafeas.v1beta1.GetOccurrenceRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
GetOccurrenceRequest request = GetOccurrenceRequest.newBuilder()
.setName(name.toString())
.build();
Occurrence response = grafeasV1Beta1Client.getOccurrence(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.GetOccurrenceRequest,io.grafeas.v1beta1.Occurrence> getOccurrenceCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
GetOccurrenceRequest request = GetOccurrenceRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Occurrence> future = grafeasV1Beta1Client.getOccurrenceCallable().futureCall(request);
// Do something
Occurrence response = future.get();
}
public final GrafeasV1Beta1Client.ListOccurrencesPagedResponse listOccurrences(com.google.containeranalysis.v1beta1.ProjectName parent, String filter)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String filter = "";
for (Occurrence element : grafeasV1Beta1Client.listOccurrences(parent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The name of the project to list occurrences for in the form of
`projects/[PROJECT_ID]`.filter
- The filter expression.ApiException
- if the remote call failspublic final GrafeasV1Beta1Client.ListOccurrencesPagedResponse listOccurrences(String parent, String filter)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String filter = "";
for (Occurrence element : grafeasV1Beta1Client.listOccurrences(parent.toString(), filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The name of the project to list occurrences for in the form of
`projects/[PROJECT_ID]`.filter
- The filter expression.ApiException
- if the remote call failspublic final GrafeasV1Beta1Client.ListOccurrencesPagedResponse listOccurrences(io.grafeas.v1beta1.ListOccurrencesRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListOccurrencesRequest request = ListOccurrencesRequest.newBuilder()
.setParent(parent.toString())
.build();
for (Occurrence element : grafeasV1Beta1Client.listOccurrences(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.ListOccurrencesRequest,GrafeasV1Beta1Client.ListOccurrencesPagedResponse> listOccurrencesPagedCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListOccurrencesRequest request = ListOccurrencesRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListOccurrencesPagedResponse> future = grafeasV1Beta1Client.listOccurrencesPagedCallable().futureCall(request);
// Do something
for (Occurrence element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<io.grafeas.v1beta1.ListOccurrencesRequest,io.grafeas.v1beta1.ListOccurrencesResponse> listOccurrencesCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListOccurrencesRequest request = ListOccurrencesRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListOccurrencesResponse response = grafeasV1Beta1Client.listOccurrencesCallable().call(request);
for (Occurrence element : response.getOccurrencesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteOccurrence(com.google.containeranalysis.v1beta1.OccurrenceName name)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
grafeasV1Beta1Client.deleteOccurrence(name);
}
name
- The name of the occurrence in the form of
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.ApiException
- if the remote call failspublic final void deleteOccurrence(String name)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
grafeasV1Beta1Client.deleteOccurrence(name.toString());
}
name
- The name of the occurrence in the form of
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.ApiException
- if the remote call failspublic final void deleteOccurrence(io.grafeas.v1beta1.DeleteOccurrenceRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
DeleteOccurrenceRequest request = DeleteOccurrenceRequest.newBuilder()
.setName(name.toString())
.build();
grafeasV1Beta1Client.deleteOccurrence(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.DeleteOccurrenceRequest,Empty> deleteOccurrenceCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
DeleteOccurrenceRequest request = DeleteOccurrenceRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = grafeasV1Beta1Client.deleteOccurrenceCallable().futureCall(request);
// Do something
future.get();
}
public final io.grafeas.v1beta1.Occurrence createOccurrence(com.google.containeranalysis.v1beta1.ProjectName parent, io.grafeas.v1beta1.Occurrence occurrence)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Occurrence occurrence = Occurrence.newBuilder().build();
Occurrence response = grafeasV1Beta1Client.createOccurrence(parent, occurrence);
}
parent
- The name of the project in the form of `projects/[PROJECT_ID]`, under which the
occurrence is to be created.occurrence
- The occurrence to create.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Occurrence createOccurrence(String parent, io.grafeas.v1beta1.Occurrence occurrence)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Occurrence occurrence = Occurrence.newBuilder().build();
Occurrence response = grafeasV1Beta1Client.createOccurrence(parent.toString(), occurrence);
}
parent
- The name of the project in the form of `projects/[PROJECT_ID]`, under which the
occurrence is to be created.occurrence
- The occurrence to create.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Occurrence createOccurrence(io.grafeas.v1beta1.CreateOccurrenceRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Occurrence occurrence = Occurrence.newBuilder().build();
CreateOccurrenceRequest request = CreateOccurrenceRequest.newBuilder()
.setParent(parent.toString())
.setOccurrence(occurrence)
.build();
Occurrence response = grafeasV1Beta1Client.createOccurrence(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.CreateOccurrenceRequest,io.grafeas.v1beta1.Occurrence> createOccurrenceCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Occurrence occurrence = Occurrence.newBuilder().build();
CreateOccurrenceRequest request = CreateOccurrenceRequest.newBuilder()
.setParent(parent.toString())
.setOccurrence(occurrence)
.build();
ApiFuture<Occurrence> future = grafeasV1Beta1Client.createOccurrenceCallable().futureCall(request);
// Do something
Occurrence response = future.get();
}
public final io.grafeas.v1beta1.BatchCreateOccurrencesResponse batchCreateOccurrences(com.google.containeranalysis.v1beta1.ProjectName parent, List<io.grafeas.v1beta1.Occurrence> occurrences)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
List<Occurrence> occurrences = new ArrayList<>();
BatchCreateOccurrencesResponse response = grafeasV1Beta1Client.batchCreateOccurrences(parent, occurrences);
}
parent
- The name of the project in the form of `projects/[PROJECT_ID]`, under which the
occurrences are to be created.occurrences
- The occurrences to create.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.BatchCreateOccurrencesResponse batchCreateOccurrences(String parent, List<io.grafeas.v1beta1.Occurrence> occurrences)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
List<Occurrence> occurrences = new ArrayList<>();
BatchCreateOccurrencesResponse response = grafeasV1Beta1Client.batchCreateOccurrences(parent.toString(), occurrences);
}
parent
- The name of the project in the form of `projects/[PROJECT_ID]`, under which the
occurrences are to be created.occurrences
- The occurrences to create.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.BatchCreateOccurrencesResponse batchCreateOccurrences(io.grafeas.v1beta1.BatchCreateOccurrencesRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
List<Occurrence> occurrences = new ArrayList<>();
BatchCreateOccurrencesRequest request = BatchCreateOccurrencesRequest.newBuilder()
.setParent(parent.toString())
.addAllOccurrences(occurrences)
.build();
BatchCreateOccurrencesResponse response = grafeasV1Beta1Client.batchCreateOccurrences(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.BatchCreateOccurrencesRequest,io.grafeas.v1beta1.BatchCreateOccurrencesResponse> batchCreateOccurrencesCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
List<Occurrence> occurrences = new ArrayList<>();
BatchCreateOccurrencesRequest request = BatchCreateOccurrencesRequest.newBuilder()
.setParent(parent.toString())
.addAllOccurrences(occurrences)
.build();
ApiFuture<BatchCreateOccurrencesResponse> future = grafeasV1Beta1Client.batchCreateOccurrencesCallable().futureCall(request);
// Do something
BatchCreateOccurrencesResponse response = future.get();
}
public final io.grafeas.v1beta1.Occurrence updateOccurrence(com.google.containeranalysis.v1beta1.OccurrenceName name, io.grafeas.v1beta1.Occurrence occurrence, FieldMask updateMask)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
Occurrence occurrence = Occurrence.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Occurrence response = grafeasV1Beta1Client.updateOccurrence(name, occurrence, updateMask);
}
name
- The name of the occurrence in the form of
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.occurrence
- The updated occurrence.updateMask
- The fields to update.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Occurrence updateOccurrence(String name, io.grafeas.v1beta1.Occurrence occurrence, FieldMask updateMask)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
Occurrence occurrence = Occurrence.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Occurrence response = grafeasV1Beta1Client.updateOccurrence(name.toString(), occurrence, updateMask);
}
name
- The name of the occurrence in the form of
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.occurrence
- The updated occurrence.updateMask
- The fields to update.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Occurrence updateOccurrence(io.grafeas.v1beta1.UpdateOccurrenceRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
Occurrence occurrence = Occurrence.newBuilder().build();
UpdateOccurrenceRequest request = UpdateOccurrenceRequest.newBuilder()
.setName(name.toString())
.setOccurrence(occurrence)
.build();
Occurrence response = grafeasV1Beta1Client.updateOccurrence(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.UpdateOccurrenceRequest,io.grafeas.v1beta1.Occurrence> updateOccurrenceCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
Occurrence occurrence = Occurrence.newBuilder().build();
UpdateOccurrenceRequest request = UpdateOccurrenceRequest.newBuilder()
.setName(name.toString())
.setOccurrence(occurrence)
.build();
ApiFuture<Occurrence> future = grafeasV1Beta1Client.updateOccurrenceCallable().futureCall(request);
// Do something
Occurrence response = future.get();
}
public final io.grafeas.v1beta1.Note getOccurrenceNote(com.google.containeranalysis.v1beta1.OccurrenceName name)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
Note response = grafeasV1Beta1Client.getOccurrenceNote(name);
}
name
- The name of the occurrence in the form of
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Note getOccurrenceNote(String name)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
Note response = grafeasV1Beta1Client.getOccurrenceNote(name.toString());
}
name
- The name of the occurrence in the form of
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Note getOccurrenceNote(io.grafeas.v1beta1.GetOccurrenceNoteRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
GetOccurrenceNoteRequest request = GetOccurrenceNoteRequest.newBuilder()
.setName(name.toString())
.build();
Note response = grafeasV1Beta1Client.getOccurrenceNote(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.GetOccurrenceNoteRequest,io.grafeas.v1beta1.Note> getOccurrenceNoteCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]");
GetOccurrenceNoteRequest request = GetOccurrenceNoteRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Note> future = grafeasV1Beta1Client.getOccurrenceNoteCallable().futureCall(request);
// Do something
Note response = future.get();
}
public final io.grafeas.v1beta1.Note getNote(com.google.containeranalysis.v1beta1.NoteName name)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
Note response = grafeasV1Beta1Client.getNote(name);
}
name
- The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Note getNote(String name)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
Note response = grafeasV1Beta1Client.getNote(name.toString());
}
name
- The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Note getNote(io.grafeas.v1beta1.GetNoteRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
GetNoteRequest request = GetNoteRequest.newBuilder()
.setName(name.toString())
.build();
Note response = grafeasV1Beta1Client.getNote(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.GetNoteRequest,io.grafeas.v1beta1.Note> getNoteCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
GetNoteRequest request = GetNoteRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Note> future = grafeasV1Beta1Client.getNoteCallable().futureCall(request);
// Do something
Note response = future.get();
}
public final GrafeasV1Beta1Client.ListNotesPagedResponse listNotes(com.google.containeranalysis.v1beta1.ProjectName parent, String filter)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String filter = "";
for (Note element : grafeasV1Beta1Client.listNotes(parent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The name of the project to list notes for in the form of `projects/[PROJECT_ID]`.filter
- The filter expression.ApiException
- if the remote call failspublic final GrafeasV1Beta1Client.ListNotesPagedResponse listNotes(String parent, String filter)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String filter = "";
for (Note element : grafeasV1Beta1Client.listNotes(parent.toString(), filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The name of the project to list notes for in the form of `projects/[PROJECT_ID]`.filter
- The filter expression.ApiException
- if the remote call failspublic final GrafeasV1Beta1Client.ListNotesPagedResponse listNotes(io.grafeas.v1beta1.ListNotesRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListNotesRequest request = ListNotesRequest.newBuilder()
.setParent(parent.toString())
.build();
for (Note element : grafeasV1Beta1Client.listNotes(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.ListNotesRequest,GrafeasV1Beta1Client.ListNotesPagedResponse> listNotesPagedCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListNotesRequest request = ListNotesRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListNotesPagedResponse> future = grafeasV1Beta1Client.listNotesPagedCallable().futureCall(request);
// Do something
for (Note element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<io.grafeas.v1beta1.ListNotesRequest,io.grafeas.v1beta1.ListNotesResponse> listNotesCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListNotesRequest request = ListNotesRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListNotesResponse response = grafeasV1Beta1Client.listNotesCallable().call(request);
for (Note element : response.getNotesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteNote(com.google.containeranalysis.v1beta1.NoteName name)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
grafeasV1Beta1Client.deleteNote(name);
}
name
- The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.ApiException
- if the remote call failspublic final void deleteNote(String name)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
grafeasV1Beta1Client.deleteNote(name.toString());
}
name
- The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.ApiException
- if the remote call failspublic final void deleteNote(io.grafeas.v1beta1.DeleteNoteRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
DeleteNoteRequest request = DeleteNoteRequest.newBuilder()
.setName(name.toString())
.build();
grafeasV1Beta1Client.deleteNote(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.DeleteNoteRequest,Empty> deleteNoteCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
DeleteNoteRequest request = DeleteNoteRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = grafeasV1Beta1Client.deleteNoteCallable().futureCall(request);
// Do something
future.get();
}
public final io.grafeas.v1beta1.Note createNote(com.google.containeranalysis.v1beta1.ProjectName parent, String noteId, io.grafeas.v1beta1.Note note)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String noteId = "";
Note note = Note.newBuilder().build();
Note response = grafeasV1Beta1Client.createNote(parent, noteId, note);
}
parent
- The name of the project in the form of `projects/[PROJECT_ID]`, under which the
note is to be created.noteId
- The ID to use for this note.note
- The note to create.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Note createNote(String parent, String noteId, io.grafeas.v1beta1.Note note)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String noteId = "";
Note note = Note.newBuilder().build();
Note response = grafeasV1Beta1Client.createNote(parent.toString(), noteId, note);
}
parent
- The name of the project in the form of `projects/[PROJECT_ID]`, under which the
note is to be created.noteId
- The ID to use for this note.note
- The note to create.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Note createNote(io.grafeas.v1beta1.CreateNoteRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String noteId = "";
Note note = Note.newBuilder().build();
CreateNoteRequest request = CreateNoteRequest.newBuilder()
.setParent(parent.toString())
.setNoteId(noteId)
.setNote(note)
.build();
Note response = grafeasV1Beta1Client.createNote(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.CreateNoteRequest,io.grafeas.v1beta1.Note> createNoteCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String noteId = "";
Note note = Note.newBuilder().build();
CreateNoteRequest request = CreateNoteRequest.newBuilder()
.setParent(parent.toString())
.setNoteId(noteId)
.setNote(note)
.build();
ApiFuture<Note> future = grafeasV1Beta1Client.createNoteCallable().futureCall(request);
// Do something
Note response = future.get();
}
public final io.grafeas.v1beta1.BatchCreateNotesResponse batchCreateNotes(com.google.containeranalysis.v1beta1.ProjectName parent, Map<String,io.grafeas.v1beta1.Note> notes)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Map<String, Note> notes = new HashMap<>();
BatchCreateNotesResponse response = grafeasV1Beta1Client.batchCreateNotes(parent, notes);
}
parent
- The name of the project in the form of `projects/[PROJECT_ID]`, under which the
notes are to be created.notes
- The notes to create.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.BatchCreateNotesResponse batchCreateNotes(String parent, Map<String,io.grafeas.v1beta1.Note> notes)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Map<String, Note> notes = new HashMap<>();
BatchCreateNotesResponse response = grafeasV1Beta1Client.batchCreateNotes(parent.toString(), notes);
}
parent
- The name of the project in the form of `projects/[PROJECT_ID]`, under which the
notes are to be created.notes
- The notes to create.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.BatchCreateNotesResponse batchCreateNotes(io.grafeas.v1beta1.BatchCreateNotesRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Map<String, Note> notes = new HashMap<>();
BatchCreateNotesRequest request = BatchCreateNotesRequest.newBuilder()
.setParent(parent.toString())
.putAllNotes(notes)
.build();
BatchCreateNotesResponse response = grafeasV1Beta1Client.batchCreateNotes(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.BatchCreateNotesRequest,io.grafeas.v1beta1.BatchCreateNotesResponse> batchCreateNotesCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Map<String, Note> notes = new HashMap<>();
BatchCreateNotesRequest request = BatchCreateNotesRequest.newBuilder()
.setParent(parent.toString())
.putAllNotes(notes)
.build();
ApiFuture<BatchCreateNotesResponse> future = grafeasV1Beta1Client.batchCreateNotesCallable().futureCall(request);
// Do something
BatchCreateNotesResponse response = future.get();
}
public final io.grafeas.v1beta1.Note updateNote(com.google.containeranalysis.v1beta1.NoteName name, io.grafeas.v1beta1.Note note, FieldMask updateMask)
Sample 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);
}
name
- The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.note
- The updated note.updateMask
- The fields to update.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Note updateNote(String name, io.grafeas.v1beta1.Note note, FieldMask updateMask)
Sample 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);
}
name
- The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.note
- The updated note.updateMask
- The fields to update.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.Note updateNote(io.grafeas.v1beta1.UpdateNoteRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
Note note = Note.newBuilder().build();
UpdateNoteRequest request = UpdateNoteRequest.newBuilder()
.setName(name.toString())
.setNote(note)
.build();
Note response = grafeasV1Beta1Client.updateNote(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.UpdateNoteRequest,io.grafeas.v1beta1.Note> updateNoteCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
Note note = Note.newBuilder().build();
UpdateNoteRequest request = UpdateNoteRequest.newBuilder()
.setName(name.toString())
.setNote(note)
.build();
ApiFuture<Note> future = grafeasV1Beta1Client.updateNoteCallable().futureCall(request);
// Do something
Note response = future.get();
}
public final GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse listNoteOccurrences(com.google.containeranalysis.v1beta1.NoteName name, String filter)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
String filter = "";
for (Occurrence element : grafeasV1Beta1Client.listNoteOccurrences(name, filter).iterateAll()) {
// doThingsWith(element);
}
}
name
- The name of the note to list occurrences for in the form of
`projects/[PROVIDER_ID]/notes/[NOTE_ID]`.filter
- The filter expression.ApiException
- if the remote call failspublic final GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse listNoteOccurrences(String name, String filter)
Sample 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);
}
}
name
- The name of the note to list occurrences for in the form of
`projects/[PROVIDER_ID]/notes/[NOTE_ID]`.filter
- The filter expression.ApiException
- if the remote call failspublic final GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse listNoteOccurrences(io.grafeas.v1beta1.ListNoteOccurrencesRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
ListNoteOccurrencesRequest request = ListNoteOccurrencesRequest.newBuilder()
.setName(name.toString())
.build();
for (Occurrence element : grafeasV1Beta1Client.listNoteOccurrences(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.ListNoteOccurrencesRequest,GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse> listNoteOccurrencesPagedCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
ListNoteOccurrencesRequest request = ListNoteOccurrencesRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<ListNoteOccurrencesPagedResponse> future = grafeasV1Beta1Client.listNoteOccurrencesPagedCallable().futureCall(request);
// Do something
for (Occurrence element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<io.grafeas.v1beta1.ListNoteOccurrencesRequest,io.grafeas.v1beta1.ListNoteOccurrencesResponse> listNoteOccurrencesCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
ListNoteOccurrencesRequest request = ListNoteOccurrencesRequest.newBuilder()
.setName(name.toString())
.build();
while (true) {
ListNoteOccurrencesResponse response = grafeasV1Beta1Client.listNoteOccurrencesCallable().call(request);
for (Occurrence element : response.getOccurrencesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final io.grafeas.v1beta1.VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(com.google.containeranalysis.v1beta1.ProjectName parent, String filter)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String filter = "";
VulnerabilityOccurrencesSummary response = grafeasV1Beta1Client.getVulnerabilityOccurrencesSummary(parent, filter);
}
parent
- The name of the project to get a vulnerability summary for in the form of
`projects/[PROJECT_ID]`.filter
- The filter expression.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(String parent, String filter)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String filter = "";
VulnerabilityOccurrencesSummary response = grafeasV1Beta1Client.getVulnerabilityOccurrencesSummary(parent.toString(), filter);
}
parent
- The name of the project to get a vulnerability summary for in the form of
`projects/[PROJECT_ID]`.filter
- The filter expression.ApiException
- if the remote call failspublic final io.grafeas.v1beta1.VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest request)
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
GetVulnerabilityOccurrencesSummaryRequest request = GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
.setParent(parent.toString())
.build();
VulnerabilityOccurrencesSummary response = grafeasV1Beta1Client.getVulnerabilityOccurrencesSummary(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest,io.grafeas.v1beta1.VulnerabilityOccurrencesSummary> getVulnerabilityOccurrencesSummaryCallable()
Sample code:
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
GetVulnerabilityOccurrencesSummaryRequest request = GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<VulnerabilityOccurrencesSummary> future = grafeasV1Beta1Client.getVulnerabilityOccurrencesSummaryCallable().futureCall(request);
// Do something
VulnerabilityOccurrencesSummary response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.