# Cloud Monitoring V3 API - Class Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest (v1.10.0)

1.10.0 (latest) 1.9.0 1.8.0 1.7.1 1.6.1 1.5.1 1.4.0 1.3.0 1.2.0 1.1.0 1.0.1 0.18.0 0.17.0 0.16.0 0.15.2 0.14.0 0.13.0 0.12.1 0.11.0 0.10.0 0.9.0 0.8.0 0.7.1 Reference documentation and code samples for the Cloud Monitoring V3 API class Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest.

The protocol for the `UpdateAlertPolicy` request.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #alert_policy

    def alert_policy() -> ::Google::Cloud::Monitoring::V3::AlertPolicy

**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy)) --- Required. The updated alerting policy or the updated values for the fields listed in `update_mask`. If `update_mask` is not empty, any fields in this policy that are not in `update_mask` are ignored.

### #alert_policy=

    def alert_policy=(value) -> ::Google::Cloud::Monitoring::V3::AlertPolicy

**Parameter**

- **value** ([::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy)) --- Required. The updated alerting policy or the updated values for the fields listed in `update_mask`. If `update_mask` is not empty, any fields in this policy that are not in `update_mask` are ignored.
**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy)) --- Required. The updated alerting policy or the updated values for the fields listed in `update_mask`. If `update_mask` is not empty, any fields in this policy that are not in `update_mask` are ignored.

### #update_mask

    def update_mask() -> ::Google::Protobuf::FieldMask

**Returns**

- ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-FieldMask)) ---

  Optional. A list of alerting policy field names. If this field is not
  empty, each listed field in the existing alerting policy is set to the
  value of the corresponding field in the supplied policy (`alert_policy`),
  or to the field's default value if the field is not in the supplied
  alerting policy. Fields not listed retain their previous value.

  Examples of valid field masks include `display_name`, `documentation`,
  `documentation.content`, `documentation.mime_type`, `user_labels`,
  `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc.

  If this field is empty, then the supplied alerting policy replaces the
  existing policy. It is the same as deleting the existing policy and
  adding the supplied policy, except for the following:
  - The new policy will have the same `[ALERT_POLICY_ID]` as the former policy. This gives you continuity with the former policy in your notifications and incidents.
  - Conditions in the new policy will keep their former `[CONDITION_ID]` if the supplied condition includes the `name` field with that `[CONDITION_ID]`. If the supplied condition omits the `name` field, then a new `[CONDITION_ID]` is created.

### #update_mask=

    def update_mask=(value) -> ::Google::Protobuf::FieldMask

**Parameter**

- **value** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-FieldMask)) ---

  Optional. A list of alerting policy field names. If this field is not
  empty, each listed field in the existing alerting policy is set to the
  value of the corresponding field in the supplied policy (`alert_policy`),
  or to the field's default value if the field is not in the supplied
  alerting policy. Fields not listed retain their previous value.

  Examples of valid field masks include `display_name`, `documentation`,
  `documentation.content`, `documentation.mime_type`, `user_labels`,
  `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc.

  If this field is empty, then the supplied alerting policy replaces the
  existing policy. It is the same as deleting the existing policy and
  adding the supplied policy, except for the following:
  - The new policy will have the same `[ALERT_POLICY_ID]` as the former policy. This gives you continuity with the former policy in your notifications and incidents.
  - Conditions in the new policy will keep their former `[CONDITION_ID]` if the supplied condition includes the `name` field with that `[CONDITION_ID]`. If the supplied condition omits the `name` field, then a new `[CONDITION_ID]` is created.
**Returns**

- ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-FieldMask)) ---

  Optional. A list of alerting policy field names. If this field is not
  empty, each listed field in the existing alerting policy is set to the
  value of the corresponding field in the supplied policy (`alert_policy`),
  or to the field's default value if the field is not in the supplied
  alerting policy. Fields not listed retain their previous value.

  Examples of valid field masks include `display_name`, `documentation`,
  `documentation.content`, `documentation.mime_type`, `user_labels`,
  `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc.

  If this field is empty, then the supplied alerting policy replaces the
  existing policy. It is the same as deleting the existing policy and
  adding the supplied policy, except for the following:
  - The new policy will have the same `[ALERT_POLICY_ID]` as the former policy. This gives you continuity with the former policy in your notifications and incidents.
  - Conditions in the new policy will keep their former `[CONDITION_ID]` if the supplied condition includes the `name` field with that `[CONDITION_ID]`. If the supplied condition omits the `name` field, then a new `[CONDITION_ID]` is created.