# Grafeas V1 Client - Class Occurrence (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 Occurrence.

An instance of an analysis type that has been found on a resource.

Generated from protobuf message `grafeas.v1.Occurrence`

## Namespace

Grafeas \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Output only. The name of the occurrence in the form of `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. |
| `↳ resource_uri` | `string` Required. Immutable. A URI that represents the resource for which the occurrence applies. For example, `https://gcr.io/project/image\@sha256:123abc` for a Docker image. |
| `↳ note_name` | `string` Required. Immutable. The analysis note associated with this occurrence, in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used as a filter in list requests. |
| `↳ kind` | `int` Output only. This explicitly denotes which of the occurrence details are specified. This field can be used as a filter in list requests. |
| `↳ remediation` | `string` A description of actions that can be taken to remedy the note. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time this occurrence was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time this occurrence was last updated. |
| `↳ vulnerability` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.VulnerabilityOccurrence` Describes a security vulnerability. |
| `↳ build` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.BuildOccurrence` Describes a verifiable build. |
| `↳ image` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.ImageOccurrence` Describes how this resource derives from the basis in the associated note. |
| `↳ package` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.PackageOccurrence` Describes the installation of a package on the linked resource. |
| `↳ deployment` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.DeploymentOccurrence` Describes the deployment of an artifact on a runtime. |
| `↳ discovery` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.DiscoveryOccurrence` Describes when a resource was discovered. |
| `↳ attestation` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.AttestationOccurrence` Describes an attestation of an artifact. |
| `↳ upgrade` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.UpgradeOccurrence` Describes an available package upgrade on the linked resource. |
| `↳ compliance` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.ComplianceOccurrence` Describes a compliance violation on a linked resource. |
| `↳ dsse_attestation` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.DSSEAttestationOccurrence` Describes an attestation of an artifact using dsse. |
| `↳ sbom_reference` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.SBOMReferenceOccurrence` Describes a specific SBOM reference occurrences. |
| `↳ secret` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.SecretOccurrence` Describes a secret. |
| `↳ envelope` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Envelope` <https://github.com/secure-systems-lab/dsse> |

### getName

Output only. The name of the occurrence in the form of
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Output only. The name of the occurrence in the form of
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResourceUri

Required. Immutable. A URI that represents the resource for which the
occurrence applies. For example,
`https://gcr.io/project/image\@sha256:123abc` for a Docker image.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setResourceUri

Required. Immutable. A URI that represents the resource for which the
occurrence applies. For example,
`https://gcr.io/project/image\@sha256:123abc` for a Docker image.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNoteName

Required. Immutable. The analysis note associated with this occurrence, in
the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be
used as a filter in list requests.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setNoteName

Required. Immutable. The analysis note associated with this occurrence, in
the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be
used as a filter in list requests.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getKind

Output only. This explicitly denotes which of the occurrence details are
specified. This field can be used as a filter in list requests.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setKind

Output only. This explicitly denotes which of the occurrence details are
specified. This field can be used as a filter in list requests.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRemediation

A description of actions that can be taken to remedy the note.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setRemediation

A description of actions that can be taken to remedy the note.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreateTime

Output only. The time this occurrence was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time this occurrence was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpdateTime

Output only. The time this occurrence was last updated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The time this occurrence was last updated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getVulnerability

Describes a security vulnerability.

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

### hasVulnerability

### setVulnerability

Describes a security vulnerability.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.VulnerabilityOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBuild

Describes a verifiable build.

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

### hasBuild

### setBuild

Describes a verifiable build.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.BuildOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getImage

Describes how this resource derives from the basis in the associated
note.

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

### hasImage

### setImage

Describes how this resource derives from the basis in the associated
note.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.ImageOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPackage

Describes the installation of a package on the linked resource.

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

### hasPackage

### setPackage

Describes the installation of a package on the linked resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.PackageOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDeployment

Describes the deployment of an artifact on a runtime.

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

### hasDeployment

### setDeployment

Describes the deployment of an artifact on a runtime.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.DeploymentOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDiscovery

Describes when a resource was discovered.

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

### hasDiscovery

### setDiscovery

Describes when a resource was discovered.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.DiscoveryOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAttestation

Describes an attestation of an artifact.

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

### hasAttestation

### setAttestation

Describes an attestation of an artifact.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.AttestationOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpgrade

Describes an available package upgrade on the linked resource.

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

### hasUpgrade

### setUpgrade

Describes an available package upgrade on the linked resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.UpgradeOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCompliance

Describes a compliance violation on a linked resource.

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

### hasCompliance

### setCompliance

Describes a compliance violation on a linked resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.ComplianceOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDsseAttestation

Describes an attestation of an artifact using dsse.

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

### hasDsseAttestation

### setDsseAttestation

Describes an attestation of an artifact using dsse.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.DSSEAttestationOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSbomReference

Describes a specific SBOM reference occurrences.

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

### hasSbomReference

### setSbomReference

Describes a specific SBOM reference occurrences.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.SBOMReferenceOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSecret

Describes a secret.

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

### hasSecret

### setSecret

Describes a secret.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.SecretOccurrence` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEnvelope

<https://github.com/secure-systems-lab/dsse>

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

### hasEnvelope

### clearEnvelope

### setEnvelope

<https://github.com/secure-systems-lab/dsse>

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Envelope` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDetails

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |