# Grafeas V1 Client - Class GrafeasClient (1.7.0)

1.7.0 (latest) 1.6.0 1.5.0 1.4.0 1.3.2 1.2.2 1.1.3 1.0.0 0.10.3 0.9.0 0.8.3 0.7.1 0.6.0 0.5.0 0.4.4 Reference documentation and code samples for the Grafeas V1 Client class GrafeasClient.

Service Description: [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.

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.

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 parseName method to extract the individual identifiers
contained within formatted names that are returned by the API.

## Namespace

Grafeas \\ V1 \\ Client

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `array|https://docs.cloud.google.com/php/docs/reference/gax/latest/Options.ClientOptions.html` Optional. Options for configuring the service API wrapper. |
| `↳ apiEndpoint` | `string` The address of the API remote host. May optionally include the port, formatted as " |
| `↳ credentials` | `https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html|https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html` This option should only be used with a pre-constructed [Google\\Auth\\FetchAuthTokenInterface](https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html) or [Google\\ApiCore\\CredentialsWrapper](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html) object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. **Important** : If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly `use Google\Auth\Credentials\ServiceAccountCredentials; use Grafeas\V1\GrafeasClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new GrafeasClient(['credentials' => $creds]);` <https://cloud.google.com/docs/authentication/external/externally-sourced-credentials> |
| `↳ credentialsConfig` | `array` Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see [Google\\ApiCore\\CredentialsWrapper::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html#_Google_ApiCore_CredentialsWrapper__build__) . |
| `↳ disableRetries` | `bool` Determines whether or not retries defined by the client configuration should be disabled. Defaults to `false`. |
| `↳ clientConfig` | `string|array` Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
| `↳ transport` | `string|https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html` The transport used for executing network requests. May be either the string `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. *Advanced usage* : Additionally, it is possible to pass in an already instantiated [Google\\ApiCore\\Transport\\TransportInterface](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html) object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored. |
| `↳ transportConfig` | `array` Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = \[ 'grpc' =\> \[...\], 'rest' =\> \[...\], \]; See the [Google\\ApiCore\\Transport\\GrpcTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.GrpcTransport.html#_Google_ApiCore_Transport_GrpcTransport__build__) and [Google\\ApiCore\\Transport\\RestTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.RestTransport.html#_Google_ApiCore_Transport_RestTransport__build__) methods for the supported options. |
| `↳ clientCertSource` | `callable` A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
| `↳ logger` | `false|Psr\Log\LoggerInterface` A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
| `↳ universeDomain` | `string` The service domain for the client. Defaults to 'googleapis.com'. |

### batchCreateNotes

Creates new notes in batch.

The async variant is [GrafeasClient::batchCreateNotesAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__batchCreateNotesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.BatchCreateNotesRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.BatchCreateNotesResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Grafeas\V1\BatchCreateNotesRequest;
    use Grafeas\V1\BatchCreateNotesResponse;
    use Grafeas\V1\Client\GrafeasClient;

    /**
     * @param string $formattedParent The name of the project in the form of `projects/[PROJECT_ID]`, under which
     *                                the notes are to be created. Please see
     *                                {@see GrafeasClient::projectName()} for help formatting this field.
     */
    function batch_create_notes_sample(string $formattedParent): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $notes = [];
        $request = (new BatchCreateNotesRequest())
            ->setParent($formattedParent)
            ->setNotes($notes);

        // Call the API and handle any network failures.
        try {
            /** @var BatchCreateNotesResponse $response */
            $response = $grafeasClient->batchCreateNotes($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = GrafeasClient::projectName('[PROJECT]');

        batch_create_notes_sample($formattedParent);
    }

### batchCreateOccurrences

Creates new occurrences in batch.

The async variant is [GrafeasClient::batchCreateOccurrencesAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__batchCreateOccurrencesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.BatchCreateOccurrencesRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.BatchCreateOccurrencesResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Grafeas\V1\BatchCreateOccurrencesRequest;
    use Grafeas\V1\BatchCreateOccurrencesResponse;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\Occurrence;

    /**
     * @param string $formattedParent The name of the project in the form of `projects/[PROJECT_ID]`, under which
     *                                the occurrences are to be created. Please see
     *                                {@see GrafeasClient::projectName()} for help formatting this field.
     */
    function batch_create_occurrences_sample(string $formattedParent): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $occurrences = [new Occurrence()];
        $request = (new BatchCreateOccurrencesRequest())
            ->setParent($formattedParent)
            ->setOccurrences($occurrences);

        // Call the API and handle any network failures.
        try {
            /** @var BatchCreateOccurrencesResponse $response */
            $response = $grafeasClient->batchCreateOccurrences($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = GrafeasClient::projectName('[PROJECT]');

        batch_create_occurrences_sample($formattedParent);
    }

### createNote

Creates a new note.

The async variant is [GrafeasClient::createNoteAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__createNoteAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.CreateNoteRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Note` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\CreateNoteRequest;
    use Grafeas\V1\Note;

    /**
     * @param string $formattedParent The name of the project in the form of `projects/[PROJECT_ID]`, under which
     *                                the note is to be created. Please see
     *                                {@see GrafeasClient::projectName()} for help formatting this field.
     * @param string $noteId          The ID to use for this note.
     */
    function create_note_sample(string $formattedParent, string $noteId): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $note = new Note();
        $request = (new CreateNoteRequest())
            ->setParent($formattedParent)
            ->setNoteId($noteId)
            ->setNote($note);

        // Call the API and handle any network failures.
        try {
            /** @var Note $response */
            $response = $grafeasClient->createNote($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = GrafeasClient::projectName('[PROJECT]');
        $noteId = '[NOTE_ID]';

        create_note_sample($formattedParent, $noteId);
    }

### createOccurrence

Creates a new occurrence.

The async variant is [GrafeasClient::createOccurrenceAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__createOccurrenceAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.CreateOccurrenceRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Occurrence` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\CreateOccurrenceRequest;
    use Grafeas\V1\Occurrence;

    /**
     * @param string $formattedParent The name of the project in the form of `projects/[PROJECT_ID]`, under which
     *                                the occurrence is to be created. Please see
     *                                {@see GrafeasClient::projectName()} for help formatting this field.
     */
    function create_occurrence_sample(string $formattedParent): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $occurrence = new Occurrence();
        $request = (new CreateOccurrenceRequest())
            ->setParent($formattedParent)
            ->setOccurrence($occurrence);

        // Call the API and handle any network failures.
        try {
            /** @var Occurrence $response */
            $response = $grafeasClient->createOccurrence($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = GrafeasClient::projectName('[PROJECT]');

        create_occurrence_sample($formattedParent);
    }

### deleteNote

Deletes the specified note.

The async variant is [GrafeasClient::deleteNoteAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__deleteNoteAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.DeleteNoteRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\DeleteNoteRequest;

    /**
     * @param string $formattedName The name of the note in the form of
     *                              `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. Please see
     *                              {@see GrafeasClient::noteName()} for help formatting this field.
     */
    function delete_note_sample(string $formattedName): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $request = (new DeleteNoteRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            $grafeasClient->deleteNote($request);
            printf('Call completed successfully.' . PHP_EOL);
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = GrafeasClient::noteName('[PROJECT]', '[NOTE]');

        delete_note_sample($formattedName);
    }

### 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.

The async variant is [GrafeasClient::deleteOccurrenceAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__deleteOccurrenceAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.DeleteOccurrenceRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\DeleteOccurrenceRequest;

    /**
     * @param string $formattedName The name of the occurrence in the form of
     *                              `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. Please see
     *                              {@see GrafeasClient::occurrenceName()} for help formatting this field.
     */
    function delete_occurrence_sample(string $formattedName): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $request = (new DeleteOccurrenceRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            $grafeasClient->deleteOccurrence($request);
            printf('Call completed successfully.' . PHP_EOL);
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = GrafeasClient::occurrenceName('[PROJECT]', '[OCCURRENCE]');

        delete_occurrence_sample($formattedName);
    }

### getNote

Gets the specified note.

The async variant is [GrafeasClient::getNoteAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__getNoteAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.GetNoteRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Note` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\GetNoteRequest;
    use Grafeas\V1\Note;

    /**
     * @param string $formattedName The name of the note in the form of
     *                              `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. Please see
     *                              {@see GrafeasClient::noteName()} for help formatting this field.
     */
    function get_note_sample(string $formattedName): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $request = (new GetNoteRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var Note $response */
            $response = $grafeasClient->getNote($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = GrafeasClient::noteName('[PROJECT]', '[NOTE]');

        get_note_sample($formattedName);
    }

### getOccurrence

Gets the specified occurrence.

The async variant is [GrafeasClient::getOccurrenceAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__getOccurrenceAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.GetOccurrenceRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Occurrence` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\GetOccurrenceRequest;
    use Grafeas\V1\Occurrence;

    /**
     * @param string $formattedName The name of the occurrence in the form of
     *                              `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. Please see
     *                              {@see GrafeasClient::occurrenceName()} for help formatting this field.
     */
    function get_occurrence_sample(string $formattedName): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $request = (new GetOccurrenceRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var Occurrence $response */
            $response = $grafeasClient->getOccurrence($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = GrafeasClient::occurrenceName('[PROJECT]', '[OCCURRENCE]');

        get_occurrence_sample($formattedName);
    }

### 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.

The async variant is [GrafeasClient::getOccurrenceNoteAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__getOccurrenceNoteAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.GetOccurrenceNoteRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Note` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\GetOccurrenceNoteRequest;
    use Grafeas\V1\Note;

    /**
     * @param string $formattedName The name of the occurrence in the form of
     *                              `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. Please see
     *                              {@see GrafeasClient::occurrenceName()} for help formatting this field.
     */
    function get_occurrence_note_sample(string $formattedName): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $request = (new GetOccurrenceNoteRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var Note $response */
            $response = $grafeasClient->getOccurrenceNote($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = GrafeasClient::occurrenceName('[PROJECT]', '[OCCURRENCE]');

        get_occurrence_note_sample($formattedName);
    }

### listNoteOccurrences

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

The async variant is [GrafeasClient::listNoteOccurrencesAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__listNoteOccurrencesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.ListNoteOccurrencesRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\ListNoteOccurrencesRequest;
    use Grafeas\V1\Occurrence;

    /**
     * @param string $formattedName The name of the note to list occurrences for in the form of
     *                              `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. Please see
     *                              {@see GrafeasClient::noteName()} for help formatting this field.
     */
    function list_note_occurrences_sample(string $formattedName): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $request = (new ListNoteOccurrencesRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $grafeasClient->listNoteOccurrences($request);

            /** @var Occurrence $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = GrafeasClient::noteName('[PROJECT]', '[NOTE]');

        list_note_occurrences_sample($formattedName);
    }

### listNotes

Lists notes for the specified project.

The async variant is [GrafeasClient::listNotesAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__listNotesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.ListNotesRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\ListNotesRequest;
    use Grafeas\V1\Note;

    /**
     * @param string $formattedParent The name of the project to list notes for in the form of
     *                                `projects/[PROJECT_ID]`. Please see
     *                                {@see GrafeasClient::projectName()} for help formatting this field.
     */
    function list_notes_sample(string $formattedParent): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $request = (new ListNotesRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $grafeasClient->listNotes($request);

            /** @var Note $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = GrafeasClient::projectName('[PROJECT]');

        list_notes_sample($formattedParent);
    }

### listOccurrences

Lists occurrences for the specified project.

The async variant is [GrafeasClient::listOccurrencesAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__listOccurrencesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.ListOccurrencesRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\ListOccurrencesRequest;
    use Grafeas\V1\Occurrence;

    /**
     * @param string $formattedParent The name of the project to list occurrences for in the form of
     *                                `projects/[PROJECT_ID]`. Please see
     *                                {@see GrafeasClient::projectName()} for help formatting this field.
     */
    function list_occurrences_sample(string $formattedParent): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $request = (new ListOccurrencesRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $grafeasClient->listOccurrences($request);

            /** @var Occurrence $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = GrafeasClient::projectName('[PROJECT]');

        list_occurrences_sample($formattedParent);
    }

### updateNote

Updates the specified note.

The async variant is [GrafeasClient::updateNoteAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__updateNoteAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.UpdateNoteRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Note` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\Note;
    use Grafeas\V1\UpdateNoteRequest;

    /**
     * @param string $formattedName The name of the note in the form of
     *                              `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. Please see
     *                              {@see GrafeasClient::noteName()} for help formatting this field.
     */
    function update_note_sample(string $formattedName): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $note = new Note();
        $request = (new UpdateNoteRequest())
            ->setName($formattedName)
            ->setNote($note);

        // Call the API and handle any network failures.
        try {
            /** @var Note $response */
            $response = $grafeasClient->updateNote($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = GrafeasClient::noteName('[PROJECT]', '[NOTE]');

        update_note_sample($formattedName);
    }

### updateOccurrence

Updates the specified occurrence.

The async variant is [GrafeasClient::updateOccurrenceAsync()](https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Client.GrafeasClient#_Grafeas_V1_Client_GrafeasClient__updateOccurrenceAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.UpdateOccurrenceRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Occurrence` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Grafeas\V1\Client\GrafeasClient;
    use Grafeas\V1\Occurrence;
    use Grafeas\V1\UpdateOccurrenceRequest;

    /**
     * @param string $formattedName The name of the occurrence in the form of
     *                              `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. Please see
     *                              {@see GrafeasClient::occurrenceName()} for help formatting this field.
     */
    function update_occurrence_sample(string $formattedName): void
    {
        // Create a client.
        $grafeasClient = new GrafeasClient();

        // Prepare the request message.
        $occurrence = new Occurrence();
        $request = (new UpdateOccurrenceRequest())
            ->setName($formattedName)
            ->setOccurrence($occurrence);

        // Call the API and handle any network failures.
        try {
            /** @var Occurrence $response */
            $response = $grafeasClient->updateOccurrence($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = GrafeasClient::occurrenceName('[PROJECT]', '[OCCURRENCE]');

        update_occurrence_sample($formattedName);
    }

### batchCreateNotesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.BatchCreateNotesRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.BatchCreateNotesResponse>` |   |

### batchCreateOccurrencesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.BatchCreateOccurrencesRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.BatchCreateOccurrencesResponse>` |   |

### createNoteAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.CreateNoteRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Note>` |   |

### createOccurrenceAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.CreateOccurrenceRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Occurrence>` |   |

### deleteNoteAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.DeleteNoteRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### deleteOccurrenceAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.DeleteOccurrenceRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### getNoteAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.GetNoteRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Note>` |   |

### getOccurrenceAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.GetOccurrenceRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Occurrence>` |   |

### getOccurrenceNoteAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.GetOccurrenceNoteRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Note>` |   |

### listNoteOccurrencesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.ListNoteOccurrencesRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listNotesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.ListNotesRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listOccurrencesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.ListOccurrencesRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### updateNoteAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.UpdateNoteRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Note>` |   |

### updateOccurrenceAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.UpdateOccurrenceRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Occurrence>` |   |

### static::noteName

Formats a string containing the fully-qualified path to represent a note
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `note` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted note resource. |

### static::occurrenceName

Formats a string containing the fully-qualified path to represent a occurrence
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `occurrence` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted occurrence resource. |

### static::projectName

Formats a string containing the fully-qualified path to represent a project
resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted project resource. |

### static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported:
Template: Pattern

- note: projects/{project}/notes/{note}
- occurrence: projects/{project}/occurrences/{occurrence}
- project: projects/{project}

The optional $template argument can be supplied to specify a particular pattern,
and must match one of the templates listed above. If no $template argument is
provided, or if the $template argument does not match one of the templates
listed, then parseName will check each of the supported templates, and return
the first match.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `formattedName` | `string` The formatted name string |
| `template` | `?string` Optional name of template to match |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `array` | An associative array from name component IDs to component values. |