# Grafeas V1 API - Class Grafeas::V1::Grafeas::Client (v1.9.0)

1.9.0 (latest) 1.8.0 1.7.0 1.6.0 1.5.1 1.4.0 1.3.1 1.2.0 1.1.1 1.0.0 0.16.1 0.15.0 0.14.2 0.13.0 0.12.1 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.1 0.5.0 0.4.0 0.3.1 Reference documentation and code samples for the Grafeas V1 API class Grafeas::V1::Grafeas::Client.

Client for the Grafeas service.


[Grafeas](https://grafeas.io) 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.

<br />

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.

## Inherits

- Object

## Includes

- [Grafeas::V1::Grafeas::Paths](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Grafeas-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the Grafeas Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Grafeas-Client-Configuration "Grafeas::V1::Grafeas::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Grafeas-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Grafeas-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all Grafeas clients
::Grafeas::V1::Grafeas::Client.configure do |config|
  config.timeout = 10.0
end
```

### #batch_create_notes

    def batch_create_notes(request, options = nil) -> ::Grafeas::V1::BatchCreateNotesResponse
    def batch_create_notes(parent: nil, notes: nil) -> ::Grafeas::V1::BatchCreateNotesResponse

Creates new notes in batch.
**Overloads**

    def batch_create_notes(request, options = nil) -> ::Grafeas::V1::BatchCreateNotesResponse

Pass arguments to `batch_create_notes` via a request object, either of type [BatchCreateNotesRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-BatchCreateNotesRequest "Grafeas::V1::BatchCreateNotesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::BatchCreateNotesRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-BatchCreateNotesRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def batch_create_notes(parent: nil, notes: nil) -> ::Grafeas::V1::BatchCreateNotesResponse

Pass arguments to `batch_create_notes` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- The name of the project in the form of `projects/[PROJECT_ID]`, under which the notes are to be created.
- **notes** (::Hash{::String =\> ::Grafeas::V1::Note, ::Hash}) --- The notes to create. Max allowed length is 1000.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Grafeas::V1::BatchCreateNotesResponse](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-BatchCreateNotesResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Grafeas::V1::BatchCreateNotesResponse](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-BatchCreateNotesResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::BatchCreateNotesRequest.new

# Call the batch_create_notes method.
result = client.batch_create_notes request

# The returned object is of type Grafeas::V1::BatchCreateNotesResponse.
p result
```

### #batch_create_occurrences

    def batch_create_occurrences(request, options = nil) -> ::Grafeas::V1::BatchCreateOccurrencesResponse
    def batch_create_occurrences(parent: nil, occurrences: nil) -> ::Grafeas::V1::BatchCreateOccurrencesResponse

Creates new occurrences in batch.
**Overloads**

    def batch_create_occurrences(request, options = nil) -> ::Grafeas::V1::BatchCreateOccurrencesResponse

Pass arguments to `batch_create_occurrences` via a request object, either of type [BatchCreateOccurrencesRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-BatchCreateOccurrencesRequest "Grafeas::V1::BatchCreateOccurrencesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::BatchCreateOccurrencesRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-BatchCreateOccurrencesRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def batch_create_occurrences(parent: nil, occurrences: nil) -> ::Grafeas::V1::BatchCreateOccurrencesResponse

Pass arguments to `batch_create_occurrences` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- The name of the project in the form of `projects/[PROJECT_ID]`, under which the occurrences are to be created.
- **occurrences** (::Array\<[::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence), ::Hash\>) --- The occurrences to create. Max allowed length is 1000.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Grafeas::V1::BatchCreateOccurrencesResponse](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-BatchCreateOccurrencesResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Grafeas::V1::BatchCreateOccurrencesResponse](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-BatchCreateOccurrencesResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::BatchCreateOccurrencesRequest.new

# Call the batch_create_occurrences method.
result = client.batch_create_occurrences request

# The returned object is of type Grafeas::V1::BatchCreateOccurrencesResponse.
p result
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the Grafeas Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Grafeas-Client#Grafeas__V1__Grafeas__Client_configure_class_ "Grafeas::V1::Grafeas::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Grafeas-Client-Configuration "Grafeas::V1::Grafeas::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Grafeas-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Grafeas-Client-Configuration))

### #create_note

    def create_note(request, options = nil) -> ::Grafeas::V1::Note
    def create_note(parent: nil, note_id: nil, note: nil) -> ::Grafeas::V1::Note

Creates a new note.
**Overloads**

    def create_note(request, options = nil) -> ::Grafeas::V1::Note

Pass arguments to `create_note` via a request object, either of type [CreateNoteRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-CreateNoteRequest "Grafeas::V1::CreateNoteRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::CreateNoteRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-CreateNoteRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_note(parent: nil, note_id: nil, note: nil) -> ::Grafeas::V1::Note

Pass arguments to `create_note` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- The name of the project in the form of `projects/[PROJECT_ID]`, under which the note is to be created.
- **note_id** (::String) --- The ID to use for this note.
- **note** ([::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- The note to create.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::CreateNoteRequest.new

# Call the create_note method.
result = client.create_note request

# The returned object is of type Grafeas::V1::Note.
p result
```

### #create_occurrence

    def create_occurrence(request, options = nil) -> ::Grafeas::V1::Occurrence
    def create_occurrence(parent: nil, occurrence: nil) -> ::Grafeas::V1::Occurrence

Creates a new occurrence.
**Overloads**

    def create_occurrence(request, options = nil) -> ::Grafeas::V1::Occurrence

Pass arguments to `create_occurrence` via a request object, either of type [CreateOccurrenceRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-CreateOccurrenceRequest "Grafeas::V1::CreateOccurrenceRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::CreateOccurrenceRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-CreateOccurrenceRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_occurrence(parent: nil, occurrence: nil) -> ::Grafeas::V1::Occurrence

Pass arguments to `create_occurrence` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- The name of the project in the form of `projects/[PROJECT_ID]`, under which the occurrence is to be created.
- **occurrence** ([::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- The occurrence to create.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::CreateOccurrenceRequest.new

# Call the create_occurrence method.
result = client.create_occurrence request

# The returned object is of type Grafeas::V1::Occurrence.
p result
```

### #delete_note

    def delete_note(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_note(name: nil) -> ::Google::Protobuf::Empty

Deletes the specified note.
**Overloads**

    def delete_note(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_note` via a request object, either of type [DeleteNoteRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-DeleteNoteRequest "Grafeas::V1::DeleteNoteRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::DeleteNoteRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-DeleteNoteRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def delete_note(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_note` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::DeleteNoteRequest.new

# Call the delete_note method.
result = client.delete_note request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #delete_occurrence

    def delete_occurrence(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_occurrence(name: nil) -> ::Google::Protobuf::Empty

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

    def delete_occurrence(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_occurrence` via a request object, either of type [DeleteOccurrenceRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-DeleteOccurrenceRequest "Grafeas::V1::DeleteOccurrenceRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::DeleteOccurrenceRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-DeleteOccurrenceRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def delete_occurrence(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_occurrence` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- The name of the occurrence in the form of `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::DeleteOccurrenceRequest.new

# Call the delete_occurrence method.
result = client.delete_occurrence request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_note

    def get_note(request, options = nil) -> ::Grafeas::V1::Note
    def get_note(name: nil) -> ::Grafeas::V1::Note

Gets the specified note.
**Overloads**

    def get_note(request, options = nil) -> ::Grafeas::V1::Note

Pass arguments to `get_note` via a request object, either of type [Grafeas::V1::GetNoteRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GetNoteRequest "Grafeas::V1::GetNoteRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::GetNoteRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GetNoteRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_note(name: nil) -> ::Grafeas::V1::Note

Pass arguments to `get_note` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::GetNoteRequest.new

# Call the get_note method.
result = client.get_note request

# The returned object is of type Grafeas::V1::Note.
p result
```

### #get_occurrence

    def get_occurrence(request, options = nil) -> ::Grafeas::V1::Occurrence
    def get_occurrence(name: nil) -> ::Grafeas::V1::Occurrence

Gets the specified occurrence.
**Overloads**

    def get_occurrence(request, options = nil) -> ::Grafeas::V1::Occurrence

Pass arguments to `get_occurrence` via a request object, either of type [Grafeas::V1::GetOccurrenceRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GetOccurrenceRequest "Grafeas::V1::GetOccurrenceRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::GetOccurrenceRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GetOccurrenceRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_occurrence(name: nil) -> ::Grafeas::V1::Occurrence

Pass arguments to `get_occurrence` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- The name of the occurrence in the form of `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::GetOccurrenceRequest.new

# Call the get_occurrence method.
result = client.get_occurrence request

# The returned object is of type Grafeas::V1::Occurrence.
p result
```

### #get_occurrence_note

    def get_occurrence_note(request, options = nil) -> ::Grafeas::V1::Note
    def get_occurrence_note(name: nil) -> ::Grafeas::V1::Note

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

    def get_occurrence_note(request, options = nil) -> ::Grafeas::V1::Note

Pass arguments to `get_occurrence_note` via a request object, either of type [Grafeas::V1::GetOccurrenceNoteRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GetOccurrenceNoteRequest "Grafeas::V1::GetOccurrenceNoteRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::GetOccurrenceNoteRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GetOccurrenceNoteRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_occurrence_note(name: nil) -> ::Grafeas::V1::Note

Pass arguments to `get_occurrence_note` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- The name of the occurrence in the form of `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::GetOccurrenceNoteRequest.new

# Call the get_occurrence_note method.
result = client.get_occurrence_note request

# The returned object is of type Grafeas::V1::Note.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new Grafeas client object.
**Yields**

- (config) --- Configure the Grafeas client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Grafeas-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Grafeas-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Grafeas::V1::Grafeas::Client.new

# Create a client using a custom configuration
client = ::Grafeas::V1::Grafeas::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_note_occurrences

    def list_note_occurrences(request, options = nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>
    def list_note_occurrences(name: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>

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

    def list_note_occurrences(request, options = nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>

Pass arguments to `list_note_occurrences` via a request object, either of type [ListNoteOccurrencesRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-ListNoteOccurrencesRequest "Grafeas::V1::ListNoteOccurrencesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::ListNoteOccurrencesRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-ListNoteOccurrencesRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_note_occurrences(name: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>

Pass arguments to `list_note_occurrences` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- The name of the note to list occurrences for in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
- **filter** (::String) --- The filter expression.
- **page_size** (::Integer) --- Number of occurrences to return in the list.
- **page_token** (::String) --- Token to provide to skip to a particular spot in the list.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::ListNoteOccurrencesRequest.new

# Call the list_note_occurrences method.
result = client.list_note_occurrences request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Grafeas::V1::Occurrence.
  p item
end
```

### #list_notes

    def list_notes(request, options = nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Note>
    def list_notes(parent: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Note>

Lists notes for the specified project.
**Overloads**

    def list_notes(request, options = nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Note>

Pass arguments to `list_notes` via a request object, either of type [ListNotesRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-ListNotesRequest "Grafeas::V1::ListNotesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::ListNotesRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-ListNotesRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_notes(parent: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Note>

Pass arguments to `list_notes` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- The name of the project to list notes for in the form of `projects/[PROJECT_ID]`.
- **filter** (::String) --- The filter expression.
- **page_size** (::Integer) --- Number of notes to return in the list. Must be positive. Max allowed page size is 1000. If not specified, page size defaults to 20.
- **page_token** (::String) --- Token to provide to skip to a particular spot in the list.
- **return_partial_success** (::Boolean) --- If set, the request will return all reachable Notes and report all unreachable regions in the `unreachable` field in the response.


  Only applicable for requests in the global region.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::ListNotesRequest.new

# Call the list_notes method.
result = client.list_notes request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Grafeas::V1::Note.
  p item
end
```

### #list_occurrences

    def list_occurrences(request, options = nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>
    def list_occurrences(parent: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>

Lists occurrences for the specified project.
**Overloads**

    def list_occurrences(request, options = nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>

Pass arguments to `list_occurrences` via a request object, either of type [ListOccurrencesRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-ListOccurrencesRequest "Grafeas::V1::ListOccurrencesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::ListOccurrencesRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-ListOccurrencesRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_occurrences(parent: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) -> ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>

Pass arguments to `list_occurrences` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- The name of the project to list occurrences for in the form of `projects/[PROJECT_ID]`.
- **filter** (::String) --- The filter expression.
- **page_size** (::Integer) --- Number of occurrences to return in the list. Must be positive. Max allowed page size is 1000. If not specified, page size defaults to 20.
- **page_token** (::String) --- Token to provide to skip to a particular spot in the list.
- **return_partial_success** (::Boolean) --- If set, the request will return all reachable Occurrences and report all unreachable regions in the `unreachable` field in the response.


  Only applicable for requests in the global region.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::ListOccurrencesRequest.new

# Call the list_occurrences method.
result = client.list_occurrences request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Grafeas::V1::Occurrence.
  p item
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_note

    def update_note(request, options = nil) -> ::Grafeas::V1::Note
    def update_note(name: nil, note: nil, update_mask: nil) -> ::Grafeas::V1::Note

Updates the specified note.
**Overloads**

    def update_note(request, options = nil) -> ::Grafeas::V1::Note

Pass arguments to `update_note` via a request object, either of type [UpdateNoteRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-UpdateNoteRequest "Grafeas::V1::UpdateNoteRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::UpdateNoteRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-UpdateNoteRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def update_note(name: nil, note: nil, update_mask: nil) -> ::Grafeas::V1::Note

Pass arguments to `update_note` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
- **note** ([::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- The updated note.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Google-Protobuf-FieldMask), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- The fields to update.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Grafeas::V1::Note](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Note))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::UpdateNoteRequest.new

# Call the update_note method.
result = client.update_note request

# The returned object is of type Grafeas::V1::Note.
p result
```

### #update_occurrence

    def update_occurrence(request, options = nil) -> ::Grafeas::V1::Occurrence
    def update_occurrence(name: nil, occurrence: nil, update_mask: nil) -> ::Grafeas::V1::Occurrence

Updates the specified occurrence.
**Overloads**

    def update_occurrence(request, options = nil) -> ::Grafeas::V1::Occurrence

Pass arguments to `update_occurrence` via a request object, either of type [UpdateOccurrenceRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-UpdateOccurrenceRequest "Grafeas::V1::UpdateOccurrenceRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Grafeas::V1::UpdateOccurrenceRequest](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-UpdateOccurrenceRequest), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def update_occurrence(name: nil, occurrence: nil, update_mask: nil) -> ::Grafeas::V1::Occurrence

Pass arguments to `update_occurrence` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- The name of the occurrence in the form of `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
- **occurrence** ([::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- The updated occurrence.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Google-Protobuf-FieldMask), [::Hash](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Hash)) --- The fields to update.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Grafeas::V1::Occurrence](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-Occurrence))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "grafeas/v1"

# Create a client object. The client can be reused for multiple calls.
client = Grafeas::V1::Grafeas::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Grafeas::V1::UpdateOccurrenceRequest.new

# Call the update_occurrence method.
result = client.update_occurrence request

# The returned object is of type Grafeas::V1::Occurrence.
p result
```