# Stackdriver Monitoring V3 Client - Class AlertStrategy (2.2.2)

2.2.2 (latest) 2.2.1 2.1.2 2.0.1 1.12.1 1.11.1 1.10.3 1.9.0 1.8.0 1.7.1 1.6.0 1.5.1 1.4.0 1.3.2 1.2.2 Reference documentation and code samples for the Stackdriver Monitoring V3 Client class AlertStrategy.

Control over how the notification channels in `notification_channels`
are notified when this alert fires.

Generated from protobuf message `google.monitoring.v3.AlertPolicy.AlertStrategy`

## Namespace

Google \\ Cloud \\ Monitoring \\ V3 \\ AlertPolicy

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ notification_rate_limit` | `https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.AlertPolicy.AlertStrategy.NotificationRateLimit` Required for log-based alerting policies, i.e. policies with a `LogMatch` condition. This limit is not implemented for alerting policies that do not have a LogMatch condition. |
| `↳ notification_prompts` | `int[]` For log-based alert policies, the notification prompts is always \[OPENED\]. For non log-based alert policies, the notification prompts can be \[OPENED\] or \[OPENED, CLOSED\]. |
| `↳ auto_close` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` If an alerting policy that was active has no data for this long, any open incidents will close |
| `↳ notification_channel_strategy` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.AlertPolicy.AlertStrategy.NotificationChannelStrategy>` Control how notifications will be sent out, on a per-channel basis. |

### getNotificationRateLimit

Required for log-based alerting policies, i.e. policies with a `LogMatch`
condition.

This limit is not implemented for alerting policies that do not have
a LogMatch condition.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.AlertPolicy.AlertStrategy.NotificationRateLimit|null` |   |

### hasNotificationRateLimit

### clearNotificationRateLimit

### setNotificationRateLimit

Required for log-based alerting policies, i.e. policies with a `LogMatch`
condition.

This limit is not implemented for alerting policies that do not have
a LogMatch condition.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.AlertPolicy.AlertStrategy.NotificationRateLimit` |

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

### getNotificationPrompts

For log-based alert policies, the notification prompts is always
\[OPENED\]. For non log-based alert policies, the notification prompts can
be \[OPENED\] or \[OPENED, CLOSED\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<int>` |   |

### setNotificationPrompts

For log-based alert policies, the notification prompts is always
\[OPENED\]. For non log-based alert policies, the notification prompts can
be \[OPENED\] or \[OPENED, CLOSED\].

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

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

### getAutoClose

If an alerting policy that was active has no data for this long, any open
incidents will close

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

### hasAutoClose

### clearAutoClose

### setAutoClose

If an alerting policy that was active has no data for this long, any open
incidents will close

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

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

### getNotificationChannelStrategy

Control how notifications will be sent out, on a per-channel basis.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.AlertPolicy.AlertStrategy.NotificationChannelStrategy>` |   |

### setNotificationChannelStrategy

Control how notifications will be sent out, on a per-channel basis.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.AlertPolicy.AlertStrategy.NotificationChannelStrategy>` |

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