Class GrafeasV1Beta1Client (2.54.0)

GitHub RepositoryProduct Reference

Service Description: Grafeas API.

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   GetOccurrenceRequest request =
       GetOccurrenceRequest.newBuilder().setName("name3373707").build();
   Occurrence response = grafeasV1Beta1Client.getOccurrence(request);
 }
 

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().

Methods
Method Description Method Variants

GetOccurrence

Gets the specified occurrence.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getOccurrence(GetOccurrenceRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getOccurrenceCallable()

ListOccurrences

Lists occurrences for the specified project.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listOccurrences(ListOccurrencesRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listOccurrencesPagedCallable()

  • listOccurrencesCallable()

DeleteOccurrence

Deletes the specified occurrence. For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteOccurrence(DeleteOccurrenceRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteOccurrenceCallable()

CreateOccurrence

Creates a new occurrence.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createOccurrence(CreateOccurrenceRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createOccurrenceCallable()

BatchCreateOccurrences

Creates new occurrences in batch.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchCreateOccurrences(BatchCreateOccurrencesRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchCreateOccurrencesCallable()

UpdateOccurrence

Updates the specified occurrence.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateOccurrence(UpdateOccurrenceRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateOccurrenceCallable()

GetOccurrenceNote

Gets the note attached to the specified occurrence. Consumer projects can use this method to get a note that belongs to a provider project.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getOccurrenceNote(GetOccurrenceNoteRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getOccurrenceNoteCallable()

GetNote

Gets the specified note.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getNote(GetNoteRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getNoteCallable()

ListNotes

Lists notes for the specified project.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listNotes(ListNotesRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listNotesPagedCallable()

  • listNotesCallable()

DeleteNote

Deletes the specified note.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteNote(DeleteNoteRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteNoteCallable()

CreateNote

Creates a new note.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createNote(CreateNoteRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createNoteCallable()

BatchCreateNotes

Creates new notes in batch.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchCreateNotes(BatchCreateNotesRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchCreateNotesCallable()

UpdateNote

Updates the specified note.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateNote(UpdateNoteRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateNoteCallable()

ListNoteOccurrences

Lists occurrences referencing the specified note. Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listNoteOccurrences(ListNoteOccurrencesRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listNoteOccurrencesPagedCallable()

  • listNoteOccurrencesCallable()

GetVulnerabilityOccurrencesSummary

Gets a summary of the number and severity of occurrences.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getVulnerabilityOccurrencesSummary(GetVulnerabilityOccurrencesSummaryRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getVulnerabilityOccurrencesSummaryCallable()

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 GrafeasV1Beta1Settings grafeasV1Beta1Settings =
     GrafeasV1Beta1Settings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create(grafeasV1Beta1Settings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 GrafeasV1Beta1Settings grafeasV1Beta1Settings =
     GrafeasV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build();
 GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create(grafeasV1Beta1Settings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 GrafeasV1Beta1Settings grafeasV1Beta1Settings =
     GrafeasV1Beta1Settings.newHttpJsonBuilder().build();
 GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create(grafeasV1Beta1Settings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > GrafeasV1Beta1Client

Static Methods

create()

public static final GrafeasV1Beta1Client create()

Constructs an instance of GrafeasV1Beta1Client with default settings.

Returns
Type Description
GrafeasV1Beta1Client
Exceptions
Type Description
IOException

create(GrafeasV1Beta1Settings settings)

public static final GrafeasV1Beta1Client create(GrafeasV1Beta1Settings settings)

Constructs an instance of GrafeasV1Beta1Client, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings GrafeasV1Beta1Settings
Returns
Type Description
GrafeasV1Beta1Client
Exceptions
Type Description
IOException

create(GrafeasV1Beta1Stub stub)

public static final GrafeasV1Beta1Client create(GrafeasV1Beta1Stub stub)

Constructs an instance of GrafeasV1Beta1Client, using the given stub for making calls. This is for advanced usage - prefer using create(GrafeasV1Beta1Settings).

Parameter
Name Description
stub GrafeasV1Beta1Stub
Returns
Type Description
GrafeasV1Beta1Client

Constructors

GrafeasV1Beta1Client(GrafeasV1Beta1Settings settings)

protected GrafeasV1Beta1Client(GrafeasV1Beta1Settings settings)

Constructs an instance of GrafeasV1Beta1Client, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
Name Description
settings GrafeasV1Beta1Settings

GrafeasV1Beta1Client(GrafeasV1Beta1Stub stub)

protected GrafeasV1Beta1Client(GrafeasV1Beta1Stub stub)
Parameter
Name Description
stub GrafeasV1Beta1Stub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

batchCreateNotes(BatchCreateNotesRequest request)

public final BatchCreateNotesResponse batchCreateNotes(BatchCreateNotesRequest request)

Creates new notes in batch.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   BatchCreateNotesRequest request =
       BatchCreateNotesRequest.newBuilder()
           .setParent("parent-995424086")
           .putAllNotes(new HashMap<String, Note>())
           .build();
   BatchCreateNotesResponse response = grafeasV1Beta1Client.batchCreateNotes(request);
 }
 
Parameter
Name Description
request BatchCreateNotesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchCreateNotesResponse

batchCreateNotesCallable()

public final UnaryCallable<BatchCreateNotesRequest,BatchCreateNotesResponse> batchCreateNotesCallable()

Creates new notes in batch.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   BatchCreateNotesRequest request =
       BatchCreateNotesRequest.newBuilder()
           .setParent("parent-995424086")
           .putAllNotes(new HashMap<String, Note>())
           .build();
   ApiFuture<BatchCreateNotesResponse> future =
       grafeasV1Beta1Client.batchCreateNotesCallable().futureCall(request);
   // Do something.
   BatchCreateNotesResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchCreateNotesRequest,BatchCreateNotesResponse>

batchCreateOccurrences(BatchCreateOccurrencesRequest request)

public final BatchCreateOccurrencesResponse batchCreateOccurrences(BatchCreateOccurrencesRequest request)

Creates new occurrences in batch.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   BatchCreateOccurrencesRequest request =
       BatchCreateOccurrencesRequest.newBuilder()
           .setParent("parent-995424086")
           .addAllOccurrences(new ArrayList<Occurrence>())
           .build();
   BatchCreateOccurrencesResponse response =
       grafeasV1Beta1Client.batchCreateOccurrences(request);
 }
 
Parameter
Name Description
request BatchCreateOccurrencesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchCreateOccurrencesResponse

batchCreateOccurrencesCallable()

public final UnaryCallable<BatchCreateOccurrencesRequest,BatchCreateOccurrencesResponse> batchCreateOccurrencesCallable()

Creates new occurrences in batch.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   BatchCreateOccurrencesRequest request =
       BatchCreateOccurrencesRequest.newBuilder()
           .setParent("parent-995424086")
           .addAllOccurrences(new ArrayList<Occurrence>())
           .build();
   ApiFuture<BatchCreateOccurrencesResponse> future =
       grafeasV1Beta1Client.batchCreateOccurrencesCallable().futureCall(request);
   // Do something.
   BatchCreateOccurrencesResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchCreateOccurrencesRequest,BatchCreateOccurrencesResponse>

close()

public final void close()

createNote(CreateNoteRequest request)

public final Note createNote(CreateNoteRequest request)

Creates a new note.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   CreateNoteRequest request =
       CreateNoteRequest.newBuilder()
           .setParent("parent-995424086")
           .setNoteId("noteId-1039694675")
           .setNote(Note.newBuilder().build())
           .build();
   Note response = grafeasV1Beta1Client.createNote(request);
 }
 
Parameter
Name Description
request CreateNoteRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Note

createNoteCallable()

public final UnaryCallable<CreateNoteRequest,Note> createNoteCallable()

Creates a new note.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   CreateNoteRequest request =
       CreateNoteRequest.newBuilder()
           .setParent("parent-995424086")
           .setNoteId("noteId-1039694675")
           .setNote(Note.newBuilder().build())
           .build();
   ApiFuture<Note> future = grafeasV1Beta1Client.createNoteCallable().futureCall(request);
   // Do something.
   Note response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateNoteRequest,Note>

createOccurrence(CreateOccurrenceRequest request)

public final Occurrence createOccurrence(CreateOccurrenceRequest request)

Creates a new occurrence.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   CreateOccurrenceRequest request =
       CreateOccurrenceRequest.newBuilder()
           .setParent("parent-995424086")
           .setOccurrence(Occurrence.newBuilder().build())
           .build();
   Occurrence response = grafeasV1Beta1Client.createOccurrence(request);
 }
 
Parameter
Name Description
request CreateOccurrenceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Occurrence

createOccurrenceCallable()

public final UnaryCallable<CreateOccurrenceRequest,Occurrence> createOccurrenceCallable()

Creates a new occurrence.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   CreateOccurrenceRequest request =
       CreateOccurrenceRequest.newBuilder()
           .setParent("parent-995424086")
           .setOccurrence(Occurrence.newBuilder().build())
           .build();
   ApiFuture<Occurrence> future =
       grafeasV1Beta1Client.createOccurrenceCallable().futureCall(request);
   // Do something.
   Occurrence response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateOccurrenceRequest,Occurrence>

deleteNote(DeleteNoteRequest request)

public final void deleteNote(DeleteNoteRequest request)

Deletes the specified note.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   DeleteNoteRequest request = DeleteNoteRequest.newBuilder().setName("name3373707").build();
   grafeasV1Beta1Client.deleteNote(request);
 }
 
Parameter
Name Description
request DeleteNoteRequest

The request object containing all of the parameters for the API call.

deleteNoteCallable()

public final UnaryCallable<DeleteNoteRequest,Empty> deleteNoteCallable()

Deletes the specified note.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   DeleteNoteRequest request = DeleteNoteRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Empty> future = grafeasV1Beta1Client.deleteNoteCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteNoteRequest,Empty>

deleteOccurrence(DeleteOccurrenceRequest request)

public final void deleteOccurrence(DeleteOccurrenceRequest request)

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   DeleteOccurrenceRequest request =
       DeleteOccurrenceRequest.newBuilder().setName("name3373707").build();
   grafeasV1Beta1Client.deleteOccurrence(request);
 }
 
Parameter
Name Description
request DeleteOccurrenceRequest

The request object containing all of the parameters for the API call.

deleteOccurrenceCallable()

public final UnaryCallable<DeleteOccurrenceRequest,Empty> deleteOccurrenceCallable()

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   DeleteOccurrenceRequest request =
       DeleteOccurrenceRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Empty> future = grafeasV1Beta1Client.deleteOccurrenceCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteOccurrenceRequest,Empty>

getNote(GetNoteRequest request)

public final Note getNote(GetNoteRequest request)

Gets the specified note.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   GetNoteRequest request = GetNoteRequest.newBuilder().setName("name3373707").build();
   Note response = grafeasV1Beta1Client.getNote(request);
 }
 
Parameter
Name Description
request GetNoteRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Note

getNoteCallable()

public final UnaryCallable<GetNoteRequest,Note> getNoteCallable()

Gets the specified note.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   GetNoteRequest request = GetNoteRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Note> future = grafeasV1Beta1Client.getNoteCallable().futureCall(request);
   // Do something.
   Note response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetNoteRequest,Note>

getOccurrence(GetOccurrenceRequest request)

public final Occurrence getOccurrence(GetOccurrenceRequest request)

Gets the specified occurrence.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   GetOccurrenceRequest request =
       GetOccurrenceRequest.newBuilder().setName("name3373707").build();
   Occurrence response = grafeasV1Beta1Client.getOccurrence(request);
 }
 
Parameter
Name Description
request GetOccurrenceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Occurrence

getOccurrenceCallable()

public final UnaryCallable<GetOccurrenceRequest,Occurrence> getOccurrenceCallable()

Gets the specified occurrence.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   GetOccurrenceRequest request =
       GetOccurrenceRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Occurrence> future =
       grafeasV1Beta1Client.getOccurrenceCallable().futureCall(request);
   // Do something.
   Occurrence response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetOccurrenceRequest,Occurrence>

getOccurrenceNote(GetOccurrenceNoteRequest request)

public final Note getOccurrenceNote(GetOccurrenceNoteRequest request)

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   GetOccurrenceNoteRequest request =
       GetOccurrenceNoteRequest.newBuilder().setName("name3373707").build();
   Note response = grafeasV1Beta1Client.getOccurrenceNote(request);
 }
 
Parameter
Name Description
request GetOccurrenceNoteRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Note

getOccurrenceNoteCallable()

public final UnaryCallable<GetOccurrenceNoteRequest,Note> getOccurrenceNoteCallable()

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   GetOccurrenceNoteRequest request =
       GetOccurrenceNoteRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Note> future = grafeasV1Beta1Client.getOccurrenceNoteCallable().futureCall(request);
   // Do something.
   Note response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetOccurrenceNoteRequest,Note>

getSettings()

public final GrafeasV1Beta1Settings getSettings()
Returns
Type Description
GrafeasV1Beta1Settings

getStub()

public GrafeasV1Beta1Stub getStub()
Returns
Type Description
GrafeasV1Beta1Stub

getVulnerabilityOccurrencesSummary(GetVulnerabilityOccurrencesSummaryRequest request)

public final VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(GetVulnerabilityOccurrencesSummaryRequest request)

Gets a summary of the number and severity of occurrences.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   GetVulnerabilityOccurrencesSummaryRequest request =
       GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .build();
   VulnerabilityOccurrencesSummary response =
       grafeasV1Beta1Client.getVulnerabilityOccurrencesSummary(request);
 }
 
Parameter
Name Description
request GetVulnerabilityOccurrencesSummaryRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
VulnerabilityOccurrencesSummary

getVulnerabilityOccurrencesSummaryCallable()

public final UnaryCallable<GetVulnerabilityOccurrencesSummaryRequest,VulnerabilityOccurrencesSummary> getVulnerabilityOccurrencesSummaryCallable()

Gets a summary of the number and severity of occurrences.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   GetVulnerabilityOccurrencesSummaryRequest request =
       GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<VulnerabilityOccurrencesSummary> future =
       grafeasV1Beta1Client.getVulnerabilityOccurrencesSummaryCallable().futureCall(request);
   // Do something.
   VulnerabilityOccurrencesSummary response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetVulnerabilityOccurrencesSummaryRequest,VulnerabilityOccurrencesSummary>

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listNoteOccurrences(ListNoteOccurrencesRequest request)

public final GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse listNoteOccurrences(ListNoteOccurrencesRequest request)

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   ListNoteOccurrencesRequest request =
       ListNoteOccurrencesRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Occurrence element : grafeasV1Beta1Client.listNoteOccurrences(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListNoteOccurrencesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse

listNoteOccurrencesCallable()

public final UnaryCallable<ListNoteOccurrencesRequest,ListNoteOccurrencesResponse> listNoteOccurrencesCallable()

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   ListNoteOccurrencesRequest request =
       ListNoteOccurrencesRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListNoteOccurrencesRequest,ListNoteOccurrencesResponse>

listNoteOccurrencesPagedCallable()

public final UnaryCallable<ListNoteOccurrencesRequest,GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse> listNoteOccurrencesPagedCallable()

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   ListNoteOccurrencesRequest request =
       ListNoteOccurrencesRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Occurrence> future =
       grafeasV1Beta1Client.listNoteOccurrencesPagedCallable().futureCall(request);
   // Do something.
   for (Occurrence element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListNoteOccurrencesRequest,ListNoteOccurrencesPagedResponse>

listNotes(ListNotesRequest request)

public final GrafeasV1Beta1Client.ListNotesPagedResponse listNotes(ListNotesRequest request)

Lists notes for the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   ListNotesRequest request =
       ListNotesRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Note element : grafeasV1Beta1Client.listNotes(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListNotesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
GrafeasV1Beta1Client.ListNotesPagedResponse

listNotesCallable()

public final UnaryCallable<ListNotesRequest,ListNotesResponse> listNotesCallable()

Lists notes for the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   ListNotesRequest request =
       ListNotesRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListNotesRequest,ListNotesResponse>

listNotesPagedCallable()

public final UnaryCallable<ListNotesRequest,GrafeasV1Beta1Client.ListNotesPagedResponse> listNotesPagedCallable()

Lists notes for the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   ListNotesRequest request =
       ListNotesRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Note> future = grafeasV1Beta1Client.listNotesPagedCallable().futureCall(request);
   // Do something.
   for (Note element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListNotesRequest,ListNotesPagedResponse>

listOccurrences(ListOccurrencesRequest request)

public final GrafeasV1Beta1Client.ListOccurrencesPagedResponse listOccurrences(ListOccurrencesRequest request)

Lists occurrences for the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   ListOccurrencesRequest request =
       ListOccurrencesRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Occurrence element : grafeasV1Beta1Client.listOccurrences(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListOccurrencesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
GrafeasV1Beta1Client.ListOccurrencesPagedResponse

listOccurrencesCallable()

public final UnaryCallable<ListOccurrencesRequest,ListOccurrencesResponse> listOccurrencesCallable()

Lists occurrences for the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   ListOccurrencesRequest request =
       ListOccurrencesRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListOccurrencesRequest,ListOccurrencesResponse>

listOccurrencesPagedCallable()

public final UnaryCallable<ListOccurrencesRequest,GrafeasV1Beta1Client.ListOccurrencesPagedResponse> listOccurrencesPagedCallable()

Lists occurrences for the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   ListOccurrencesRequest request =
       ListOccurrencesRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Occurrence> future =
       grafeasV1Beta1Client.listOccurrencesPagedCallable().futureCall(request);
   // Do something.
   for (Occurrence element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListOccurrencesRequest,ListOccurrencesPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateNote(UpdateNoteRequest request)

public final Note updateNote(UpdateNoteRequest request)

Updates the specified note.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   UpdateNoteRequest request =
       UpdateNoteRequest.newBuilder()
           .setName("name3373707")
           .setNote(Note.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Note response = grafeasV1Beta1Client.updateNote(request);
 }
 
Parameter
Name Description
request UpdateNoteRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Note

updateNoteCallable()

public final UnaryCallable<UpdateNoteRequest,Note> updateNoteCallable()

Updates the specified note.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   UpdateNoteRequest request =
       UpdateNoteRequest.newBuilder()
           .setName("name3373707")
           .setNote(Note.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Note> future = grafeasV1Beta1Client.updateNoteCallable().futureCall(request);
   // Do something.
   Note response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateNoteRequest,Note>

updateOccurrence(UpdateOccurrenceRequest request)

public final Occurrence updateOccurrence(UpdateOccurrenceRequest request)

Updates the specified occurrence.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   UpdateOccurrenceRequest request =
       UpdateOccurrenceRequest.newBuilder()
           .setName("name3373707")
           .setOccurrence(Occurrence.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Occurrence response = grafeasV1Beta1Client.updateOccurrence(request);
 }
 
Parameter
Name Description
request UpdateOccurrenceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Occurrence

updateOccurrenceCallable()

public final UnaryCallable<UpdateOccurrenceRequest,Occurrence> updateOccurrenceCallable()

Updates the specified occurrence.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
   UpdateOccurrenceRequest request =
       UpdateOccurrenceRequest.newBuilder()
           .setName("name3373707")
           .setOccurrence(Occurrence.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Occurrence> future =
       grafeasV1Beta1Client.updateOccurrenceCallable().futureCall(request);
   // Do something.
   Occurrence response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateOccurrenceRequest,Occurrence>