# Google Cloud Eventarc V1 Client - Class Trigger (2.3.1)

2.3.1 (latest) 2.3.0 2.2.1 2.1.5 2.0.1 1.3.5 1.2.2 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud Eventarc V1 Client class Trigger.

A representation of the trigger resource.

Generated from protobuf message `google.cloud.eventarc.v1.Trigger`

## Namespace

Google \\ Cloud \\ Eventarc \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Required. The resource name of the trigger. Must be unique within the location of the project and must be in `projects/{project}/locations/{location}/triggers/{trigger}` format. |
| `↳ uid` | `string` Output only. Server-assigned unique identifier for the trigger. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The creation time. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The last-modified time. |
| `↳ event_filters` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-eventarc/latest/V1.EventFilter>` Required. Unordered list. The list of filters that applies to event attributes. Only events that match all the provided filters are sent to the destination. |
| `↳ service_account` | `string` Optional. The IAM service account email associated with the trigger. The service account represents the identity of the trigger. The `iam.serviceAccounts.actAs` permission must be granted on the service account to allow a principal to impersonate the service account. For more information, see the [Roles and permissions](https://docs.cloud.google.com/eventarc/docs/all-roles-permissions) page specific to the trigger destination. |
| `↳ destination` | `https://docs.cloud.google.com/php/docs/reference/cloud-eventarc/latest/V1.Destination` Required. Destination specifies where the events should be sent to. |
| `↳ transport` | `https://docs.cloud.google.com/php/docs/reference/cloud-eventarc/latest/V1.Transport` Optional. To deliver messages, Eventarc might use other Google Cloud products as a transport intermediary. This field contains a reference to that transport intermediary. This information can be used for debugging purposes. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. User labels attached to the triggers that can be used to group resources. |
| `↳ channel` | `string` Optional. The name of the channel associated with the trigger in `projects/{project}/locations/{location}/channels/{channel}` format. You must provide a channel to receive events from Eventarc SaaS partners. |
| `↳ conditions` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Output only. The reason(s) why a trigger is in FAILED state. |
| `↳ event_data_content_type` | `string` Optional. EventDataContentType specifies the type of payload in MIME format that is expected from the CloudEvent data field. This is set to `application/json` if the value is not defined. |
| `↳ satisfies_pzs` | `bool` Output only. Whether or not this Trigger satisfies the requirements of physical zone separation |
| `↳ retry_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-eventarc/latest/V1.Trigger.RetryPolicy` Optional. The retry policy to use in the Trigger. If unset, event delivery will be retried for up to 24 hours by default: <https://cloud.google.com/eventarc/docs/retry-events> |
| `↳ etag` | `string` Output only. This checksum is computed by the server based on the value of other fields, and might be sent only on create requests to ensure that the client has an up-to-date value before proceeding. |

### getName

Required. The resource name of the trigger. Must be unique within the
location of the project and must be in
`projects/{project}/locations/{location}/triggers/{trigger}` format.

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

### setName

Required. The resource name of the trigger. Must be unique within the
location of the project and must be in
`projects/{project}/locations/{location}/triggers/{trigger}` format.

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

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

### getUid

Output only. Server-assigned unique identifier for the trigger. The value
is a UUID4 string and guaranteed to remain unchanged until the resource is
deleted.

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

### setUid

Output only. Server-assigned unique identifier for the trigger. The value
is a UUID4 string and guaranteed to remain unchanged until the resource is
deleted.

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

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

### getCreateTime

Output only. The creation time.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The creation time.

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

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

### getUpdateTime

Output only. The last-modified time.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The last-modified time.

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

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

### getEventFilters

Required. Unordered list. The list of filters that applies to event
attributes. Only events that match all the provided filters are sent to the
destination.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-eventarc/latest/V1.EventFilter>` |   |

### setEventFilters

Required. Unordered list. The list of filters that applies to event
attributes. Only events that match all the provided filters are sent to the
destination.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-eventarc/latest/V1.EventFilter>` |

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

### getServiceAccount

Optional. The IAM service account email associated with the trigger. The
service account represents the identity of the trigger.

The `iam.serviceAccounts.actAs` permission must be granted on the service
account to allow a principal to impersonate the service account. For more
information, see the
[Roles and permissions](https://docs.cloud.google.com/eventarc/docs/all-roles-permissions) page specific
to the trigger destination.

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

### setServiceAccount

Optional. The IAM service account email associated with the trigger. The
service account represents the identity of the trigger.

The `iam.serviceAccounts.actAs` permission must be granted on the service
account to allow a principal to impersonate the service account. For more
information, see the
[Roles and permissions](https://docs.cloud.google.com/eventarc/docs/all-roles-permissions) page specific
to the trigger destination.

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

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

### getDestination

Required. Destination specifies where the events should be sent to.

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

### hasDestination

### clearDestination

### setDestination

Required. Destination specifies where the events should be sent to.

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

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

### getTransport

Optional. To deliver messages, Eventarc might use other Google Cloud
products as a transport intermediary. This field contains a reference to
that transport intermediary. This information can be used for debugging
purposes.

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

### hasTransport

### clearTransport

### setTransport

Optional. To deliver messages, Eventarc might use other Google Cloud
products as a transport intermediary. This field contains a reference to
that transport intermediary. This information can be used for debugging
purposes.

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

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

### getLabels

Optional. User labels attached to the triggers that can be used to group
resources.

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

### setLabels

Optional. User labels attached to the triggers that can be used to group
resources.

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

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

### getChannel

Optional. The name of the channel associated with the trigger in
`projects/{project}/locations/{location}/channels/{channel}` format.

You must provide a channel to receive events from Eventarc SaaS partners.

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

### setChannel

Optional. The name of the channel associated with the trigger in
`projects/{project}/locations/{location}/channels/{channel}` format.

You must provide a channel to receive events from Eventarc SaaS partners.

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

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

### getConditions

Output only. The reason(s) why a trigger is in FAILED state.

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

### setConditions

Output only. The reason(s) why a trigger is in FAILED state.

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

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

### getEventDataContentType

Optional. EventDataContentType specifies the type of payload in MIME
format that is expected from the CloudEvent data field. This is set to
`application/json` if the value is not defined.

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

### setEventDataContentType

Optional. EventDataContentType specifies the type of payload in MIME
format that is expected from the CloudEvent data field. This is set to
`application/json` if the value is not defined.

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

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

### getSatisfiesPzs

Output only. Whether or not this Trigger satisfies the requirements of
physical zone separation

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setSatisfiesPzs

Output only. Whether or not this Trigger satisfies the requirements of
physical zone separation

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

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

### getRetryPolicy

Optional. The retry policy to use in the Trigger.

If unset, event delivery will be retried for up to 24 hours by default:
<https://cloud.google.com/eventarc/docs/retry-events>

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

### hasRetryPolicy

### clearRetryPolicy

### setRetryPolicy

Optional. The retry policy to use in the Trigger.

If unset, event delivery will be retried for up to 24 hours by default:
<https://cloud.google.com/eventarc/docs/retry-events>

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

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

### getEtag

Output only. This checksum is computed by the server based on the value of
other fields, and might be sent only on create requests to ensure that the
client has an up-to-date value before proceeding.

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

### setEtag

Output only. This checksum is computed by the server based on the value of
other fields, and might be sent only on create requests to ensure that the
client has an up-to-date value before proceeding.

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

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