# Cloud Monitoring V3 API - Class Google::Cloud::Monitoring::V3::AlertPolicyService::Client (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::AlertPolicyService::Client.

Client for the AlertPolicyService service.


<br />

The AlertPolicyService API is used to manage (list, create, delete,
edit) alert policies in Cloud Monitoring. An alerting policy is
a description of the conditions under which some aspect of your
system is considered to be "unhealthy" and the ways to notify
people or services about this state. In addition to using this API, alert
policies can also be managed through
[Cloud Monitoring](https://cloud.google.com/monitoring/docs/),
which can be reached by clicking the "Monitoring" tab in
[Cloud console](https://console.cloud.google.com/).

## Inherits

- Object

## Includes

- [Google::Cloud::Monitoring::V3::AlertPolicyService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicyService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the AlertPolicyService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicyService-Client-Configuration "Google::Cloud::Monitoring::V3::AlertPolicyService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicyService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicyService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all AlertPolicyService clients
::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the AlertPolicyService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicyService-Client#Google__Cloud__Monitoring__V3__AlertPolicyService__Client_configure_class_ "Google::Cloud::Monitoring::V3::AlertPolicyService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicyService-Client-Configuration "Google::Cloud::Monitoring::V3::AlertPolicyService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicyService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicyService-Client-Configuration))

### #create_alert_policy

    def create_alert_policy(request, options = nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy
    def create_alert_policy(name: nil, alert_policy: nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy

Creates a new alerting policy.


<br />

Design your application to single-thread API calls that modify the state of
alerting policies in a single project. This includes calls to
CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy.
**Overloads**

    def create_alert_policy(request, options = nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy

Pass arguments to `create_alert_policy` via a request object, either of type [CreateAlertPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest "Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_alert_policy(name: nil, alert_policy: nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy

Pass arguments to `create_alert_policy` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in which to create the alerting policy. The format is:


      projects/[PROJECT_ID_OR_NUMBER]

  Note that this field names the parent container in which the alerting
  policy will be written, not the name of the created policy. \|name\| must be
  a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will
  return. The alerting policy that is returned will have a name that contains
  a normalized representation of this name as a prefix but adds a suffix of
  the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the
  container.
- **alert_policy** ([::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy), ::Hash) --- Required. The requested alerting policy. You should omit the `name` field in this policy. The name will be returned in the new policy, including a new `[ALERT_POLICY_ID]` value.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest.new

# Call the create_alert_policy method.
result = client.create_alert_policy request

# The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy.
p result
```

### #delete_alert_policy

    def delete_alert_policy(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_alert_policy(name: nil) -> ::Google::Protobuf::Empty

Deletes an alerting policy.


<br />

Design your application to single-thread API calls that modify the state of
alerting policies in a single project. This includes calls to
CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy.
**Overloads**

    def delete_alert_policy(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_alert_policy` via a request object, either of type [DeleteAlertPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-DeleteAlertPolicyRequest "Google::Cloud::Monitoring::V3::DeleteAlertPolicyRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::DeleteAlertPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-DeleteAlertPolicyRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def delete_alert_policy(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_alert_policy` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The alerting policy to delete. The format is:


      projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]

  For more information, see [AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy "Google::Cloud::Monitoring::V3::AlertPolicy (class)").
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

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

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::DeleteAlertPolicyRequest.new

# Call the delete_alert_policy method.
result = client.delete_alert_policy request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_alert_policy

    def get_alert_policy(request, options = nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy
    def get_alert_policy(name: nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy

Gets a single alerting policy.
**Overloads**

    def get_alert_policy(request, options = nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy

Pass arguments to `get_alert_policy` via a request object, either of type [GetAlertPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-GetAlertPolicyRequest "Google::Cloud::Monitoring::V3::GetAlertPolicyRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::GetAlertPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-GetAlertPolicyRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_alert_policy(name: nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy

Pass arguments to `get_alert_policy` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) ---

  Required. The alerting policy to retrieve. The format is:

      projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]

**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::GetAlertPolicyRequest.new

# Call the get_alert_policy method.
result = client.get_alert_policy request

# The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new AlertPolicyService client object.
**Yields**

- (config) --- Configure the AlertPolicyService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicyService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicyService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_alert_policies

    def list_alert_policies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::AlertPolicy>
    def list_alert_policies(name: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::AlertPolicy>

Lists the existing alerting policies for the workspace.
**Overloads**

    def list_alert_policies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::AlertPolicy>

Pass arguments to `list_alert_policies` via a request object, either of type [ListAlertPoliciesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListAlertPoliciesRequest "Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListAlertPoliciesRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_alert_policies(name: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::AlertPolicy>

Pass arguments to `list_alert_policies` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) whose alert policies are to be listed. The format is:


      projects/[PROJECT_ID_OR_NUMBER]

  Note that this field names the parent container in which the alerting
  policies to be listed are stored. To retrieve a single alerting policy
  by name, use the
  [GetAlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicyService-Client#Google__Cloud__Monitoring__V3__AlertPolicyService__Client_get_alert_policy_instance_ "Google::Cloud::Monitoring::V3::AlertPolicyService::Client#get_alert_policy (method)")
  operation, instead.
- **filter** (::String) --- Optional. If provided, this field specifies the criteria that must be met by alert policies to be included in the response.


  For more details, see [sorting and
  filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
- **order_by** (::String) --- Optional. A comma-separated list of fields by which to sort the result. Supports the same set of field references as the `filter` field. Entries can be prefixed with a minus sign to sort by the field in descending order.


  For more details, see [sorting and
  filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
- **page_size** (::Integer) --- Optional. The maximum number of results to return in a single response.
- **page_token** (::String) --- Optional. If this field is not empty then it must contain the `nextPageToken` value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest.new

# Call the list_alert_policies method.
result = client.list_alert_policies request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Monitoring::V3::AlertPolicy.
  p item
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_alert_policy

    def update_alert_policy(request, options = nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy
    def update_alert_policy(update_mask: nil, alert_policy: nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy

Updates an alerting policy. You can either replace the entire policy with
a new one or replace only certain fields in the current alerting policy by
specifying the fields to be updated via `updateMask`. Returns the
updated alerting policy.


<br />

Design your application to single-thread API calls that modify the state of
alerting policies in a single project. This includes calls to
CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy.
**Overloads**

    def update_alert_policy(request, options = nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy

Pass arguments to `update_alert_policy` via a request object, either of type [UpdateAlertPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-UpdateAlertPolicyRequest "Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-UpdateAlertPolicyRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def update_alert_policy(update_mask: nil, alert_policy: nil) -> ::Google::Cloud::Monitoring::V3::AlertPolicy

Pass arguments to `update_alert_policy` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

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

  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.
- **alert_policy** ([::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy), ::Hash) --- 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.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest.new

# Call the update_alert_policy method.
result = client.update_alert_policy request

# The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy.
p result
```