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

Request to create a new occurrence.

Generated from protobuf message `grafeas.v1.CreateOccurrenceRequest`

## Namespace

Grafeas \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` The name of the project in the form of `projects/[PROJECT_ID]`, under which the occurrence is to be created. |
| `↳ occurrence` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Occurrence` The occurrence to create. |

### getParent

The name of the project in the form of `projects/[PROJECT_ID]`, under which
the occurrence is to be created.

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

### setParent

The name of the project in the form of `projects/[PROJECT_ID]`, under which
the occurrence is to be created.

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

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

### getOccurrence

The occurrence to create.

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

### hasOccurrence

### clearOccurrence

### setOccurrence

The occurrence to create.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` The name of the project in the form of `projects/[PROJECT_ID]`, under which the occurrence is to be created. Please see GrafeasClient::projectName() for help formatting this field. |
| `occurrence` | `https://docs.cloud.google.com/php/docs/reference/grafeas/latest/V1.Occurrence` The occurrence to create. |

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