diff --git a/java-monitoring/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java b/java-monitoring/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java index 7bf5d904123f..f2bca1bae7f6 100644 --- a/java-monitoring/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java +++ b/java-monitoring/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java @@ -556,6 +556,10 @@ public final UnaryCallable getAlertPolicyCal /** * Creates a new alerting policy. * + *

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. + * *

Sample code: * *

{@code
@@ -598,6 +602,10 @@ public final AlertPolicy createAlertPolicy(ResourceName name, AlertPolicy alertP
   /**
    * Creates a new alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
@@ -640,6 +648,10 @@ public final AlertPolicy createAlertPolicy(OrganizationName name, AlertPolicy al
   /**
    * Creates a new alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
@@ -682,6 +694,10 @@ public final AlertPolicy createAlertPolicy(ProjectName name, AlertPolicy alertPo
   /**
    * Creates a new alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
@@ -721,6 +737,10 @@ public final AlertPolicy createAlertPolicy(String name, AlertPolicy alertPolicy)
   /**
    * Creates a new alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
@@ -750,6 +770,10 @@ public final AlertPolicy createAlertPolicy(CreateAlertPolicyRequest request) {
   /**
    * Creates a new alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
@@ -779,6 +803,10 @@ public final UnaryCallable createAlertPol
   /**
    * Deletes an alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
@@ -811,6 +839,10 @@ public final void deleteAlertPolicy(AlertPolicyName name) {
   /**
    * Deletes an alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
@@ -840,6 +872,10 @@ public final void deleteAlertPolicy(String name) {
   /**
    * Deletes an alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
@@ -870,6 +906,10 @@ public final void deleteAlertPolicy(DeleteAlertPolicyRequest request) {
   /**
    * Deletes an alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
@@ -902,6 +942,10 @@ public final UnaryCallable deleteAlertPolicyCal
    * only certain fields in the current alerting policy by specifying the fields to be updated via
    * `updateMask`. Returns the updated alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
@@ -952,6 +996,10 @@ public final AlertPolicy updateAlertPolicy(FieldMask updateMask, AlertPolicy ale
    * only certain fields in the current alerting policy by specifying the fields to be updated via
    * `updateMask`. Returns the updated alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
@@ -983,6 +1031,10 @@ public final AlertPolicy updateAlertPolicy(UpdateAlertPolicyRequest request) {
    * only certain fields in the current alerting policy by specifying the fields to be updated via
    * `updateMask`. Returns the updated alerting policy.
    *
+   * 

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. + * *

Sample code: * *

{@code
diff --git a/java-monitoring/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java b/java-monitoring/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java
index 4336d8e78a2a..2ef572863f24 100644
--- a/java-monitoring/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java
+++ b/java-monitoring/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java
@@ -620,7 +620,8 @@ public final NotificationChannelDescriptor getNotificationChannelDescriptor(
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD.
   /**
-   * Lists the notification channels that have been created for the project.
+   * Lists the notification channels that have been created for the project. To list the types of
+   * notification channels that are supported, use the `ListNotificationChannelDescriptors` method.
    *
    * 

Sample code: * @@ -659,7 +660,8 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels(Reso // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the notification channels that have been created for the project. + * Lists the notification channels that have been created for the project. To list the types of + * notification channels that are supported, use the `ListNotificationChannelDescriptors` method. * *

Sample code: * @@ -699,7 +701,8 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the notification channels that have been created for the project. + * Lists the notification channels that have been created for the project. To list the types of + * notification channels that are supported, use the `ListNotificationChannelDescriptors` method. * *

Sample code: * @@ -738,7 +741,8 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels(Proj // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the notification channels that have been created for the project. + * Lists the notification channels that have been created for the project. To list the types of + * notification channels that are supported, use the `ListNotificationChannelDescriptors` method. * *

Sample code: * @@ -775,7 +779,8 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels(Stri // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the notification channels that have been created for the project. + * Lists the notification channels that have been created for the project. To list the types of + * notification channels that are supported, use the `ListNotificationChannelDescriptors` method. * *

Sample code: * @@ -812,7 +817,8 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the notification channels that have been created for the project. + * Lists the notification channels that have been created for the project. To list the types of + * notification channels that are supported, use the `ListNotificationChannelDescriptors` method. * *

Sample code: * @@ -850,7 +856,8 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the notification channels that have been created for the project. + * Lists the notification channels that have been created for the project. To list the types of + * notification channels that are supported, use the `ListNotificationChannelDescriptors` method. * *

Sample code: * @@ -1039,6 +1046,10 @@ public final NotificationChannel getNotificationChannel(GetNotificationChannelRe * Creates a new notification channel, representing a single notification endpoint such as an * email address, SMS number, or PagerDuty service. * + *

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1081,6 +1092,10 @@ public final NotificationChannel createNotificationChannel(
    * Creates a new notification channel, representing a single notification endpoint such as an
    * email address, SMS number, or PagerDuty service.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1123,6 +1138,10 @@ public final NotificationChannel createNotificationChannel(
    * Creates a new notification channel, representing a single notification endpoint such as an
    * email address, SMS number, or PagerDuty service.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1165,6 +1184,10 @@ public final NotificationChannel createNotificationChannel(
    * Creates a new notification channel, representing a single notification endpoint such as an
    * email address, SMS number, or PagerDuty service.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1207,6 +1230,10 @@ public final NotificationChannel createNotificationChannel(
    * Creates a new notification channel, representing a single notification endpoint such as an
    * email address, SMS number, or PagerDuty service.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1240,6 +1267,10 @@ public final NotificationChannel createNotificationChannel(
    * Creates a new notification channel, representing a single notification endpoint such as an
    * email address, SMS number, or PagerDuty service.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1271,6 +1302,10 @@ public final NotificationChannel createNotificationChannel(
   /**
    * Updates a notification channel. Fields not specified in the field mask remain unchanged.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1309,6 +1344,10 @@ public final NotificationChannel updateNotificationChannel(
   /**
    * Updates a notification channel. Fields not specified in the field mask remain unchanged.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1341,6 +1380,10 @@ public final NotificationChannel updateNotificationChannel(
   /**
    * Updates a notification channel. Fields not specified in the field mask remain unchanged.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1372,6 +1415,10 @@ public final NotificationChannel updateNotificationChannel(
   /**
    * Deletes a notification channel.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1411,6 +1458,10 @@ public final void deleteNotificationChannel(NotificationChannelName name, boolea
   /**
    * Deletes a notification channel.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1448,6 +1499,10 @@ public final void deleteNotificationChannel(String name, boolean force) {
   /**
    * Deletes a notification channel.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
@@ -1481,6 +1536,10 @@ public final void deleteNotificationChannel(DeleteNotificationChannelRequest req
   /**
    * Deletes a notification channel.
    *
+   * 

Design your application to single-thread API calls that modify the state of notification + * channels in a single project. This includes calls to CreateNotificationChannel, + * DeleteNotificationChannel and UpdateNotificationChannel. + * *

Sample code: * *

{@code
diff --git a/java-monitoring/google-cloud-monitoring/src/main/resources/META-INF/native-image/com.google.cloud.monitoring.v3/reflect-config.json b/java-monitoring/google-cloud-monitoring/src/main/resources/META-INF/native-image/com.google.cloud.monitoring.v3/reflect-config.json
index df6d4920e888..5021e69939b8 100644
--- a/java-monitoring/google-cloud-monitoring/src/main/resources/META-INF/native-image/com.google.cloud.monitoring.v3/reflect-config.json
+++ b/java-monitoring/google-cloud-monitoring/src/main/resources/META-INF/native-image/com.google.cloud.monitoring.v3/reflect-config.json
@@ -719,6 +719,24 @@
     "allDeclaredClasses": true,
     "allPublicClasses": true
   },
+  {
+    "name": "com.google.monitoring.v3.AlertPolicy$AlertStrategy$NotificationChannelStrategy",
+    "queryAllDeclaredConstructors": true,
+    "queryAllPublicConstructors": true,
+    "queryAllDeclaredMethods": true,
+    "allPublicMethods": true,
+    "allDeclaredClasses": true,
+    "allPublicClasses": true
+  },
+  {
+    "name": "com.google.monitoring.v3.AlertPolicy$AlertStrategy$NotificationChannelStrategy$Builder",
+    "queryAllDeclaredConstructors": true,
+    "queryAllPublicConstructors": true,
+    "queryAllDeclaredMethods": true,
+    "allPublicMethods": true,
+    "allDeclaredClasses": true,
+    "allPublicClasses": true
+  },
   {
     "name": "com.google.monitoring.v3.AlertPolicy$AlertStrategy$NotificationRateLimit",
     "queryAllDeclaredConstructors": true,
@@ -827,6 +845,24 @@
     "allDeclaredClasses": true,
     "allPublicClasses": true
   },
+  {
+    "name": "com.google.monitoring.v3.AlertPolicy$Condition$MetricThreshold$ForecastOptions",
+    "queryAllDeclaredConstructors": true,
+    "queryAllPublicConstructors": true,
+    "queryAllDeclaredMethods": true,
+    "allPublicMethods": true,
+    "allDeclaredClasses": true,
+    "allPublicClasses": true
+  },
+  {
+    "name": "com.google.monitoring.v3.AlertPolicy$Condition$MetricThreshold$ForecastOptions$Builder",
+    "queryAllDeclaredConstructors": true,
+    "queryAllPublicConstructors": true,
+    "queryAllDeclaredMethods": true,
+    "allPublicMethods": true,
+    "allDeclaredClasses": true,
+    "allPublicClasses": true
+  },
   {
     "name": "com.google.monitoring.v3.AlertPolicy$Condition$MonitoringQueryLanguageCondition",
     "queryAllDeclaredConstructors": true,
@@ -845,6 +881,24 @@
     "allDeclaredClasses": true,
     "allPublicClasses": true
   },
+  {
+    "name": "com.google.monitoring.v3.AlertPolicy$Condition$PrometheusQueryLanguageCondition",
+    "queryAllDeclaredConstructors": true,
+    "queryAllPublicConstructors": true,
+    "queryAllDeclaredMethods": true,
+    "allPublicMethods": true,
+    "allDeclaredClasses": true,
+    "allPublicClasses": true
+  },
+  {
+    "name": "com.google.monitoring.v3.AlertPolicy$Condition$PrometheusQueryLanguageCondition$Builder",
+    "queryAllDeclaredConstructors": true,
+    "queryAllPublicConstructors": true,
+    "queryAllDeclaredMethods": true,
+    "allPublicMethods": true,
+    "allDeclaredClasses": true,
+    "allPublicClasses": true
+  },
   {
     "name": "com.google.monitoring.v3.AlertPolicy$Condition$Trigger",
     "queryAllDeclaredConstructors": true,
diff --git a/java-monitoring/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyServiceGrpc.java b/java-monitoring/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyServiceGrpc.java
index 8fb614f43aa6..1d7c653f8be5 100644
--- a/java-monitoring/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyServiceGrpc.java
+++ b/java-monitoring/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyServiceGrpc.java
@@ -357,6 +357,9 @@ default void getAlertPolicy(
      *
      * 
      * Creates a new alerting policy.
+     * 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.
      * 
*/ default void createAlertPolicy( @@ -371,6 +374,9 @@ default void createAlertPolicy( * *
      * Deletes an alerting policy.
+     * 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.
      * 
*/ default void deleteAlertPolicy( @@ -388,6 +394,9 @@ default void deleteAlertPolicy( * 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. + * 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. *
*/ default void updateAlertPolicy( @@ -487,6 +496,9 @@ public void getAlertPolicy( * *
      * Creates a new alerting policy.
+     * 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.
      * 
*/ public void createAlertPolicy( @@ -503,6 +515,9 @@ public void createAlertPolicy( * *
      * Deletes an alerting policy.
+     * 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.
      * 
*/ public void deleteAlertPolicy( @@ -522,6 +537,9 @@ public void deleteAlertPolicy( * 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. + * 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. *
*/ public void updateAlertPolicy( @@ -593,6 +611,9 @@ public com.google.monitoring.v3.AlertPolicy getAlertPolicy( * *
      * Creates a new alerting policy.
+     * 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.
      * 
*/ public com.google.monitoring.v3.AlertPolicy createAlertPolicy( @@ -606,6 +627,9 @@ public com.google.monitoring.v3.AlertPolicy createAlertPolicy( * *
      * Deletes an alerting policy.
+     * 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.
      * 
*/ public com.google.protobuf.Empty deleteAlertPolicy( @@ -622,6 +646,9 @@ public com.google.protobuf.Empty deleteAlertPolicy( * 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. + * 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. *
*/ public com.google.monitoring.v3.AlertPolicy updateAlertPolicy( @@ -690,6 +717,9 @@ protected AlertPolicyServiceFutureStub build( * *
      * Creates a new alerting policy.
+     * 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.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture @@ -703,6 +733,9 @@ protected AlertPolicyServiceFutureStub build( * *
      * Deletes an alerting policy.
+     * 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.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture @@ -719,6 +752,9 @@ protected AlertPolicyServiceFutureStub build( * 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. + * 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. *
*/ public com.google.common.util.concurrent.ListenableFuture diff --git a/java-monitoring/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelServiceGrpc.java b/java-monitoring/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelServiceGrpc.java index 23ca2e0edfd7..cc7c7ec96e9f 100644 --- a/java-monitoring/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelServiceGrpc.java +++ b/java-monitoring/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelServiceGrpc.java @@ -651,6 +651,8 @@ default void getNotificationChannelDescriptor( * *
      * Lists the notification channels that have been created for the project.
+     * To list the types of notification channels that are supported, use
+     * the `ListNotificationChannelDescriptors` method.
      * 
*/ default void listNotificationChannels( @@ -686,6 +688,10 @@ default void getNotificationChannel( *
      * Creates a new notification channel, representing a single notification
      * endpoint such as an email address, SMS number, or PagerDuty service.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ default void createNotificationChannel( @@ -702,6 +708,10 @@ default void createNotificationChannel( *
      * Updates a notification channel. Fields not specified in the field mask
      * remain unchanged.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ default void updateNotificationChannel( @@ -717,6 +727,10 @@ default void updateNotificationChannel( * *
      * Deletes a notification channel.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ default void deleteNotificationChannel( @@ -874,6 +888,8 @@ public void getNotificationChannelDescriptor( * *
      * Lists the notification channels that have been created for the project.
+     * To list the types of notification channels that are supported, use
+     * the `ListNotificationChannelDescriptors` method.
      * 
*/ public void listNotificationChannels( @@ -913,6 +929,10 @@ public void getNotificationChannel( *
      * Creates a new notification channel, representing a single notification
      * endpoint such as an email address, SMS number, or PagerDuty service.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ public void createNotificationChannel( @@ -931,6 +951,10 @@ public void createNotificationChannel( *
      * Updates a notification channel. Fields not specified in the field mask
      * remain unchanged.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ public void updateNotificationChannel( @@ -948,6 +972,10 @@ public void updateNotificationChannel( * *
      * Deletes a notification channel.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ public void deleteNotificationChannel( @@ -1089,6 +1117,8 @@ public com.google.monitoring.v3.NotificationChannelDescriptor getNotificationCha * *
      * Lists the notification channels that have been created for the project.
+     * To list the types of notification channels that are supported, use
+     * the `ListNotificationChannelDescriptors` method.
      * 
*/ public com.google.monitoring.v3.ListNotificationChannelsResponse listNotificationChannels( @@ -1120,6 +1150,10 @@ public com.google.monitoring.v3.NotificationChannel getNotificationChannel( *
      * Creates a new notification channel, representing a single notification
      * endpoint such as an email address, SMS number, or PagerDuty service.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ public com.google.monitoring.v3.NotificationChannel createNotificationChannel( @@ -1134,6 +1168,10 @@ public com.google.monitoring.v3.NotificationChannel createNotificationChannel( *
      * Updates a notification channel. Fields not specified in the field mask
      * remain unchanged.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ public com.google.monitoring.v3.NotificationChannel updateNotificationChannel( @@ -1147,6 +1185,10 @@ public com.google.monitoring.v3.NotificationChannel updateNotificationChannel( * *
      * Deletes a notification channel.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ public com.google.protobuf.Empty deleteNotificationChannel( @@ -1285,6 +1327,8 @@ protected NotificationChannelServiceFutureStub build( * *
      * Lists the notification channels that have been created for the project.
+     * To list the types of notification channels that are supported, use
+     * the `ListNotificationChannelDescriptors` method.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< @@ -1318,6 +1362,10 @@ protected NotificationChannelServiceFutureStub build( *
      * Creates a new notification channel, representing a single notification
      * endpoint such as an email address, SMS number, or PagerDuty service.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< @@ -1334,6 +1382,10 @@ protected NotificationChannelServiceFutureStub build( *
      * Updates a notification channel. Fields not specified in the field mask
      * remain unchanged.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< @@ -1349,6 +1401,10 @@ protected NotificationChannelServiceFutureStub build( * *
      * Deletes a notification channel.
+     * Design your application to single-thread API calls that modify the state of
+     * notification channels in a single project. This includes calls to
+     * CreateNotificationChannel, DeleteNotificationChannel and
+     * UpdateNotificationChannel.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java index 9c8bff2d6e81..75474ed83751 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java @@ -283,7 +283,7 @@ public interface DocumentationOrBuilder * * *
-     * The text of the documentation, interpreted according to `mime_type`.
+     * The body of the documentation, interpreted according to `mime_type`.
      * The content may not exceed 8,192 Unicode characters and may not exceed
      * more than 10,240 bytes when encoded in UTF-8 format, whichever is
      * smaller. This text can be [templatized by using
@@ -299,7 +299,7 @@ public interface DocumentationOrBuilder
      *
      *
      * 
-     * The text of the documentation, interpreted according to `mime_type`.
+     * The body of the documentation, interpreted according to `mime_type`.
      * The content may not exceed 8,192 Unicode characters and may not exceed
      * more than 10,240 bytes when encoded in UTF-8 format, whichever is
      * smaller. This text can be [templatized by using
@@ -340,6 +340,55 @@ public interface DocumentationOrBuilder
      * @return The bytes for mimeType.
      */
     com.google.protobuf.ByteString getMimeTypeBytes();
+
+    /**
+     *
+     *
+     * 
+     * Optional. The subject line of the notification. The subject line may not
+     * exceed 10,240 bytes. In notifications generated by this policy, the
+     * contents of the subject line after variable expansion will be truncated
+     * to 255 bytes or shorter at the latest UTF-8 character boundary. The
+     * 255-byte limit is recommended by [this
+     * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit).
+     * It is both the limit imposed by some third-party ticketing products and
+     * it is common to define textual fields in databases as VARCHAR(255).
+     *
+     * The contents of the subject line can be [templatized by using
+     * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+     * If this field is missing or empty, a default subject line will be
+     * generated.
+     * 
+ * + * string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The subject. + */ + java.lang.String getSubject(); + /** + * + * + *
+     * Optional. The subject line of the notification. The subject line may not
+     * exceed 10,240 bytes. In notifications generated by this policy, the
+     * contents of the subject line after variable expansion will be truncated
+     * to 255 bytes or shorter at the latest UTF-8 character boundary. The
+     * 255-byte limit is recommended by [this
+     * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit).
+     * It is both the limit imposed by some third-party ticketing products and
+     * it is common to define textual fields in databases as VARCHAR(255).
+     *
+     * The contents of the subject line can be [templatized by using
+     * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+     * If this field is missing or empty, a default subject line will be
+     * generated.
+     * 
+ * + * string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for subject. + */ + com.google.protobuf.ByteString getSubjectBytes(); } /** * @@ -364,6 +413,7 @@ private Documentation(com.google.protobuf.GeneratedMessageV3.Builder builder) private Documentation() { content_ = ""; mimeType_ = ""; + subject_ = ""; } @java.lang.Override @@ -395,7 +445,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-     * The text of the documentation, interpreted according to `mime_type`.
+     * The body of the documentation, interpreted according to `mime_type`.
      * The content may not exceed 8,192 Unicode characters and may not exceed
      * more than 10,240 bytes when encoded in UTF-8 format, whichever is
      * smaller. This text can be [templatized by using
@@ -422,7 +472,7 @@ public java.lang.String getContent() {
      *
      *
      * 
-     * The text of the documentation, interpreted according to `mime_type`.
+     * The body of the documentation, interpreted according to `mime_type`.
      * The content may not exceed 8,192 Unicode characters and may not exceed
      * more than 10,240 bytes when encoded in UTF-8 format, whichever is
      * smaller. This text can be [templatized by using
@@ -501,6 +551,81 @@ public com.google.protobuf.ByteString getMimeTypeBytes() {
       }
     }
 
+    public static final int SUBJECT_FIELD_NUMBER = 3;
+
+    @SuppressWarnings("serial")
+    private volatile java.lang.Object subject_ = "";
+    /**
+     *
+     *
+     * 
+     * Optional. The subject line of the notification. The subject line may not
+     * exceed 10,240 bytes. In notifications generated by this policy, the
+     * contents of the subject line after variable expansion will be truncated
+     * to 255 bytes or shorter at the latest UTF-8 character boundary. The
+     * 255-byte limit is recommended by [this
+     * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit).
+     * It is both the limit imposed by some third-party ticketing products and
+     * it is common to define textual fields in databases as VARCHAR(255).
+     *
+     * The contents of the subject line can be [templatized by using
+     * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+     * If this field is missing or empty, a default subject line will be
+     * generated.
+     * 
+ * + * string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The subject. + */ + @java.lang.Override + public java.lang.String getSubject() { + java.lang.Object ref = subject_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subject_ = s; + return s; + } + } + /** + * + * + *
+     * Optional. The subject line of the notification. The subject line may not
+     * exceed 10,240 bytes. In notifications generated by this policy, the
+     * contents of the subject line after variable expansion will be truncated
+     * to 255 bytes or shorter at the latest UTF-8 character boundary. The
+     * 255-byte limit is recommended by [this
+     * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit).
+     * It is both the limit imposed by some third-party ticketing products and
+     * it is common to define textual fields in databases as VARCHAR(255).
+     *
+     * The contents of the subject line can be [templatized by using
+     * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+     * If this field is missing or empty, a default subject line will be
+     * generated.
+     * 
+ * + * string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for subject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSubjectBytes() { + java.lang.Object ref = subject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -521,6 +646,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mimeType_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subject_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, subject_); + } getUnknownFields().writeTo(output); } @@ -536,6 +664,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mimeType_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subject_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, subject_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -554,6 +685,7 @@ public boolean equals(final java.lang.Object obj) { if (!getContent().equals(other.getContent())) return false; if (!getMimeType().equals(other.getMimeType())) return false; + if (!getSubject().equals(other.getSubject())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -569,6 +701,8 @@ public int hashCode() { hash = (53 * hash) + getContent().hashCode(); hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; hash = (53 * hash) + getMimeType().hashCode(); + hash = (37 * hash) + SUBJECT_FIELD_NUMBER; + hash = (53 * hash) + getSubject().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -713,6 +847,7 @@ public Builder clear() { bitField0_ = 0; content_ = ""; mimeType_ = ""; + subject_ = ""; return this; } @@ -755,6 +890,9 @@ private void buildPartial0(com.google.monitoring.v3.AlertPolicy.Documentation re if (((from_bitField0_ & 0x00000002) != 0)) { result.mimeType_ = mimeType_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.subject_ = subject_; + } } @java.lang.Override @@ -815,6 +953,11 @@ public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy.Documentation othe bitField0_ |= 0x00000002; onChanged(); } + if (!other.getSubject().isEmpty()) { + subject_ = other.subject_; + bitField0_ |= 0x00000004; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -853,6 +996,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 18 + case 26: + { + subject_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -877,7 +1026,7 @@ public Builder mergeFrom( * * *
-       * The text of the documentation, interpreted according to `mime_type`.
+       * The body of the documentation, interpreted according to `mime_type`.
        * The content may not exceed 8,192 Unicode characters and may not exceed
        * more than 10,240 bytes when encoded in UTF-8 format, whichever is
        * smaller. This text can be [templatized by using
@@ -903,7 +1052,7 @@ public java.lang.String getContent() {
        *
        *
        * 
-       * The text of the documentation, interpreted according to `mime_type`.
+       * The body of the documentation, interpreted according to `mime_type`.
        * The content may not exceed 8,192 Unicode characters and may not exceed
        * more than 10,240 bytes when encoded in UTF-8 format, whichever is
        * smaller. This text can be [templatized by using
@@ -929,7 +1078,7 @@ public com.google.protobuf.ByteString getContentBytes() {
        *
        *
        * 
-       * The text of the documentation, interpreted according to `mime_type`.
+       * The body of the documentation, interpreted according to `mime_type`.
        * The content may not exceed 8,192 Unicode characters and may not exceed
        * more than 10,240 bytes when encoded in UTF-8 format, whichever is
        * smaller. This text can be [templatized by using
@@ -954,7 +1103,7 @@ public Builder setContent(java.lang.String value) {
        *
        *
        * 
-       * The text of the documentation, interpreted according to `mime_type`.
+       * The body of the documentation, interpreted according to `mime_type`.
        * The content may not exceed 8,192 Unicode characters and may not exceed
        * more than 10,240 bytes when encoded in UTF-8 format, whichever is
        * smaller. This text can be [templatized by using
@@ -975,7 +1124,7 @@ public Builder clearContent() {
        *
        *
        * 
-       * The text of the documentation, interpreted according to `mime_type`.
+       * The body of the documentation, interpreted according to `mime_type`.
        * The content may not exceed 8,192 Unicode characters and may not exceed
        * more than 10,240 bytes when encoded in UTF-8 format, whichever is
        * smaller. This text can be [templatized by using
@@ -1114,6 +1263,172 @@ public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) {
         return this;
       }
 
+      private java.lang.Object subject_ = "";
+      /**
+       *
+       *
+       * 
+       * Optional. The subject line of the notification. The subject line may not
+       * exceed 10,240 bytes. In notifications generated by this policy, the
+       * contents of the subject line after variable expansion will be truncated
+       * to 255 bytes or shorter at the latest UTF-8 character boundary. The
+       * 255-byte limit is recommended by [this
+       * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit).
+       * It is both the limit imposed by some third-party ticketing products and
+       * it is common to define textual fields in databases as VARCHAR(255).
+       *
+       * The contents of the subject line can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * If this field is missing or empty, a default subject line will be
+       * generated.
+       * 
+ * + * string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The subject. + */ + public java.lang.String getSubject() { + java.lang.Object ref = subject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Optional. The subject line of the notification. The subject line may not
+       * exceed 10,240 bytes. In notifications generated by this policy, the
+       * contents of the subject line after variable expansion will be truncated
+       * to 255 bytes or shorter at the latest UTF-8 character boundary. The
+       * 255-byte limit is recommended by [this
+       * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit).
+       * It is both the limit imposed by some third-party ticketing products and
+       * it is common to define textual fields in databases as VARCHAR(255).
+       *
+       * The contents of the subject line can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * If this field is missing or empty, a default subject line will be
+       * generated.
+       * 
+ * + * string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for subject. + */ + public com.google.protobuf.ByteString getSubjectBytes() { + java.lang.Object ref = subject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Optional. The subject line of the notification. The subject line may not
+       * exceed 10,240 bytes. In notifications generated by this policy, the
+       * contents of the subject line after variable expansion will be truncated
+       * to 255 bytes or shorter at the latest UTF-8 character boundary. The
+       * 255-byte limit is recommended by [this
+       * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit).
+       * It is both the limit imposed by some third-party ticketing products and
+       * it is common to define textual fields in databases as VARCHAR(255).
+       *
+       * The contents of the subject line can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * If this field is missing or empty, a default subject line will be
+       * generated.
+       * 
+ * + * string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The subject to set. + * @return This builder for chaining. + */ + public Builder setSubject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + subject_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The subject line of the notification. The subject line may not
+       * exceed 10,240 bytes. In notifications generated by this policy, the
+       * contents of the subject line after variable expansion will be truncated
+       * to 255 bytes or shorter at the latest UTF-8 character boundary. The
+       * 255-byte limit is recommended by [this
+       * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit).
+       * It is both the limit imposed by some third-party ticketing products and
+       * it is common to define textual fields in databases as VARCHAR(255).
+       *
+       * The contents of the subject line can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * If this field is missing or empty, a default subject line will be
+       * generated.
+       * 
+ * + * string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSubject() { + subject_ = getDefaultInstance().getSubject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The subject line of the notification. The subject line may not
+       * exceed 10,240 bytes. In notifications generated by this policy, the
+       * contents of the subject line after variable expansion will be truncated
+       * to 255 bytes or shorter at the latest UTF-8 character boundary. The
+       * 255-byte limit is recommended by [this
+       * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit).
+       * It is both the limit imposed by some third-party ticketing products and
+       * it is common to define textual fields in databases as VARCHAR(255).
+       *
+       * The contents of the subject line can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * If this field is missing or empty, a default subject line will be
+       * generated.
+       * 
+ * + * string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for subject to set. + * @return This builder for chaining. + */ + public Builder setSubjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + subject_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -1448,6 +1763,49 @@ public interface ConditionOrBuilder com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageConditionOrBuilder getConditionMonitoringQueryLanguageOrBuilder(); + /** + * + * + *
+     * A condition that uses the Prometheus query language to define alerts.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; + * + * + * @return Whether the conditionPrometheusQueryLanguage field is set. + */ + boolean hasConditionPrometheusQueryLanguage(); + /** + * + * + *
+     * A condition that uses the Prometheus query language to define alerts.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; + * + * + * @return The conditionPrometheusQueryLanguage. + */ + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + getConditionPrometheusQueryLanguage(); + /** + * + * + *
+     * A condition that uses the Prometheus query language to define alerts.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; + * + */ + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageConditionOrBuilder + getConditionPrometheusQueryLanguageOrBuilder(); + com.google.monitoring.v3.AlertPolicy.Condition.ConditionCase getConditionCase(); } /** @@ -2553,7 +2911,8 @@ public interface MetricThresholdOrBuilder * * *
-       * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+       * Required. A
+       * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
        * identifies which time series should be compared with the threshold.
        *
        * The filter is similar to the one that is specified in the
@@ -2574,7 +2933,8 @@ public interface MetricThresholdOrBuilder
        *
        *
        * 
-       * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+       * Required. A
+       * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
        * identifies which time series should be compared with the threshold.
        *
        * The filter is similar to the one that is specified in the
@@ -2832,6 +3192,61 @@ public interface MetricThresholdOrBuilder
        */
       com.google.monitoring.v3.AggregationOrBuilder getDenominatorAggregationsOrBuilder(int index);
 
+      /**
+       *
+       *
+       * 
+       * When this field is present, the `MetricThreshold` condition forecasts
+       * whether the time series is predicted to violate the threshold within
+       * the `forecast_horizon`. When this field is not set, the
+       * `MetricThreshold` tests the current value of the timeseries against the
+       * threshold.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + * + * @return Whether the forecastOptions field is set. + */ + boolean hasForecastOptions(); + /** + * + * + *
+       * When this field is present, the `MetricThreshold` condition forecasts
+       * whether the time series is predicted to violate the threshold within
+       * the `forecast_horizon`. When this field is not set, the
+       * `MetricThreshold` tests the current value of the timeseries against the
+       * threshold.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + * + * @return The forecastOptions. + */ + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + getForecastOptions(); + /** + * + * + *
+       * When this field is present, the `MetricThreshold` condition forecasts
+       * whether the time series is predicted to violate the threshold within
+       * the `forecast_horizon`. When this field is not set, the
+       * `MetricThreshold` tests the current value of the timeseries against the
+       * threshold.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + */ + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptionsOrBuilder + getForecastOptionsOrBuilder(); + /** * * @@ -3074,3151 +3489,3075 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder.class); } - public static final int FILTER_FIELD_NUMBER = 2; + public interface ForecastOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions) + com.google.protobuf.MessageOrBuilder { - @SuppressWarnings("serial") - private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+         * Required. The length of time into the future to forecast whether a
+         * time series will violate the threshold. If the predicted value is
+         * found to violate the threshold, and the violation is observed in all
+         * forecasts made for the configured `duration`, then the time series is
+         * considered to be failing.
+         * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the forecastHorizon field is set. + */ + boolean hasForecastHorizon(); + /** + * + * + *
+         * Required. The length of time into the future to forecast whether a
+         * time series will violate the threshold. If the predicted value is
+         * found to violate the threshold, and the violation is observed in all
+         * forecasts made for the configured `duration`, then the time series is
+         * considered to be failing.
+         * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The forecastHorizon. + */ + com.google.protobuf.Duration getForecastHorizon(); + /** + * + * + *
+         * Required. The length of time into the future to forecast whether a
+         * time series will violate the threshold. If the predicted value is
+         * found to violate the threshold, and the violation is observed in all
+         * forecasts made for the configured `duration`, then the time series is
+         * considered to be failing.
+         * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.DurationOrBuilder getForecastHorizonOrBuilder(); + } /** * * *
-       * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-       * identifies which time series should be compared with the threshold.
-       *
-       * The filter is similar to the one that is specified in the
-       * [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-       * (that call is useful to verify the time series that will be retrieved /
-       * processed). The filter must specify the metric type and the resource
-       * type. Optionally, it can specify resource labels and metric labels.
-       * This field must not exceed 2048 Unicode characters in length.
+       * Options used when forecasting the time series and testing
+       * the predicted value against the threshold.
        * 
* - * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The filter. + * Protobuf type {@code + * google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions} */ - @java.lang.Override - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } - } - /** - * - * - *
-       * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-       * identifies which time series should be compared with the threshold.
-       *
-       * The filter is similar to the one that is specified in the
-       * [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-       * (that call is useful to verify the time series that will be retrieved /
-       * processed). The filter must specify the metric type and the resource
-       * type. Optionally, it can specify resource labels and metric labels.
-       * This field must not exceed 2048 Unicode characters in length.
-       * 
- * - * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for filter. - */ - @java.lang.Override - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + public static final class ForecastOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions) + ForecastOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ForecastOptions.newBuilder() to construct. + private ForecastOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); } - } - - public static final int AGGREGATIONS_FIELD_NUMBER = 8; - - @SuppressWarnings("serial") - private java.util.List aggregations_; - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - @java.lang.Override - public java.util.List getAggregationsList() { - return aggregations_; - } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - @java.lang.Override - public java.util.List - getAggregationsOrBuilderList() { - return aggregations_; - } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - @java.lang.Override - public int getAggregationsCount() { - return aggregations_.size(); - } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - @java.lang.Override - public com.google.monitoring.v3.Aggregation getAggregations(int index) { - return aggregations_.get(index); - } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - @java.lang.Override - public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(int index) { - return aggregations_.get(index); - } - public static final int DENOMINATOR_FILTER_FIELD_NUMBER = 9; + private ForecastOptions() {} - @SuppressWarnings("serial") - private volatile java.lang.Object denominatorFilter_ = ""; - /** - * - * - *
-       * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-       * identifies a time series that should be used as the denominator of a
-       * ratio that will be compared with the threshold. If a
-       * `denominator_filter` is specified, the time series specified by the
-       * `filter` field will be used as the numerator.
-       *
-       * The filter must specify the metric type and optionally may contain
-       * restrictions on resource type, resource labels, and metric labels.
-       * This field may not exceed 2048 Unicode characters in length.
-       * 
- * - * string denominator_filter = 9; - * - * @return The denominatorFilter. - */ - @java.lang.Override - public java.lang.String getDenominatorFilter() { - java.lang.Object ref = denominatorFilter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - denominatorFilter_ = s; - return s; + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ForecastOptions(); } - } - /** - * - * - *
-       * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-       * identifies a time series that should be used as the denominator of a
-       * ratio that will be compared with the threshold. If a
-       * `denominator_filter` is specified, the time series specified by the
-       * `filter` field will be used as the numerator.
-       *
-       * The filter must specify the metric type and optionally may contain
-       * restrictions on resource type, resource labels, and metric labels.
-       * This field may not exceed 2048 Unicode characters in length.
-       * 
- * - * string denominator_filter = 9; - * - * @return The bytes for denominatorFilter. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDenominatorFilterBytes() { - java.lang.Object ref = denominatorFilter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - denominatorFilter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_ForecastOptions_descriptor; } - } - public static final int DENOMINATOR_AGGREGATIONS_FIELD_NUMBER = 10; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_ForecastOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .class, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .Builder.class); + } - @SuppressWarnings("serial") - private java.util.List denominatorAggregations_; - /** - * - * - *
-       * Specifies the alignment of data points in individual time series
-       * selected by `denominatorFilter` as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources).
-       *
-       * When computing ratios, the `aggregations` and
-       * `denominator_aggregations` fields must use the same alignment period
-       * and produce time series that have the same periodicity and labels.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - @java.lang.Override - public java.util.List getDenominatorAggregationsList() { - return denominatorAggregations_; - } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series
-       * selected by `denominatorFilter` as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources).
-       *
-       * When computing ratios, the `aggregations` and
-       * `denominator_aggregations` fields must use the same alignment period
-       * and produce time series that have the same periodicity and labels.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - @java.lang.Override - public java.util.List - getDenominatorAggregationsOrBuilderList() { - return denominatorAggregations_; - } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series
-       * selected by `denominatorFilter` as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources).
-       *
-       * When computing ratios, the `aggregations` and
-       * `denominator_aggregations` fields must use the same alignment period
-       * and produce time series that have the same periodicity and labels.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - @java.lang.Override - public int getDenominatorAggregationsCount() { - return denominatorAggregations_.size(); - } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series
-       * selected by `denominatorFilter` as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources).
-       *
-       * When computing ratios, the `aggregations` and
-       * `denominator_aggregations` fields must use the same alignment period
-       * and produce time series that have the same periodicity and labels.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - @java.lang.Override - public com.google.monitoring.v3.Aggregation getDenominatorAggregations(int index) { - return denominatorAggregations_.get(index); - } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series
-       * selected by `denominatorFilter` as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources).
-       *
-       * When computing ratios, the `aggregations` and
-       * `denominator_aggregations` fields must use the same alignment period
-       * and produce time series that have the same periodicity and labels.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - @java.lang.Override - public com.google.monitoring.v3.AggregationOrBuilder getDenominatorAggregationsOrBuilder( - int index) { - return denominatorAggregations_.get(index); - } + public static final int FORECAST_HORIZON_FIELD_NUMBER = 1; + private com.google.protobuf.Duration forecastHorizon_; + /** + * + * + *
+         * Required. The length of time into the future to forecast whether a
+         * time series will violate the threshold. If the predicted value is
+         * found to violate the threshold, and the violation is observed in all
+         * forecasts made for the configured `duration`, then the time series is
+         * considered to be failing.
+         * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the forecastHorizon field is set. + */ + @java.lang.Override + public boolean hasForecastHorizon() { + return forecastHorizon_ != null; + } + /** + * + * + *
+         * Required. The length of time into the future to forecast whether a
+         * time series will violate the threshold. If the predicted value is
+         * found to violate the threshold, and the violation is observed in all
+         * forecasts made for the configured `duration`, then the time series is
+         * considered to be failing.
+         * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The forecastHorizon. + */ + @java.lang.Override + public com.google.protobuf.Duration getForecastHorizon() { + return forecastHorizon_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : forecastHorizon_; + } + /** + * + * + *
+         * Required. The length of time into the future to forecast whether a
+         * time series will violate the threshold. If the predicted value is
+         * found to violate the threshold, and the violation is observed in all
+         * forecasts made for the configured `duration`, then the time series is
+         * considered to be failing.
+         * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getForecastHorizonOrBuilder() { + return forecastHorizon_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : forecastHorizon_; + } - public static final int COMPARISON_FIELD_NUMBER = 4; - private int comparison_ = 0; - /** - * - * - *
-       * The comparison to apply between the time series (indicated by `filter`
-       * and `aggregation`) and the threshold (indicated by `threshold_value`).
-       * The comparison is applied on each time series, with the time series
-       * on the left-hand side and the threshold on the right-hand side.
-       *
-       * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
-       * 
- * - * .google.monitoring.v3.ComparisonType comparison = 4; - * - * @return The enum numeric value on the wire for comparison. - */ - @java.lang.Override - public int getComparisonValue() { - return comparison_; - } - /** - * - * - *
-       * The comparison to apply between the time series (indicated by `filter`
-       * and `aggregation`) and the threshold (indicated by `threshold_value`).
-       * The comparison is applied on each time series, with the time series
-       * on the left-hand side and the threshold on the right-hand side.
-       *
-       * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
-       * 
- * - * .google.monitoring.v3.ComparisonType comparison = 4; - * - * @return The comparison. - */ - @java.lang.Override - public com.google.monitoring.v3.ComparisonType getComparison() { - com.google.monitoring.v3.ComparisonType result = - com.google.monitoring.v3.ComparisonType.forNumber(comparison_); - return result == null ? com.google.monitoring.v3.ComparisonType.UNRECOGNIZED : result; - } + private byte memoizedIsInitialized = -1; - public static final int THRESHOLD_VALUE_FIELD_NUMBER = 5; - private double thresholdValue_ = 0D; - /** - * - * - *
-       * A value against which to compare the time series.
-       * 
- * - * double threshold_value = 5; - * - * @return The thresholdValue. - */ - @java.lang.Override - public double getThresholdValue() { - return thresholdValue_; - } + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - public static final int DURATION_FIELD_NUMBER = 6; - private com.google.protobuf.Duration duration_; - /** - * - * - *
-       * The amount of time that a time series must violate the
-       * threshold to be considered failing. Currently, only values
-       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
-       * error will be returned. When choosing a duration, it is useful to
-       * keep in mind the frequency of the underlying time series data
-       * (which may also be affected by any alignments specified in the
-       * `aggregations` field); a good duration is long enough so that a single
-       * outlier does not generate spurious alerts, but short enough that
-       * unhealthy states are detected and alerted on quickly.
-       * 
- * - * .google.protobuf.Duration duration = 6; - * - * @return Whether the duration field is set. - */ - @java.lang.Override - public boolean hasDuration() { - return duration_ != null; - } - /** - * - * - *
-       * The amount of time that a time series must violate the
-       * threshold to be considered failing. Currently, only values
-       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
-       * error will be returned. When choosing a duration, it is useful to
-       * keep in mind the frequency of the underlying time series data
-       * (which may also be affected by any alignments specified in the
-       * `aggregations` field); a good duration is long enough so that a single
-       * outlier does not generate spurious alerts, but short enough that
-       * unhealthy states are detected and alerted on quickly.
-       * 
- * - * .google.protobuf.Duration duration = 6; - * - * @return The duration. - */ - @java.lang.Override - public com.google.protobuf.Duration getDuration() { - return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; - } - /** - * - * - *
-       * The amount of time that a time series must violate the
-       * threshold to be considered failing. Currently, only values
-       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
-       * error will be returned. When choosing a duration, it is useful to
-       * keep in mind the frequency of the underlying time series data
-       * (which may also be affected by any alignments specified in the
-       * `aggregations` field); a good duration is long enough so that a single
-       * outlier does not generate spurious alerts, but short enough that
-       * unhealthy states are detected and alerted on quickly.
-       * 
- * - * .google.protobuf.Duration duration = 6; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { - return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; - } - - public static final int TRIGGER_FIELD_NUMBER = 7; - private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; - /** - * - * - *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`,
-       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-       * are specified.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; - * - * @return Whether the trigger field is set. - */ - @java.lang.Override - public boolean hasTrigger() { - return trigger_ != null; - } - /** - * - * - *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`,
-       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-       * are specified.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; - * - * @return The trigger. - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; - } - /** - * - * - *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`,
-       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-       * are specified.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder() { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; - } + memoizedIsInitialized = 1; + return true; + } - public static final int EVALUATION_MISSING_DATA_FIELD_NUMBER = 11; - private int evaluationMissingData_ = 0; - /** - * - * - *
-       * A condition control that determines how metric-threshold conditions
-       * are evaluated when data stops arriving.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - * - * - * @return The enum numeric value on the wire for evaluationMissingData. - */ - @java.lang.Override - public int getEvaluationMissingDataValue() { - return evaluationMissingData_; - } - /** - * - * - *
-       * A condition control that determines how metric-threshold conditions
-       * are evaluated when data stops arriving.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - * - * - * @return The evaluationMissingData. - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData - getEvaluationMissingData() { - com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData result = - com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.forNumber( - evaluationMissingData_); - return result == null - ? com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.UNRECOGNIZED - : result; - } + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (forecastHorizon_ != null) { + output.writeMessage(1, getForecastHorizon()); + } + getUnknownFields().writeTo(output); + } - private byte memoizedIsInitialized = -1; + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + size = 0; + if (forecastHorizon_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getForecastHorizon()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } - memoizedIsInitialized = 1; - return true; - } + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions)) { + return super.equals(obj); + } + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions other = + (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions) obj; - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); - } - if (comparison_ - != com.google.monitoring.v3.ComparisonType.COMPARISON_UNSPECIFIED.getNumber()) { - output.writeEnum(4, comparison_); - } - if (java.lang.Double.doubleToRawLongBits(thresholdValue_) != 0) { - output.writeDouble(5, thresholdValue_); + if (hasForecastHorizon() != other.hasForecastHorizon()) return false; + if (hasForecastHorizon()) { + if (!getForecastHorizon().equals(other.getForecastHorizon())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; } - if (duration_ != null) { - output.writeMessage(6, getDuration()); + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasForecastHorizon()) { + hash = (37 * hash) + FORECAST_HORIZON_FIELD_NUMBER; + hash = (53 * hash) + getForecastHorizon().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; } - if (trigger_ != null) { - output.writeMessage(7, getTrigger()); + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - for (int i = 0; i < aggregations_.size(); i++) { - output.writeMessage(8, aggregations_.get(i)); + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(denominatorFilter_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, denominatorFilter_); + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - for (int i = 0; i < denominatorAggregations_.size(); i++) { - output.writeMessage(10, denominatorAggregations_.get(i)); + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - if (evaluationMissingData_ - != com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData - .EVALUATION_MISSING_DATA_UNSPECIFIED - .getNumber()) { - output.writeEnum(11, evaluationMissingData_); + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - getUnknownFields().writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - if (comparison_ - != com.google.monitoring.v3.ComparisonType.COMPARISON_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, comparison_); + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - if (java.lang.Double.doubleToRawLongBits(thresholdValue_) != 0) { - size += com.google.protobuf.CodedOutputStream.computeDoubleSize(5, thresholdValue_); + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); } - if (duration_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDuration()); + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); } - if (trigger_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getTrigger()); + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - for (int i = 0; i < aggregations_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, aggregations_.get(i)); + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(denominatorFilter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, denominatorFilter_); + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); } - for (int i = 0; i < denominatorAggregations_.size(); i++) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 10, denominatorAggregations_.get(i)); + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); } - if (evaluationMissingData_ - != com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData - .EVALUATION_MISSING_DATA_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, evaluationMissingData_); + + public static Builder newBuilder( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - if (!(obj instanceof com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold)) { - return super.equals(obj); + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; } - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold other = - (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) obj; + /** + * + * + *
+         * Options used when forecasting the time series and testing
+         * the predicted value against the threshold.
+         * 
+ * + * Protobuf type {@code + * google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions) + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .ForecastOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_ForecastOptions_descriptor; + } - if (!getFilter().equals(other.getFilter())) return false; - if (!getAggregationsList().equals(other.getAggregationsList())) return false; - if (!getDenominatorFilter().equals(other.getDenominatorFilter())) return false; - if (!getDenominatorAggregationsList().equals(other.getDenominatorAggregationsList())) - return false; - if (comparison_ != other.comparison_) return false; - if (java.lang.Double.doubleToLongBits(getThresholdValue()) - != java.lang.Double.doubleToLongBits(other.getThresholdValue())) return false; - if (hasDuration() != other.hasDuration()) return false; - if (hasDuration()) { - if (!getDuration().equals(other.getDuration())) return false; - } - if (hasTrigger() != other.hasTrigger()) return false; - if (hasTrigger()) { - if (!getTrigger().equals(other.getTrigger())) return false; - } - if (evaluationMissingData_ != other.evaluationMissingData_) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_ForecastOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .class, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .Builder.class); + } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + FILTER_FIELD_NUMBER; - hash = (53 * hash) + getFilter().hashCode(); - if (getAggregationsCount() > 0) { - hash = (37 * hash) + AGGREGATIONS_FIELD_NUMBER; - hash = (53 * hash) + getAggregationsList().hashCode(); - } - hash = (37 * hash) + DENOMINATOR_FILTER_FIELD_NUMBER; - hash = (53 * hash) + getDenominatorFilter().hashCode(); - if (getDenominatorAggregationsCount() > 0) { - hash = (37 * hash) + DENOMINATOR_AGGREGATIONS_FIELD_NUMBER; - hash = (53 * hash) + getDenominatorAggregationsList().hashCode(); - } - hash = (37 * hash) + COMPARISON_FIELD_NUMBER; - hash = (53 * hash) + comparison_; - hash = (37 * hash) + THRESHOLD_VALUE_FIELD_NUMBER; - hash = - (53 * hash) - + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getThresholdValue())); - if (hasDuration()) { - hash = (37 * hash) + DURATION_FIELD_NUMBER; - hash = (53 * hash) + getDuration().hashCode(); - } - if (hasTrigger()) { - hash = (37 * hash) + TRIGGER_FIELD_NUMBER; - hash = (53 * hash) + getTrigger().hashCode(); - } - hash = (37 * hash) + EVALUATION_MISSING_DATA_FIELD_NUMBER; - hash = (53 * hash) + evaluationMissingData_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } + // Construct using + // com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions.newBuilder() + private Builder() {} - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + forecastHorizon_ = null; + if (forecastHorizonBuilder_ != null) { + forecastHorizonBuilder_.dispose(); + forecastHorizonBuilder_ = null; + } + return this; + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_ForecastOptions_descriptor; + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + getDefaultInstanceForType() { + return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .getDefaultInstance(); + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + build() { + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + buildPartial() { + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions result = + new com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.forecastHorizon_ = + forecastHorizonBuilder_ == null + ? forecastHorizon_ + : forecastHorizonBuilder_.build(); + } + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + @java.lang.Override + public Builder clone() { + return super.clone(); + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - parseDelimitedFrom( - java.io.InputStream input, + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions) { + return mergeFrom( + (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + other) { + if (other + == com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .getDefaultInstance()) return this; + if (other.hasForecastHorizon()) { + mergeForecastHorizon(other.getForecastHorizon()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getForecastHorizonFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + private int bitField0_; - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + private com.google.protobuf.Duration forecastHorizon_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + forecastHorizonBuilder_; + /** + * + * + *
+           * Required. The length of time into the future to forecast whether a
+           * time series will violate the threshold. If the predicted value is
+           * found to violate the threshold, and the violation is observed in all
+           * forecasts made for the configured `duration`, then the time series is
+           * considered to be failing.
+           * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the forecastHorizon field is set. + */ + public boolean hasForecastHorizon() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+           * Required. The length of time into the future to forecast whether a
+           * time series will violate the threshold. If the predicted value is
+           * found to violate the threshold, and the violation is observed in all
+           * forecasts made for the configured `duration`, then the time series is
+           * considered to be failing.
+           * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The forecastHorizon. + */ + public com.google.protobuf.Duration getForecastHorizon() { + if (forecastHorizonBuilder_ == null) { + return forecastHorizon_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : forecastHorizon_; + } else { + return forecastHorizonBuilder_.getMessage(); + } + } + /** + * + * + *
+           * Required. The length of time into the future to forecast whether a
+           * time series will violate the threshold. If the predicted value is
+           * found to violate the threshold, and the violation is observed in all
+           * forecasts made for the configured `duration`, then the time series is
+           * considered to be failing.
+           * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setForecastHorizon(com.google.protobuf.Duration value) { + if (forecastHorizonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + forecastHorizon_ = value; + } else { + forecastHorizonBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Required. The length of time into the future to forecast whether a
+           * time series will violate the threshold. If the predicted value is
+           * found to violate the threshold, and the violation is observed in all
+           * forecasts made for the configured `duration`, then the time series is
+           * considered to be failing.
+           * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setForecastHorizon(com.google.protobuf.Duration.Builder builderForValue) { + if (forecastHorizonBuilder_ == null) { + forecastHorizon_ = builderForValue.build(); + } else { + forecastHorizonBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Required. The length of time into the future to forecast whether a
+           * time series will violate the threshold. If the predicted value is
+           * found to violate the threshold, and the violation is observed in all
+           * forecasts made for the configured `duration`, then the time series is
+           * considered to be failing.
+           * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeForecastHorizon(com.google.protobuf.Duration value) { + if (forecastHorizonBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && forecastHorizon_ != null + && forecastHorizon_ != com.google.protobuf.Duration.getDefaultInstance()) { + getForecastHorizonBuilder().mergeFrom(value); + } else { + forecastHorizon_ = value; + } + } else { + forecastHorizonBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Required. The length of time into the future to forecast whether a
+           * time series will violate the threshold. If the predicted value is
+           * found to violate the threshold, and the violation is observed in all
+           * forecasts made for the configured `duration`, then the time series is
+           * considered to be failing.
+           * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearForecastHorizon() { + bitField0_ = (bitField0_ & ~0x00000001); + forecastHorizon_ = null; + if (forecastHorizonBuilder_ != null) { + forecastHorizonBuilder_.dispose(); + forecastHorizonBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+           * Required. The length of time into the future to forecast whether a
+           * time series will violate the threshold. If the predicted value is
+           * found to violate the threshold, and the violation is observed in all
+           * forecasts made for the configured `duration`, then the time series is
+           * considered to be failing.
+           * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Duration.Builder getForecastHorizonBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getForecastHorizonFieldBuilder().getBuilder(); + } + /** + * + * + *
+           * Required. The length of time into the future to forecast whether a
+           * time series will violate the threshold. If the predicted value is
+           * found to violate the threshold, and the violation is observed in all
+           * forecasts made for the configured `duration`, then the time series is
+           * considered to be failing.
+           * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.DurationOrBuilder getForecastHorizonOrBuilder() { + if (forecastHorizonBuilder_ != null) { + return forecastHorizonBuilder_.getMessageOrBuilder(); + } else { + return forecastHorizon_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : forecastHorizon_; + } + } + /** + * + * + *
+           * Required. The length of time into the future to forecast whether a
+           * time series will violate the threshold. If the predicted value is
+           * found to violate the threshold, and the violation is observed in all
+           * forecasts made for the configured `duration`, then the time series is
+           * considered to be failing.
+           * 
+ * + * + * .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getForecastHorizonFieldBuilder() { + if (forecastHorizonBuilder_ == null) { + forecastHorizonBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getForecastHorizon(), getParentForChildren(), isClean()); + forecastHorizon_ = null; + } + return forecastHorizonBuilder_; + } - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions) + private static final com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .ForecastOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions(); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ForecastOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; - public static Builder newBuilder( - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + public static com.google.protobuf.Parser parser() { + return PARSER; + } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } } + + public static final int FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; /** * * *
-       * A condition type that compares a collection of time series
-       * against a threshold.
-       * 
+ * Required. A + * [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies which time series should be compared with the threshold. * - * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} + * The filter is similar to the one that is specified in the + * [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) + * (that call is useful to verify the time series that will be retrieved / + * processed). The filter must specify the metric type and the resource + * type. Optionally, it can specify resource labels and metric labels. + * This field must not exceed 2048 Unicode characters in length. + *
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) - com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.class, - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder.class); - } - - // Construct using - // com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - filter_ = ""; - if (aggregationsBuilder_ == null) { - aggregations_ = java.util.Collections.emptyList(); - } else { - aggregations_ = null; - aggregationsBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - denominatorFilter_ = ""; - if (denominatorAggregationsBuilder_ == null) { - denominatorAggregations_ = java.util.Collections.emptyList(); - } else { - denominatorAggregations_ = null; - denominatorAggregationsBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000008); - comparison_ = 0; - thresholdValue_ = 0D; - duration_ = null; - if (durationBuilder_ != null) { - durationBuilder_.dispose(); - durationBuilder_ = null; - } - trigger_ = null; - if (triggerBuilder_ != null) { - triggerBuilder_.dispose(); - triggerBuilder_ = null; - } - evaluationMissingData_ = 0; - return this; + } + /** + * + * + *
+       * Required. A
+       * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+       * identifies which time series should be compared with the threshold.
+       *
+       * The filter is similar to the one that is specified in the
+       * [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+       * (that call is useful to verify the time series that will be retrieved /
+       * processed). The filter must specify the metric type and the resource
+       * type. Optionally, it can specify resource labels and metric labels.
+       * This field must not exceed 2048 Unicode characters in length.
+       * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } + } - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_descriptor; - } + public static final int AGGREGATIONS_FIELD_NUMBER = 8; - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - getDefaultInstanceForType() { - return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - .getDefaultInstance(); - } + @SuppressWarnings("serial") + private java.util.List aggregations_; + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 8; + */ + @java.lang.Override + public java.util.List getAggregationsList() { + return aggregations_; + } + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 8; + */ + @java.lang.Override + public java.util.List + getAggregationsOrBuilderList() { + return aggregations_; + } + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 8; + */ + @java.lang.Override + public int getAggregationsCount() { + return aggregations_.size(); + } + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 8; + */ + @java.lang.Override + public com.google.monitoring.v3.Aggregation getAggregations(int index) { + return aggregations_.get(index); + } + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 8; + */ + @java.lang.Override + public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(int index) { + return aggregations_.get(index); + } - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold build() { - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } + public static final int DENOMINATOR_FILTER_FIELD_NUMBER = 9; - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold buildPartial() { - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold result = - new com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields( - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold result) { - if (aggregationsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - aggregations_ = java.util.Collections.unmodifiableList(aggregations_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.aggregations_ = aggregations_; - } else { - result.aggregations_ = aggregationsBuilder_.build(); - } - if (denominatorAggregationsBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - denominatorAggregations_ = - java.util.Collections.unmodifiableList(denominatorAggregations_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.denominatorAggregations_ = denominatorAggregations_; - } else { - result.denominatorAggregations_ = denominatorAggregationsBuilder_.build(); - } - } - - private void buildPartial0( - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.filter_ = filter_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.denominatorFilter_ = denominatorFilter_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.comparison_ = comparison_; - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.thresholdValue_ = thresholdValue_; - } - if (((from_bitField0_ & 0x00000040) != 0)) { - result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build(); - } - if (((from_bitField0_ & 0x00000080) != 0)) { - result.trigger_ = triggerBuilder_ == null ? trigger_ : triggerBuilder_.build(); - } - if (((from_bitField0_ & 0x00000100) != 0)) { - result.evaluationMissingData_ = evaluationMissingData_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); + @SuppressWarnings("serial") + private volatile java.lang.Object denominatorFilter_ = ""; + /** + * + * + *
+       * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+       * identifies a time series that should be used as the denominator of a
+       * ratio that will be compared with the threshold. If a
+       * `denominator_filter` is specified, the time series specified by the
+       * `filter` field will be used as the numerator.
+       *
+       * The filter must specify the metric type and optionally may contain
+       * restrictions on resource type, resource labels, and metric labels.
+       * This field may not exceed 2048 Unicode characters in length.
+       * 
+ * + * string denominator_filter = 9; + * + * @return The denominatorFilter. + */ + @java.lang.Override + public java.lang.String getDenominatorFilter() { + java.lang.Object ref = denominatorFilter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + denominatorFilter_ = s; + return s; } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + } + /** + * + * + *
+       * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+       * identifies a time series that should be used as the denominator of a
+       * ratio that will be compared with the threshold. If a
+       * `denominator_filter` is specified, the time series specified by the
+       * `filter` field will be used as the numerator.
+       *
+       * The filter must specify the metric type and optionally may contain
+       * restrictions on resource type, resource labels, and metric labels.
+       * This field may not exceed 2048 Unicode characters in length.
+       * 
+ * + * string denominator_filter = 9; + * + * @return The bytes for denominatorFilter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDenominatorFilterBytes() { + java.lang.Object ref = denominatorFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + denominatorFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } + } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } + public static final int DENOMINATOR_AGGREGATIONS_FIELD_NUMBER = 10; - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } + @SuppressWarnings("serial") + private java.util.List denominatorAggregations_; + /** + * + * + *
+       * Specifies the alignment of data points in individual time series
+       * selected by `denominatorFilter` as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources).
+       *
+       * When computing ratios, the `aggregations` and
+       * `denominator_aggregations` fields must use the same alignment period
+       * and produce time series that have the same periodicity and labels.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + @java.lang.Override + public java.util.List getDenominatorAggregationsList() { + return denominatorAggregations_; + } + /** + * + * + *
+       * Specifies the alignment of data points in individual time series
+       * selected by `denominatorFilter` as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources).
+       *
+       * When computing ratios, the `aggregations` and
+       * `denominator_aggregations` fields must use the same alignment period
+       * and produce time series that have the same periodicity and labels.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + @java.lang.Override + public java.util.List + getDenominatorAggregationsOrBuilderList() { + return denominatorAggregations_; + } + /** + * + * + *
+       * Specifies the alignment of data points in individual time series
+       * selected by `denominatorFilter` as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources).
+       *
+       * When computing ratios, the `aggregations` and
+       * `denominator_aggregations` fields must use the same alignment period
+       * and produce time series that have the same periodicity and labels.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + @java.lang.Override + public int getDenominatorAggregationsCount() { + return denominatorAggregations_.size(); + } + /** + * + * + *
+       * Specifies the alignment of data points in individual time series
+       * selected by `denominatorFilter` as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources).
+       *
+       * When computing ratios, the `aggregations` and
+       * `denominator_aggregations` fields must use the same alignment period
+       * and produce time series that have the same periodicity and labels.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + @java.lang.Override + public com.google.monitoring.v3.Aggregation getDenominatorAggregations(int index) { + return denominatorAggregations_.get(index); + } + /** + * + * + *
+       * Specifies the alignment of data points in individual time series
+       * selected by `denominatorFilter` as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources).
+       *
+       * When computing ratios, the `aggregations` and
+       * `denominator_aggregations` fields must use the same alignment period
+       * and produce time series that have the same periodicity and labels.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + @java.lang.Override + public com.google.monitoring.v3.AggregationOrBuilder getDenominatorAggregationsOrBuilder( + int index) { + return denominatorAggregations_.get(index); + } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) { - return mergeFrom( - (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) other); - } else { - super.mergeFrom(other); - return this; - } - } + public static final int FORECAST_OPTIONS_FIELD_NUMBER = 12; + private com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + forecastOptions_; + /** + * + * + *
+       * When this field is present, the `MetricThreshold` condition forecasts
+       * whether the time series is predicted to violate the threshold within
+       * the `forecast_horizon`. When this field is not set, the
+       * `MetricThreshold` tests the current value of the timeseries against the
+       * threshold.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + * + * @return Whether the forecastOptions field is set. + */ + @java.lang.Override + public boolean hasForecastOptions() { + return forecastOptions_ != null; + } + /** + * + * + *
+       * When this field is present, the `MetricThreshold` condition forecasts
+       * whether the time series is predicted to violate the threshold within
+       * the `forecast_horizon`. When this field is not set, the
+       * `MetricThreshold` tests the current value of the timeseries against the
+       * threshold.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + * + * @return The forecastOptions. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + getForecastOptions() { + return forecastOptions_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .getDefaultInstance() + : forecastOptions_; + } + /** + * + * + *
+       * When this field is present, the `MetricThreshold` condition forecasts
+       * whether the time series is predicted to violate the threshold within
+       * the `forecast_horizon`. When this field is not set, the
+       * `MetricThreshold` tests the current value of the timeseries against the
+       * threshold.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptionsOrBuilder + getForecastOptionsOrBuilder() { + return forecastOptions_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .getDefaultInstance() + : forecastOptions_; + } - public Builder mergeFrom( - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold other) { - if (other - == com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - .getDefaultInstance()) return this; - if (!other.getFilter().isEmpty()) { - filter_ = other.filter_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (aggregationsBuilder_ == null) { - if (!other.aggregations_.isEmpty()) { - if (aggregations_.isEmpty()) { - aggregations_ = other.aggregations_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureAggregationsIsMutable(); - aggregations_.addAll(other.aggregations_); - } - onChanged(); - } - } else { - if (!other.aggregations_.isEmpty()) { - if (aggregationsBuilder_.isEmpty()) { - aggregationsBuilder_.dispose(); - aggregationsBuilder_ = null; - aggregations_ = other.aggregations_; - bitField0_ = (bitField0_ & ~0x00000002); - aggregationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAggregationsFieldBuilder() - : null; - } else { - aggregationsBuilder_.addAllMessages(other.aggregations_); - } - } - } - if (!other.getDenominatorFilter().isEmpty()) { - denominatorFilter_ = other.denominatorFilter_; - bitField0_ |= 0x00000004; - onChanged(); - } - if (denominatorAggregationsBuilder_ == null) { - if (!other.denominatorAggregations_.isEmpty()) { - if (denominatorAggregations_.isEmpty()) { - denominatorAggregations_ = other.denominatorAggregations_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureDenominatorAggregationsIsMutable(); - denominatorAggregations_.addAll(other.denominatorAggregations_); - } - onChanged(); - } - } else { - if (!other.denominatorAggregations_.isEmpty()) { - if (denominatorAggregationsBuilder_.isEmpty()) { - denominatorAggregationsBuilder_.dispose(); - denominatorAggregationsBuilder_ = null; - denominatorAggregations_ = other.denominatorAggregations_; - bitField0_ = (bitField0_ & ~0x00000008); - denominatorAggregationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getDenominatorAggregationsFieldBuilder() - : null; - } else { - denominatorAggregationsBuilder_.addAllMessages(other.denominatorAggregations_); - } - } - } - if (other.comparison_ != 0) { - setComparisonValue(other.getComparisonValue()); - } - if (other.getThresholdValue() != 0D) { - setThresholdValue(other.getThresholdValue()); - } - if (other.hasDuration()) { - mergeDuration(other.getDuration()); - } - if (other.hasTrigger()) { - mergeTrigger(other.getTrigger()); - } - if (other.evaluationMissingData_ != 0) { - setEvaluationMissingDataValue(other.getEvaluationMissingDataValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } + public static final int COMPARISON_FIELD_NUMBER = 4; + private int comparison_ = 0; + /** + * + * + *
+       * The comparison to apply between the time series (indicated by `filter`
+       * and `aggregation`) and the threshold (indicated by `threshold_value`).
+       * The comparison is applied on each time series, with the time series
+       * on the left-hand side and the threshold on the right-hand side.
+       *
+       * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+       * 
+ * + * .google.monitoring.v3.ComparisonType comparison = 4; + * + * @return The enum numeric value on the wire for comparison. + */ + @java.lang.Override + public int getComparisonValue() { + return comparison_; + } + /** + * + * + *
+       * The comparison to apply between the time series (indicated by `filter`
+       * and `aggregation`) and the threshold (indicated by `threshold_value`).
+       * The comparison is applied on each time series, with the time series
+       * on the left-hand side and the threshold on the right-hand side.
+       *
+       * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+       * 
+ * + * .google.monitoring.v3.ComparisonType comparison = 4; + * + * @return The comparison. + */ + @java.lang.Override + public com.google.monitoring.v3.ComparisonType getComparison() { + com.google.monitoring.v3.ComparisonType result = + com.google.monitoring.v3.ComparisonType.forNumber(comparison_); + return result == null ? com.google.monitoring.v3.ComparisonType.UNRECOGNIZED : result; + } - @java.lang.Override - public final boolean isInitialized() { - return true; - } + public static final int THRESHOLD_VALUE_FIELD_NUMBER = 5; + private double thresholdValue_ = 0D; + /** + * + * + *
+       * A value against which to compare the time series.
+       * 
+ * + * double threshold_value = 5; + * + * @return The thresholdValue. + */ + @java.lang.Override + public double getThresholdValue() { + return thresholdValue_; + } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: - { - filter_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 18 - case 32: - { - comparison_ = input.readEnum(); - bitField0_ |= 0x00000010; - break; - } // case 32 - case 41: - { - thresholdValue_ = input.readDouble(); - bitField0_ |= 0x00000020; - break; - } // case 41 - case 50: - { - input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000040; - break; - } // case 50 - case 58: - { - input.readMessage(getTriggerFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000080; - break; - } // case 58 - case 66: - { - com.google.monitoring.v3.Aggregation m = - input.readMessage( - com.google.monitoring.v3.Aggregation.parser(), extensionRegistry); - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - aggregations_.add(m); - } else { - aggregationsBuilder_.addMessage(m); - } - break; - } // case 66 - case 74: - { - denominatorFilter_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 74 - case 82: - { - com.google.monitoring.v3.Aggregation m = - input.readMessage( - com.google.monitoring.v3.Aggregation.parser(), extensionRegistry); - if (denominatorAggregationsBuilder_ == null) { - ensureDenominatorAggregationsIsMutable(); - denominatorAggregations_.add(m); - } else { - denominatorAggregationsBuilder_.addMessage(m); - } - break; - } // case 82 - case 88: - { - evaluationMissingData_ = input.readEnum(); - bitField0_ |= 0x00000100; - break; - } // case 88 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } + public static final int DURATION_FIELD_NUMBER = 6; + private com.google.protobuf.Duration duration_; + /** + * + * + *
+       * The amount of time that a time series must violate the
+       * threshold to be considered failing. Currently, only values
+       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+       * seconds--are supported. If an invalid value is given, an
+       * error will be returned. When choosing a duration, it is useful to
+       * keep in mind the frequency of the underlying time series data
+       * (which may also be affected by any alignments specified in the
+       * `aggregations` field); a good duration is long enough so that a single
+       * outlier does not generate spurious alerts, but short enough that
+       * unhealthy states are detected and alerted on quickly.
+       * 
+ * + * .google.protobuf.Duration duration = 6; + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return duration_ != null; + } + /** + * + * + *
+       * The amount of time that a time series must violate the
+       * threshold to be considered failing. Currently, only values
+       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+       * seconds--are supported. If an invalid value is given, an
+       * error will be returned. When choosing a duration, it is useful to
+       * keep in mind the frequency of the underlying time series data
+       * (which may also be affected by any alignments specified in the
+       * `aggregations` field); a good duration is long enough so that a single
+       * outlier does not generate spurious alerts, but short enough that
+       * unhealthy states are detected and alerted on quickly.
+       * 
+ * + * .google.protobuf.Duration duration = 6; + * + * @return The duration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + /** + * + * + *
+       * The amount of time that a time series must violate the
+       * threshold to be considered failing. Currently, only values
+       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+       * seconds--are supported. If an invalid value is given, an
+       * error will be returned. When choosing a duration, it is useful to
+       * keep in mind the frequency of the underlying time series data
+       * (which may also be affected by any alignments specified in the
+       * `aggregations` field); a good duration is long enough so that a single
+       * outlier does not generate spurious alerts, but short enough that
+       * unhealthy states are detected and alerted on quickly.
+       * 
+ * + * .google.protobuf.Duration duration = 6; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } - private int bitField0_; + public static final int TRIGGER_FIELD_NUMBER = 7; + private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; + /** + * + * + *
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`,
+       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+       * are specified.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * + * @return Whether the trigger field is set. + */ + @java.lang.Override + public boolean hasTrigger() { + return trigger_ != null; + } + /** + * + * + *
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`,
+       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+       * are specified.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * + * @return The trigger. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; + } + /** + * + * + *
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`,
+       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+       * are specified.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder() { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; + } - private java.lang.Object filter_ = ""; - /** - * - * - *
-         * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies which time series should be compared with the threshold.
-         *
-         * The filter is similar to the one that is specified in the
-         * [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-         * (that call is useful to verify the time series that will be retrieved /
-         * processed). The filter must specify the metric type and the resource
-         * type. Optionally, it can specify resource labels and metric labels.
-         * This field must not exceed 2048 Unicode characters in length.
-         * 
- * - * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The filter. - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-         * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies which time series should be compared with the threshold.
-         *
-         * The filter is similar to the one that is specified in the
-         * [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-         * (that call is useful to verify the time series that will be retrieved /
-         * processed). The filter must specify the metric type and the resource
-         * type. Optionally, it can specify resource labels and metric labels.
-         * This field must not exceed 2048 Unicode characters in length.
-         * 
- * - * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for filter. - */ - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-         * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies which time series should be compared with the threshold.
-         *
-         * The filter is similar to the one that is specified in the
-         * [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-         * (that call is useful to verify the time series that will be retrieved /
-         * processed). The filter must specify the metric type and the resource
-         * type. Optionally, it can specify resource labels and metric labels.
-         * This field must not exceed 2048 Unicode characters in length.
-         * 
- * - * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The filter to set. - * @return This builder for chaining. - */ - public Builder setFilter(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - filter_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; + public static final int EVALUATION_MISSING_DATA_FIELD_NUMBER = 11; + private int evaluationMissingData_ = 0; + /** + * + * + *
+       * A condition control that determines how metric-threshold conditions
+       * are evaluated when data stops arriving.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + * + * + * @return The enum numeric value on the wire for evaluationMissingData. + */ + @java.lang.Override + public int getEvaluationMissingDataValue() { + return evaluationMissingData_; + } + /** + * + * + *
+       * A condition control that determines how metric-threshold conditions
+       * are evaluated when data stops arriving.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + * + * + * @return The evaluationMissingData. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData + getEvaluationMissingData() { + com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData result = + com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.forNumber( + evaluationMissingData_); + return result == null + ? com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); } - /** - * - * - *
-         * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies which time series should be compared with the threshold.
-         *
-         * The filter is similar to the one that is specified in the
-         * [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-         * (that call is useful to verify the time series that will be retrieved /
-         * processed). The filter must specify the metric type and the resource
-         * type. Optionally, it can specify resource labels and metric labels.
-         * This field must not exceed 2048 Unicode characters in length.
-         * 
- * - * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearFilter() { - filter_ = getDefaultInstance().getFilter(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; + if (comparison_ + != com.google.monitoring.v3.ComparisonType.COMPARISON_UNSPECIFIED.getNumber()) { + output.writeEnum(4, comparison_); } - /** - * - * - *
-         * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies which time series should be compared with the threshold.
-         *
-         * The filter is similar to the one that is specified in the
-         * [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-         * (that call is useful to verify the time series that will be retrieved /
-         * processed). The filter must specify the metric type and the resource
-         * type. Optionally, it can specify resource labels and metric labels.
-         * This field must not exceed 2048 Unicode characters in length.
-         * 
- * - * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for filter to set. - * @return This builder for chaining. - */ - public Builder setFilterBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - filter_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; + if (java.lang.Double.doubleToRawLongBits(thresholdValue_) != 0) { + output.writeDouble(5, thresholdValue_); } - - private java.util.List aggregations_ = - java.util.Collections.emptyList(); - - private void ensureAggregationsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - aggregations_ = - new java.util.ArrayList(aggregations_); - bitField0_ |= 0x00000002; - } + if (duration_ != null) { + output.writeMessage(6, getDuration()); + } + if (trigger_ != null) { + output.writeMessage(7, getTrigger()); + } + for (int i = 0; i < aggregations_.size(); i++) { + output.writeMessage(8, aggregations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(denominatorFilter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, denominatorFilter_); + } + for (int i = 0; i < denominatorAggregations_.size(); i++) { + output.writeMessage(10, denominatorAggregations_.get(i)); + } + if (evaluationMissingData_ + != com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData + .EVALUATION_MISSING_DATA_UNSPECIFIED + .getNumber()) { + output.writeEnum(11, evaluationMissingData_); } + if (forecastOptions_ != null) { + output.writeMessage(12, getForecastOptions()); + } + getUnknownFields().writeTo(output); + } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.monitoring.v3.Aggregation, - com.google.monitoring.v3.Aggregation.Builder, - com.google.monitoring.v3.AggregationOrBuilder> - aggregationsBuilder_; + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public java.util.List getAggregationsList() { - if (aggregationsBuilder_ == null) { - return java.util.Collections.unmodifiableList(aggregations_); - } else { - return aggregationsBuilder_.getMessageList(); - } + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public int getAggregationsCount() { - if (aggregationsBuilder_ == null) { - return aggregations_.size(); - } else { - return aggregationsBuilder_.getCount(); - } + if (comparison_ + != com.google.monitoring.v3.ComparisonType.COMPARISON_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, comparison_); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public com.google.monitoring.v3.Aggregation getAggregations(int index) { - if (aggregationsBuilder_ == null) { - return aggregations_.get(index); - } else { - return aggregationsBuilder_.getMessage(index); - } + if (java.lang.Double.doubleToRawLongBits(thresholdValue_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(5, thresholdValue_); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public Builder setAggregations(int index, com.google.monitoring.v3.Aggregation value) { - if (aggregationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAggregationsIsMutable(); - aggregations_.set(index, value); - onChanged(); - } else { - aggregationsBuilder_.setMessage(index, value); - } - return this; + if (duration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDuration()); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public Builder setAggregations( - int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - aggregations_.set(index, builderForValue.build()); - onChanged(); - } else { - aggregationsBuilder_.setMessage(index, builderForValue.build()); - } - return this; + if (trigger_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getTrigger()); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public Builder addAggregations(com.google.monitoring.v3.Aggregation value) { - if (aggregationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAggregationsIsMutable(); - aggregations_.add(value); - onChanged(); - } else { - aggregationsBuilder_.addMessage(value); - } - return this; + for (int i = 0; i < aggregations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, aggregations_.get(i)); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public Builder addAggregations(int index, com.google.monitoring.v3.Aggregation value) { - if (aggregationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAggregationsIsMutable(); - aggregations_.add(index, value); - onChanged(); - } else { - aggregationsBuilder_.addMessage(index, value); - } - return this; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(denominatorFilter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, denominatorFilter_); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public Builder addAggregations( - com.google.monitoring.v3.Aggregation.Builder builderForValue) { - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - aggregations_.add(builderForValue.build()); - onChanged(); - } else { - aggregationsBuilder_.addMessage(builderForValue.build()); - } - return this; + for (int i = 0; i < denominatorAggregations_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, denominatorAggregations_.get(i)); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public Builder addAggregations( - int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - aggregations_.add(index, builderForValue.build()); - onChanged(); - } else { - aggregationsBuilder_.addMessage(index, builderForValue.build()); - } - return this; + if (evaluationMissingData_ + != com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData + .EVALUATION_MISSING_DATA_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, evaluationMissingData_); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public Builder addAllAggregations( - java.lang.Iterable values) { - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, aggregations_); - onChanged(); - } else { - aggregationsBuilder_.addAllMessages(values); - } - return this; + if (forecastOptions_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(12, getForecastOptions()); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public Builder clearAggregations() { - if (aggregationsBuilder_ == null) { - aggregations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - aggregationsBuilder_.clear(); - } - return this; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public Builder removeAggregations(int index) { - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - aggregations_.remove(index); - onChanged(); - } else { - aggregationsBuilder_.remove(index); - } - return this; + if (!(obj instanceof com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold)) { + return super.equals(obj); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public com.google.monitoring.v3.Aggregation.Builder getAggregationsBuilder(int index) { - return getAggregationsFieldBuilder().getBuilder(index); + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold other = + (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) obj; + + if (!getFilter().equals(other.getFilter())) return false; + if (!getAggregationsList().equals(other.getAggregationsList())) return false; + if (!getDenominatorFilter().equals(other.getDenominatorFilter())) return false; + if (!getDenominatorAggregationsList().equals(other.getDenominatorAggregationsList())) + return false; + if (hasForecastOptions() != other.hasForecastOptions()) return false; + if (hasForecastOptions()) { + if (!getForecastOptions().equals(other.getForecastOptions())) return false; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(int index) { - if (aggregationsBuilder_ == null) { - return aggregations_.get(index); - } else { - return aggregationsBuilder_.getMessageOrBuilder(index); - } + if (comparison_ != other.comparison_) return false; + if (java.lang.Double.doubleToLongBits(getThresholdValue()) + != java.lang.Double.doubleToLongBits(other.getThresholdValue())) return false; + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) return false; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public java.util.List - getAggregationsOrBuilderList() { - if (aggregationsBuilder_ != null) { - return aggregationsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(aggregations_); - } + if (hasTrigger() != other.hasTrigger()) return false; + if (hasTrigger()) { + if (!getTrigger().equals(other.getTrigger())) return false; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder() { - return getAggregationsFieldBuilder() - .addBuilder(com.google.monitoring.v3.Aggregation.getDefaultInstance()); + if (evaluationMissingData_ != other.evaluationMissingData_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder(int index) { - return getAggregationsFieldBuilder() - .addBuilder(index, com.google.monitoring.v3.Aggregation.getDefaultInstance()); + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + if (getAggregationsCount() > 0) { + hash = (37 * hash) + AGGREGATIONS_FIELD_NUMBER; + hash = (53 * hash) + getAggregationsList().hashCode(); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 8; - */ - public java.util.List - getAggregationsBuilderList() { - return getAggregationsFieldBuilder().getBuilderList(); + hash = (37 * hash) + DENOMINATOR_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getDenominatorFilter().hashCode(); + if (getDenominatorAggregationsCount() > 0) { + hash = (37 * hash) + DENOMINATOR_AGGREGATIONS_FIELD_NUMBER; + hash = (53 * hash) + getDenominatorAggregationsList().hashCode(); } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.monitoring.v3.Aggregation, - com.google.monitoring.v3.Aggregation.Builder, - com.google.monitoring.v3.AggregationOrBuilder> - getAggregationsFieldBuilder() { - if (aggregationsBuilder_ == null) { - aggregationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.monitoring.v3.Aggregation, - com.google.monitoring.v3.Aggregation.Builder, - com.google.monitoring.v3.AggregationOrBuilder>( - aggregations_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - aggregations_ = null; - } - return aggregationsBuilder_; + if (hasForecastOptions()) { + hash = (37 * hash) + FORECAST_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getForecastOptions().hashCode(); } - - private java.lang.Object denominatorFilter_ = ""; - /** - * - * - *
-         * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies a time series that should be used as the denominator of a
-         * ratio that will be compared with the threshold. If a
-         * `denominator_filter` is specified, the time series specified by the
-         * `filter` field will be used as the numerator.
-         *
-         * The filter must specify the metric type and optionally may contain
-         * restrictions on resource type, resource labels, and metric labels.
-         * This field may not exceed 2048 Unicode characters in length.
-         * 
- * - * string denominator_filter = 9; - * - * @return The denominatorFilter. - */ - public java.lang.String getDenominatorFilter() { - java.lang.Object ref = denominatorFilter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - denominatorFilter_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-         * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies a time series that should be used as the denominator of a
-         * ratio that will be compared with the threshold. If a
-         * `denominator_filter` is specified, the time series specified by the
-         * `filter` field will be used as the numerator.
-         *
-         * The filter must specify the metric type and optionally may contain
-         * restrictions on resource type, resource labels, and metric labels.
-         * This field may not exceed 2048 Unicode characters in length.
-         * 
- * - * string denominator_filter = 9; - * - * @return The bytes for denominatorFilter. - */ - public com.google.protobuf.ByteString getDenominatorFilterBytes() { - java.lang.Object ref = denominatorFilter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - denominatorFilter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-         * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies a time series that should be used as the denominator of a
-         * ratio that will be compared with the threshold. If a
-         * `denominator_filter` is specified, the time series specified by the
-         * `filter` field will be used as the numerator.
-         *
-         * The filter must specify the metric type and optionally may contain
-         * restrictions on resource type, resource labels, and metric labels.
-         * This field may not exceed 2048 Unicode characters in length.
-         * 
- * - * string denominator_filter = 9; - * - * @param value The denominatorFilter to set. - * @return This builder for chaining. - */ - public Builder setDenominatorFilter(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - denominatorFilter_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-         * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies a time series that should be used as the denominator of a
-         * ratio that will be compared with the threshold. If a
-         * `denominator_filter` is specified, the time series specified by the
-         * `filter` field will be used as the numerator.
-         *
-         * The filter must specify the metric type and optionally may contain
-         * restrictions on resource type, resource labels, and metric labels.
-         * This field may not exceed 2048 Unicode characters in length.
-         * 
- * - * string denominator_filter = 9; - * - * @return This builder for chaining. - */ - public Builder clearDenominatorFilter() { - denominatorFilter_ = getDefaultInstance().getDenominatorFilter(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; + hash = (37 * hash) + COMPARISON_FIELD_NUMBER; + hash = (53 * hash) + comparison_; + hash = (37 * hash) + THRESHOLD_VALUE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getThresholdValue())); + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); } - /** - * - * - *
-         * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies a time series that should be used as the denominator of a
-         * ratio that will be compared with the threshold. If a
-         * `denominator_filter` is specified, the time series specified by the
-         * `filter` field will be used as the numerator.
-         *
-         * The filter must specify the metric type and optionally may contain
-         * restrictions on resource type, resource labels, and metric labels.
-         * This field may not exceed 2048 Unicode characters in length.
-         * 
- * - * string denominator_filter = 9; - * - * @param value The bytes for denominatorFilter to set. - * @return This builder for chaining. - */ - public Builder setDenominatorFilterBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - denominatorFilter_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; + if (hasTrigger()) { + hash = (37 * hash) + TRIGGER_FIELD_NUMBER; + hash = (53 * hash) + getTrigger().hashCode(); } + hash = (37 * hash) + EVALUATION_MISSING_DATA_FIELD_NUMBER; + hash = (53 * hash) + evaluationMissingData_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } - private java.util.List denominatorAggregations_ = - java.util.Collections.emptyList(); + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - private void ensureDenominatorAggregationsIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - denominatorAggregations_ = - new java.util.ArrayList( - denominatorAggregations_); - bitField0_ |= 0x00000008; - } - } + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.monitoring.v3.Aggregation, - com.google.monitoring.v3.Aggregation.Builder, - com.google.monitoring.v3.AggregationOrBuilder> - denominatorAggregationsBuilder_; + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
-         *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - public java.util.List - getDenominatorAggregationsList() { - if (denominatorAggregationsBuilder_ == null) { - return java.util.Collections.unmodifiableList(denominatorAggregations_); - } else { - return denominatorAggregationsBuilder_.getMessageList(); - } - } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
-         *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - public int getDenominatorAggregationsCount() { - if (denominatorAggregationsBuilder_ == null) { - return denominatorAggregations_.size(); - } else { - return denominatorAggregationsBuilder_.getCount(); - } - } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
-         *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - public com.google.monitoring.v3.Aggregation getDenominatorAggregations(int index) { - if (denominatorAggregationsBuilder_ == null) { - return denominatorAggregations_.get(index); - } else { - return denominatorAggregationsBuilder_.getMessage(index); - } - } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
-         *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - public Builder setDenominatorAggregations( - int index, com.google.monitoring.v3.Aggregation value) { - if (denominatorAggregationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDenominatorAggregationsIsMutable(); - denominatorAggregations_.set(index, value); - onChanged(); + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * A condition type that compares a collection of time series
+       * against a threshold.
+       * 
+ * + * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) + com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.class, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder.class); + } + + // Construct using + // com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + filter_ = ""; + if (aggregationsBuilder_ == null) { + aggregations_ = java.util.Collections.emptyList(); } else { - denominatorAggregationsBuilder_.setMessage(index, value); + aggregations_ = null; + aggregationsBuilder_.clear(); } - return this; - } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
-         *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - public Builder setDenominatorAggregations( - int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { + bitField0_ = (bitField0_ & ~0x00000002); + denominatorFilter_ = ""; if (denominatorAggregationsBuilder_ == null) { - ensureDenominatorAggregationsIsMutable(); - denominatorAggregations_.set(index, builderForValue.build()); - onChanged(); + denominatorAggregations_ = java.util.Collections.emptyList(); } else { - denominatorAggregationsBuilder_.setMessage(index, builderForValue.build()); + denominatorAggregations_ = null; + denominatorAggregationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + forecastOptions_ = null; + if (forecastOptionsBuilder_ != null) { + forecastOptionsBuilder_.dispose(); + forecastOptionsBuilder_ = null; + } + comparison_ = 0; + thresholdValue_ = 0D; + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + trigger_ = null; + if (triggerBuilder_ != null) { + triggerBuilder_.dispose(); + triggerBuilder_ = null; } + evaluationMissingData_ = 0; return this; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
-         *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - public Builder addDenominatorAggregations(com.google.monitoring.v3.Aggregation value) { - if (denominatorAggregationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDenominatorAggregationsIsMutable(); - denominatorAggregations_.add(value); - onChanged(); - } else { - denominatorAggregationsBuilder_.addMessage(value); + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + getDefaultInstanceForType() { + return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold build() { + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } - return this; + return result; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
-         *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - public Builder addDenominatorAggregations( - int index, com.google.monitoring.v3.Aggregation value) { - if (denominatorAggregationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold buildPartial() { + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold result = + new com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold result) { + if (aggregationsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + aggregations_ = java.util.Collections.unmodifiableList(aggregations_); + bitField0_ = (bitField0_ & ~0x00000002); } - ensureDenominatorAggregationsIsMutable(); - denominatorAggregations_.add(index, value); - onChanged(); + result.aggregations_ = aggregations_; } else { - denominatorAggregationsBuilder_.addMessage(index, value); + result.aggregations_ = aggregationsBuilder_.build(); } - return this; - } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
-         *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - public Builder addDenominatorAggregations( - com.google.monitoring.v3.Aggregation.Builder builderForValue) { if (denominatorAggregationsBuilder_ == null) { - ensureDenominatorAggregationsIsMutable(); - denominatorAggregations_.add(builderForValue.build()); - onChanged(); + if (((bitField0_ & 0x00000008) != 0)) { + denominatorAggregations_ = + java.util.Collections.unmodifiableList(denominatorAggregations_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.denominatorAggregations_ = denominatorAggregations_; } else { - denominatorAggregationsBuilder_.addMessage(builderForValue.build()); + result.denominatorAggregations_ = denominatorAggregationsBuilder_.build(); } - return this; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
-         *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - public Builder addDenominatorAggregations( - int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { - if (denominatorAggregationsBuilder_ == null) { - ensureDenominatorAggregationsIsMutable(); - denominatorAggregations_.add(index, builderForValue.build()); - onChanged(); - } else { - denominatorAggregationsBuilder_.addMessage(index, builderForValue.build()); + + private void buildPartial0( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.denominatorFilter_ = denominatorFilter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.forecastOptions_ = + forecastOptionsBuilder_ == null + ? forecastOptions_ + : forecastOptionsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.comparison_ = comparison_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.thresholdValue_ = thresholdValue_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.trigger_ = triggerBuilder_ == null ? trigger_ : triggerBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.evaluationMissingData_ = evaluationMissingData_; } - return this; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
-         *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - public Builder addAllDenominatorAggregations( - java.lang.Iterable values) { - if (denominatorAggregationsBuilder_ == null) { - ensureDenominatorAggregationsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, denominatorAggregations_); - onChanged(); + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) { + return mergeFrom( + (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) other); } else { - denominatorAggregationsBuilder_.addAllMessages(values); + super.mergeFrom(other); + return this; } - return this; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
-         *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - */ - public Builder clearDenominatorAggregations() { - if (denominatorAggregationsBuilder_ == null) { - denominatorAggregations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + + public Builder mergeFrom( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold other) { + if (other + == com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .getDefaultInstance()) return this; + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000001; onChanged(); + } + if (aggregationsBuilder_ == null) { + if (!other.aggregations_.isEmpty()) { + if (aggregations_.isEmpty()) { + aggregations_ = other.aggregations_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAggregationsIsMutable(); + aggregations_.addAll(other.aggregations_); + } + onChanged(); + } } else { - denominatorAggregationsBuilder_.clear(); + if (!other.aggregations_.isEmpty()) { + if (aggregationsBuilder_.isEmpty()) { + aggregationsBuilder_.dispose(); + aggregationsBuilder_ = null; + aggregations_ = other.aggregations_; + bitField0_ = (bitField0_ & ~0x00000002); + aggregationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAggregationsFieldBuilder() + : null; + } else { + aggregationsBuilder_.addAllMessages(other.aggregations_); + } + } } + if (!other.getDenominatorFilter().isEmpty()) { + denominatorFilter_ = other.denominatorFilter_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (denominatorAggregationsBuilder_ == null) { + if (!other.denominatorAggregations_.isEmpty()) { + if (denominatorAggregations_.isEmpty()) { + denominatorAggregations_ = other.denominatorAggregations_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureDenominatorAggregationsIsMutable(); + denominatorAggregations_.addAll(other.denominatorAggregations_); + } + onChanged(); + } + } else { + if (!other.denominatorAggregations_.isEmpty()) { + if (denominatorAggregationsBuilder_.isEmpty()) { + denominatorAggregationsBuilder_.dispose(); + denominatorAggregationsBuilder_ = null; + denominatorAggregations_ = other.denominatorAggregations_; + bitField0_ = (bitField0_ & ~0x00000008); + denominatorAggregationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDenominatorAggregationsFieldBuilder() + : null; + } else { + denominatorAggregationsBuilder_.addAllMessages(other.denominatorAggregations_); + } + } + } + if (other.hasForecastOptions()) { + mergeForecastOptions(other.getForecastOptions()); + } + if (other.comparison_ != 0) { + setComparisonValue(other.getComparisonValue()); + } + if (other.getThresholdValue() != 0D) { + setThresholdValue(other.getThresholdValue()); + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + if (other.hasTrigger()) { + mergeTrigger(other.getTrigger()); + } + if (other.evaluationMissingData_ != 0) { + setEvaluationMissingDataValue(other.getEvaluationMissingDataValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 18 + case 32: + { + comparison_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 32 + case 41: + { + thresholdValue_ = input.readDouble(); + bitField0_ |= 0x00000040; + break; + } // case 41 + case 50: + { + input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 50 + case 58: + { + input.readMessage(getTriggerFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 58 + case 66: + { + com.google.monitoring.v3.Aggregation m = + input.readMessage( + com.google.monitoring.v3.Aggregation.parser(), extensionRegistry); + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + aggregations_.add(m); + } else { + aggregationsBuilder_.addMessage(m); + } + break; + } // case 66 + case 74: + { + denominatorFilter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 74 + case 82: + { + com.google.monitoring.v3.Aggregation m = + input.readMessage( + com.google.monitoring.v3.Aggregation.parser(), extensionRegistry); + if (denominatorAggregationsBuilder_ == null) { + ensureDenominatorAggregationsIsMutable(); + denominatorAggregations_.add(m); + } else { + denominatorAggregationsBuilder_.addMessage(m); + } + break; + } // case 82 + case 88: + { + evaluationMissingData_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 88 + case 98: + { + input.readMessage( + getForecastOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 98 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally return this; } + + private int bitField0_; + + private java.lang.Object filter_ = ""; /** * * *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
+         * Required. A
+         * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies which time series should be compared with the threshold.
          *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
+         * The filter is similar to the one that is specified in the
+         * [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+         * (that call is useful to verify the time series that will be retrieved /
+         * processed). The filter must specify the metric type and the resource
+         * type. Optionally, it can specify resource labels and metric labels.
+         * This field must not exceed 2048 Unicode characters in length.
          * 
* - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. */ - public Builder removeDenominatorAggregations(int index) { - if (denominatorAggregationsBuilder_ == null) { - ensureDenominatorAggregationsIsMutable(); - denominatorAggregations_.remove(index); - onChanged(); + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; } else { - denominatorAggregationsBuilder_.remove(index); + return (java.lang.String) ref; } - return this; } /** * * *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
+         * Required. A
+         * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies which time series should be compared with the threshold.
          *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
+         * The filter is similar to the one that is specified in the
+         * [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+         * (that call is useful to verify the time series that will be retrieved /
+         * processed). The filter must specify the metric type and the resource
+         * type. Optionally, it can specify resource labels and metric labels.
+         * This field must not exceed 2048 Unicode characters in length.
          * 
* - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. */ - public com.google.monitoring.v3.Aggregation.Builder getDenominatorAggregationsBuilder( - int index) { - return getDenominatorAggregationsFieldBuilder().getBuilder(index); + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** * * *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
+         * Required. A
+         * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies which time series should be compared with the threshold.
          *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
+         * The filter is similar to the one that is specified in the
+         * [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+         * (that call is useful to verify the time series that will be retrieved /
+         * processed). The filter must specify the metric type and the resource
+         * type. Optionally, it can specify resource labels and metric labels.
+         * This field must not exceed 2048 Unicode characters in length.
          * 
* - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The filter to set. + * @return This builder for chaining. */ - public com.google.monitoring.v3.AggregationOrBuilder getDenominatorAggregationsOrBuilder( - int index) { - if (denominatorAggregationsBuilder_ == null) { - return denominatorAggregations_.get(index); - } else { - return denominatorAggregationsBuilder_.getMessageOrBuilder(index); + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } + filter_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; } /** * * *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
+         * Required. A
+         * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies which time series should be compared with the threshold.
          *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
+         * The filter is similar to the one that is specified in the
+         * [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+         * (that call is useful to verify the time series that will be retrieved /
+         * processed). The filter must specify the metric type and the resource
+         * type. Optionally, it can specify resource labels and metric labels.
+         * This field must not exceed 2048 Unicode characters in length.
          * 
* - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. */ - public java.util.List - getDenominatorAggregationsOrBuilderList() { - if (denominatorAggregationsBuilder_ != null) { - return denominatorAggregationsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(denominatorAggregations_); - } + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; } /** * * *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
+         * Required. A
+         * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies which time series should be compared with the threshold.
          *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
+         * The filter is similar to the one that is specified in the
+         * [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+         * (that call is useful to verify the time series that will be retrieved /
+         * processed). The filter must specify the metric type and the resource
+         * type. Optionally, it can specify resource labels and metric labels.
+         * This field must not exceed 2048 Unicode characters in length.
          * 
* - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. */ - public com.google.monitoring.v3.Aggregation.Builder addDenominatorAggregationsBuilder() { - return getDenominatorAggregationsFieldBuilder() - .addBuilder(com.google.monitoring.v3.Aggregation.getDefaultInstance()); + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List aggregations_ = + java.util.Collections.emptyList(); + + private void ensureAggregationsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + aggregations_ = + new java.util.ArrayList(aggregations_); + bitField0_ |= 0x00000002; + } } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder> + aggregationsBuilder_; + /** * * *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
+         * Specifies the alignment of data points in individual time series as
          * well as how to combine the retrieved time series together (such as
          * when aggregating multiple streams on each resource to a single
          * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
          *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public com.google.monitoring.v3.Aggregation.Builder addDenominatorAggregationsBuilder( - int index) { - return getDenominatorAggregationsFieldBuilder() - .addBuilder(index, com.google.monitoring.v3.Aggregation.getDefaultInstance()); + public java.util.List getAggregationsList() { + if (aggregationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(aggregations_); + } else { + return aggregationsBuilder_.getMessageList(); + } } /** * * *
-         * Specifies the alignment of data points in individual time series
-         * selected by `denominatorFilter` as
+         * Specifies the alignment of data points in individual time series as
          * well as how to combine the retrieved time series together (such as
          * when aggregating multiple streams on each resource to a single
          * stream for each resource or when aggregating streams across all
-         * members of a group of resources).
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
          *
-         * When computing ratios, the `aggregations` and
-         * `denominator_aggregations` fields must use the same alignment period
-         * and produce time series that have the same periodicity and labels.
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public java.util.List - getDenominatorAggregationsBuilderList() { - return getDenominatorAggregationsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.monitoring.v3.Aggregation, - com.google.monitoring.v3.Aggregation.Builder, - com.google.monitoring.v3.AggregationOrBuilder> - getDenominatorAggregationsFieldBuilder() { - if (denominatorAggregationsBuilder_ == null) { - denominatorAggregationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.monitoring.v3.Aggregation, - com.google.monitoring.v3.Aggregation.Builder, - com.google.monitoring.v3.AggregationOrBuilder>( - denominatorAggregations_, - ((bitField0_ & 0x00000008) != 0), - getParentForChildren(), - isClean()); - denominatorAggregations_ = null; + public int getAggregationsCount() { + if (aggregationsBuilder_ == null) { + return aggregations_.size(); + } else { + return aggregationsBuilder_.getCount(); } - return denominatorAggregationsBuilder_; } - - private int comparison_ = 0; /** * * *
-         * The comparison to apply between the time series (indicated by `filter`
-         * and `aggregation`) and the threshold (indicated by `threshold_value`).
-         * The comparison is applied on each time series, with the time series
-         * on the left-hand side and the threshold on the right-hand side.
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
          *
-         * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * .google.monitoring.v3.ComparisonType comparison = 4; - * - * @return The enum numeric value on the wire for comparison. + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - @java.lang.Override - public int getComparisonValue() { - return comparison_; + public com.google.monitoring.v3.Aggregation getAggregations(int index) { + if (aggregationsBuilder_ == null) { + return aggregations_.get(index); + } else { + return aggregationsBuilder_.getMessage(index); + } } /** * * *
-         * The comparison to apply between the time series (indicated by `filter`
-         * and `aggregation`) and the threshold (indicated by `threshold_value`).
-         * The comparison is applied on each time series, with the time series
-         * on the left-hand side and the threshold on the right-hand side.
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
          *
-         * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * .google.monitoring.v3.ComparisonType comparison = 4; - * - * @param value The enum numeric value on the wire for comparison to set. - * @return This builder for chaining. + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public Builder setComparisonValue(int value) { - comparison_ = value; - bitField0_ |= 0x00000010; - onChanged(); + public Builder setAggregations(int index, com.google.monitoring.v3.Aggregation value) { + if (aggregationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAggregationsIsMutable(); + aggregations_.set(index, value); + onChanged(); + } else { + aggregationsBuilder_.setMessage(index, value); + } return this; } /** * * *
-         * The comparison to apply between the time series (indicated by `filter`
-         * and `aggregation`) and the threshold (indicated by `threshold_value`).
-         * The comparison is applied on each time series, with the time series
-         * on the left-hand side and the threshold on the right-hand side.
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
          *
-         * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * .google.monitoring.v3.ComparisonType comparison = 4; - * - * @return The comparison. + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - @java.lang.Override - public com.google.monitoring.v3.ComparisonType getComparison() { - com.google.monitoring.v3.ComparisonType result = - com.google.monitoring.v3.ComparisonType.forNumber(comparison_); - return result == null ? com.google.monitoring.v3.ComparisonType.UNRECOGNIZED : result; - } - /** - * + public Builder setAggregations( + int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + aggregations_.set(index, builderForValue.build()); + onChanged(); + } else { + aggregationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * * *
-         * The comparison to apply between the time series (indicated by `filter`
-         * and `aggregation`) and the threshold (indicated by `threshold_value`).
-         * The comparison is applied on each time series, with the time series
-         * on the left-hand side and the threshold on the right-hand side.
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
          *
-         * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * .google.monitoring.v3.ComparisonType comparison = 4; - * - * @param value The comparison to set. - * @return This builder for chaining. + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public Builder setComparison(com.google.monitoring.v3.ComparisonType value) { - if (value == null) { - throw new NullPointerException(); + public Builder addAggregations(com.google.monitoring.v3.Aggregation value) { + if (aggregationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAggregationsIsMutable(); + aggregations_.add(value); + onChanged(); + } else { + aggregationsBuilder_.addMessage(value); } - bitField0_ |= 0x00000010; - comparison_ = value.getNumber(); - onChanged(); return this; } /** * * *
-         * The comparison to apply between the time series (indicated by `filter`
-         * and `aggregation`) and the threshold (indicated by `threshold_value`).
-         * The comparison is applied on each time series, with the time series
-         * on the left-hand side and the threshold on the right-hand side.
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
          *
-         * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * .google.monitoring.v3.ComparisonType comparison = 4; - * - * @return This builder for chaining. + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public Builder clearComparison() { - bitField0_ = (bitField0_ & ~0x00000010); - comparison_ = 0; - onChanged(); + public Builder addAggregations(int index, com.google.monitoring.v3.Aggregation value) { + if (aggregationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAggregationsIsMutable(); + aggregations_.add(index, value); + onChanged(); + } else { + aggregationsBuilder_.addMessage(index, value); + } return this; } - - private double thresholdValue_; /** * * *
-         * A value against which to compare the time series.
-         * 
+ * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. * - * double threshold_value = 5; + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + *
* - * @return The thresholdValue. + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - @java.lang.Override - public double getThresholdValue() { - return thresholdValue_; + public Builder addAggregations( + com.google.monitoring.v3.Aggregation.Builder builderForValue) { + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + aggregations_.add(builderForValue.build()); + onChanged(); + } else { + aggregationsBuilder_.addMessage(builderForValue.build()); + } + return this; } /** * * *
-         * A value against which to compare the time series.
-         * 
+ * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. * - * double threshold_value = 5; + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + *
* - * @param value The thresholdValue to set. - * @return This builder for chaining. + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public Builder setThresholdValue(double value) { - - thresholdValue_ = value; - bitField0_ |= 0x00000020; - onChanged(); + public Builder addAggregations( + int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + aggregations_.add(index, builderForValue.build()); + onChanged(); + } else { + aggregationsBuilder_.addMessage(index, builderForValue.build()); + } return this; } /** * * *
-         * A value against which to compare the time series.
-         * 
+ * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. * - * double threshold_value = 5; + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + *
* - * @return This builder for chaining. + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public Builder clearThresholdValue() { - bitField0_ = (bitField0_ & ~0x00000020); - thresholdValue_ = 0D; - onChanged(); + public Builder addAllAggregations( + java.lang.Iterable values) { + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, aggregations_); + onChanged(); + } else { + aggregationsBuilder_.addAllMessages(values); + } return this; } - - private com.google.protobuf.Duration duration_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - durationBuilder_; /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
-         * 
+ * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. * - * .google.protobuf.Duration duration = 6; + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + *
* - * @return Whether the duration field is set. + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public boolean hasDuration() { - return ((bitField0_ & 0x00000040) != 0); + public Builder clearAggregations() { + if (aggregationsBuilder_ == null) { + aggregations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + aggregationsBuilder_.clear(); + } + return this; } /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
-         * 
+ * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. * - * .google.protobuf.Duration duration = 6; + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + *
* - * @return The duration. + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public com.google.protobuf.Duration getDuration() { - if (durationBuilder_ == null) { - return duration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : duration_; + public Builder removeAggregations(int index) { + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + aggregations_.remove(index); + onChanged(); } else { - return durationBuilder_.getMessage(); + aggregationsBuilder_.remove(index); } + return this; } /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * .google.protobuf.Duration duration = 6; + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public Builder setDuration(com.google.protobuf.Duration value) { - if (durationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - duration_ = value; - } else { - durationBuilder_.setMessage(value); - } - bitField0_ |= 0x00000040; - onChanged(); - return this; + public com.google.monitoring.v3.Aggregation.Builder getAggregationsBuilder(int index) { + return getAggregationsFieldBuilder().getBuilder(index); } /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * .google.protobuf.Duration duration = 6; + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { - if (durationBuilder_ == null) { - duration_ = builderForValue.build(); + public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(int index) { + if (aggregationsBuilder_ == null) { + return aggregations_.get(index); } else { - durationBuilder_.setMessage(builderForValue.build()); + return aggregationsBuilder_.getMessageOrBuilder(index); } - bitField0_ |= 0x00000040; - onChanged(); - return this; } /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * .google.protobuf.Duration duration = 6; + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public Builder mergeDuration(com.google.protobuf.Duration value) { - if (durationBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0) - && duration_ != null - && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { - getDurationBuilder().mergeFrom(value); - } else { - duration_ = value; - } + public java.util.List + getAggregationsOrBuilderList() { + if (aggregationsBuilder_ != null) { + return aggregationsBuilder_.getMessageOrBuilderList(); } else { - durationBuilder_.mergeFrom(value); + return java.util.Collections.unmodifiableList(aggregations_); } - bitField0_ |= 0x00000040; - onChanged(); - return this; } /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * .google.protobuf.Duration duration = 6; + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public Builder clearDuration() { - bitField0_ = (bitField0_ & ~0x00000040); - duration_ = null; - if (durationBuilder_ != null) { - durationBuilder_.dispose(); - durationBuilder_ = null; - } - onChanged(); - return this; + public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder() { + return getAggregationsFieldBuilder() + .addBuilder(com.google.monitoring.v3.Aggregation.getDefaultInstance()); } /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * .google.protobuf.Duration duration = 6; + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public com.google.protobuf.Duration.Builder getDurationBuilder() { - bitField0_ |= 0x00000040; - onChanged(); - return getDurationFieldBuilder().getBuilder(); + public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder(int index) { + return getAggregationsFieldBuilder() + .addBuilder(index, com.google.monitoring.v3.Aggregation.getDefaultInstance()); } /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
          * 
* - * .google.protobuf.Duration duration = 6; + * repeated .google.monitoring.v3.Aggregation aggregations = 8; */ - public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { - if (durationBuilder_ != null) { - return durationBuilder_.getMessageOrBuilder(); - } else { - return duration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : duration_; + public java.util.List + getAggregationsBuilderList() { + return getAggregationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder> + getAggregationsFieldBuilder() { + if (aggregationsBuilder_ == null) { + aggregationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder>( + aggregations_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + aggregations_ = null; } + return aggregationsBuilder_; } + + private java.lang.Object denominatorFilter_ = ""; /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies a time series that should be used as the denominator of a
+         * ratio that will be compared with the threshold. If a
+         * `denominator_filter` is specified, the time series specified by the
+         * `filter` field will be used as the numerator.
+         *
+         * The filter must specify the metric type and optionally may contain
+         * restrictions on resource type, resource labels, and metric labels.
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * .google.protobuf.Duration duration = 6; + * string denominator_filter = 9; + * + * @return The denominatorFilter. */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getDurationFieldBuilder() { - if (durationBuilder_ == null) { - durationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getDuration(), getParentForChildren(), isClean()); - duration_ = null; + public java.lang.String getDenominatorFilter() { + java.lang.Object ref = denominatorFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + denominatorFilter_ = s; + return s; + } else { + return (java.lang.String) ref; } - return durationBuilder_; } - - private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.Trigger, - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> - triggerBuilder_; /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies a time series that should be used as the denominator of a
+         * ratio that will be compared with the threshold. If a
+         * `denominator_filter` is specified, the time series specified by the
+         * `filter` field will be used as the numerator.
+         *
+         * The filter must specify the metric type and optionally may contain
+         * restrictions on resource type, resource labels, and metric labels.
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * string denominator_filter = 9; * - * @return Whether the trigger field is set. + * @return The bytes for denominatorFilter. */ - public boolean hasTrigger() { - return ((bitField0_ & 0x00000080) != 0); + public com.google.protobuf.ByteString getDenominatorFilterBytes() { + java.lang.Object ref = denominatorFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + denominatorFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies a time series that should be used as the denominator of a
+         * ratio that will be compared with the threshold. If a
+         * `denominator_filter` is specified, the time series specified by the
+         * `filter` field will be used as the numerator.
+         *
+         * The filter must specify the metric type and optionally may contain
+         * restrictions on resource type, resource labels, and metric labels.
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * string denominator_filter = 9; * - * @return The trigger. + * @param value The denominatorFilter to set. + * @return This builder for chaining. */ - public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { - if (triggerBuilder_ == null) { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; - } else { - return triggerBuilder_.getMessage(); + public Builder setDenominatorFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } + denominatorFilter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies a time series that should be used as the denominator of a
+         * ratio that will be compared with the threshold. If a
+         * `denominator_filter` is specified, the time series specified by the
+         * `filter` field will be used as the numerator.
+         *
+         * The filter must specify the metric type and optionally may contain
+         * restrictions on resource type, resource labels, and metric labels.
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * string denominator_filter = 9; + * + * @return This builder for chaining. */ - public Builder setTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { - if (triggerBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - trigger_ = value; - } else { - triggerBuilder_.setMessage(value); - } - bitField0_ |= 0x00000080; + public Builder clearDenominatorFilter() { + denominatorFilter_ = getDefaultInstance().getDenominatorFilter(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } @@ -6226,791 +6565,2116 @@ public Builder setTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies a time series that should be used as the denominator of a
+         * ratio that will be compared with the threshold. If a
+         * `denominator_filter` is specified, the time series specified by the
+         * `filter` field will be used as the numerator.
+         *
+         * The filter must specify the metric type and optionally may contain
+         * restrictions on resource type, resource labels, and metric labels.
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * string denominator_filter = 9; + * + * @param value The bytes for denominatorFilter to set. + * @return This builder for chaining. */ - public Builder setTrigger( - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder builderForValue) { - if (triggerBuilder_ == null) { - trigger_ = builderForValue.build(); - } else { - triggerBuilder_.setMessage(builderForValue.build()); + public Builder setDenominatorFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } - bitField0_ |= 0x00000080; + checkByteStringIsUtf8(value); + denominatorFilter_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + + private java.util.List denominatorAggregations_ = + java.util.Collections.emptyList(); + + private void ensureDenominatorAggregationsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + denominatorAggregations_ = + new java.util.ArrayList( + denominatorAggregations_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder> + denominatorAggregationsBuilder_; + /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; */ - public Builder mergeTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { - if (triggerBuilder_ == null) { - if (((bitField0_ & 0x00000080) != 0) - && trigger_ != null - && trigger_ - != com.google.monitoring.v3.AlertPolicy.Condition.Trigger - .getDefaultInstance()) { - getTriggerBuilder().mergeFrom(value); - } else { - trigger_ = value; - } + public java.util.List + getDenominatorAggregationsList() { + if (denominatorAggregationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(denominatorAggregations_); } else { - triggerBuilder_.mergeFrom(value); + return denominatorAggregationsBuilder_.getMessageList(); } - bitField0_ |= 0x00000080; - onChanged(); - return this; } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; */ - public Builder clearTrigger() { - bitField0_ = (bitField0_ & ~0x00000080); - trigger_ = null; - if (triggerBuilder_ != null) { - triggerBuilder_.dispose(); - triggerBuilder_ = null; + public int getDenominatorAggregationsCount() { + if (denominatorAggregationsBuilder_ == null) { + return denominatorAggregations_.size(); + } else { + return denominatorAggregationsBuilder_.getCount(); } - onChanged(); - return this; } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
-         * 
+ * Specifies the alignment of data points in individual time series + * selected by `denominatorFilter` as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). * - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * When computing ratios, the `aggregations` and + * `denominator_aggregations` fields must use the same alignment period + * and produce time series that have the same periodicity and labels. + *
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; */ - public com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder getTriggerBuilder() { - bitField0_ |= 0x00000080; - onChanged(); - return getTriggerFieldBuilder().getBuilder(); + public com.google.monitoring.v3.Aggregation getDenominatorAggregations(int index) { + if (denominatorAggregationsBuilder_ == null) { + return denominatorAggregations_.get(index); + } else { + return denominatorAggregationsBuilder_.getMessage(index); + } } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; */ - public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder - getTriggerOrBuilder() { - if (triggerBuilder_ != null) { - return triggerBuilder_.getMessageOrBuilder(); + public Builder setDenominatorAggregations( + int index, com.google.monitoring.v3.Aggregation value) { + if (denominatorAggregationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDenominatorAggregationsIsMutable(); + denominatorAggregations_.set(index, value); + onChanged(); } else { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; + denominatorAggregationsBuilder_.setMessage(index, value); } + return this; } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.Trigger, - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> - getTriggerFieldBuilder() { - if (triggerBuilder_ == null) { - triggerBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.Trigger, - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder>( - getTrigger(), getParentForChildren(), isClean()); - trigger_ = null; + public Builder setDenominatorAggregations( + int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { + if (denominatorAggregationsBuilder_ == null) { + ensureDenominatorAggregationsIsMutable(); + denominatorAggregations_.set(index, builderForValue.build()); + onChanged(); + } else { + denominatorAggregationsBuilder_.setMessage(index, builderForValue.build()); } - return triggerBuilder_; + return this; } - - private int evaluationMissingData_ = 0; /** * * *
-         * A condition control that determines how metric-threshold conditions
-         * are evaluated when data stops arriving.
-         * 
+ * Specifies the alignment of data points in individual time series + * selected by `denominatorFilter` as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). * - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - * + * When computing ratios, the `aggregations` and + * `denominator_aggregations` fields must use the same alignment period + * and produce time series that have the same periodicity and labels. + *
* - * @return The enum numeric value on the wire for evaluationMissingData. + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; */ - @java.lang.Override - public int getEvaluationMissingDataValue() { - return evaluationMissingData_; + public Builder addDenominatorAggregations(com.google.monitoring.v3.Aggregation value) { + if (denominatorAggregationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDenominatorAggregationsIsMutable(); + denominatorAggregations_.add(value); + onChanged(); + } else { + denominatorAggregationsBuilder_.addMessage(value); + } + return this; } /** * * *
-         * A condition control that determines how metric-threshold conditions
-         * are evaluated when data stops arriving.
-         * 
+ * Specifies the alignment of data points in individual time series + * selected by `denominatorFilter` as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). * - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - * + * When computing ratios, the `aggregations` and + * `denominator_aggregations` fields must use the same alignment period + * and produce time series that have the same periodicity and labels. + *
* - * @param value The enum numeric value on the wire for evaluationMissingData to set. - * @return This builder for chaining. + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; */ - public Builder setEvaluationMissingDataValue(int value) { - evaluationMissingData_ = value; - bitField0_ |= 0x00000100; - onChanged(); + public Builder addDenominatorAggregations( + int index, com.google.monitoring.v3.Aggregation value) { + if (denominatorAggregationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDenominatorAggregationsIsMutable(); + denominatorAggregations_.add(index, value); + onChanged(); + } else { + denominatorAggregationsBuilder_.addMessage(index, value); + } return this; } /** * * *
-         * A condition control that determines how metric-threshold conditions
-         * are evaluated when data stops arriving.
-         * 
+ * Specifies the alignment of data points in individual time series + * selected by `denominatorFilter` as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). * - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - * + * When computing ratios, the `aggregations` and + * `denominator_aggregations` fields must use the same alignment period + * and produce time series that have the same periodicity and labels. + *
* - * @return The evaluationMissingData. + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData - getEvaluationMissingData() { - com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData result = - com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.forNumber( - evaluationMissingData_); - return result == null - ? com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.UNRECOGNIZED - : result; + public Builder addDenominatorAggregations( + com.google.monitoring.v3.Aggregation.Builder builderForValue) { + if (denominatorAggregationsBuilder_ == null) { + ensureDenominatorAggregationsIsMutable(); + denominatorAggregations_.add(builderForValue.build()); + onChanged(); + } else { + denominatorAggregationsBuilder_.addMessage(builderForValue.build()); + } + return this; } /** * * *
-         * A condition control that determines how metric-threshold conditions
-         * are evaluated when data stops arriving.
-         * 
+ * Specifies the alignment of data points in individual time series + * selected by `denominatorFilter` as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). * - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - * + * When computing ratios, the `aggregations` and + * `denominator_aggregations` fields must use the same alignment period + * and produce time series that have the same periodicity and labels. + *
* - * @param value The evaluationMissingData to set. - * @return This builder for chaining. + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; */ - public Builder setEvaluationMissingData( - com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData value) { - if (value == null) { - throw new NullPointerException(); + public Builder addDenominatorAggregations( + int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { + if (denominatorAggregationsBuilder_ == null) { + ensureDenominatorAggregationsIsMutable(); + denominatorAggregations_.add(index, builderForValue.build()); + onChanged(); + } else { + denominatorAggregationsBuilder_.addMessage(index, builderForValue.build()); } - bitField0_ |= 0x00000100; - evaluationMissingData_ = value.getNumber(); - onChanged(); return this; } /** * * *
-         * A condition control that determines how metric-threshold conditions
-         * are evaluated when data stops arriving.
-         * 
+ * Specifies the alignment of data points in individual time series + * selected by `denominatorFilter` as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). * - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - * + * When computing ratios, the `aggregations` and + * `denominator_aggregations` fields must use the same alignment period + * and produce time series that have the same periodicity and labels. + *
* - * @return This builder for chaining. + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; */ - public Builder clearEvaluationMissingData() { - bitField0_ = (bitField0_ & ~0x00000100); - evaluationMissingData_ = 0; - onChanged(); + public Builder addAllDenominatorAggregations( + java.lang.Iterable values) { + if (denominatorAggregationsBuilder_ == null) { + ensureDenominatorAggregationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, denominatorAggregations_); + onChanged(); + } else { + denominatorAggregationsBuilder_.addAllMessages(values); + } return this; } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + /** + * + * + *
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + public Builder clearDenominatorAggregations() { + if (denominatorAggregationsBuilder_ == null) { + denominatorAggregations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + denominatorAggregationsBuilder_.clear(); + } + return this; } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + public Builder removeDenominatorAggregations(int index) { + if (denominatorAggregationsBuilder_ == null) { + ensureDenominatorAggregationsIsMutable(); + denominatorAggregations_.remove(index); + onChanged(); + } else { + denominatorAggregationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + public com.google.monitoring.v3.Aggregation.Builder getDenominatorAggregationsBuilder( + int index) { + return getDenominatorAggregationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + public com.google.monitoring.v3.AggregationOrBuilder getDenominatorAggregationsOrBuilder( + int index) { + if (denominatorAggregationsBuilder_ == null) { + return denominatorAggregations_.get(index); + } else { + return denominatorAggregationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + public java.util.List + getDenominatorAggregationsOrBuilderList() { + if (denominatorAggregationsBuilder_ != null) { + return denominatorAggregationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(denominatorAggregations_); + } + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + public com.google.monitoring.v3.Aggregation.Builder addDenominatorAggregationsBuilder() { + return getDenominatorAggregationsFieldBuilder() + .addBuilder(com.google.monitoring.v3.Aggregation.getDefaultInstance()); + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + public com.google.monitoring.v3.Aggregation.Builder addDenominatorAggregationsBuilder( + int index) { + return getDenominatorAggregationsFieldBuilder() + .addBuilder(index, com.google.monitoring.v3.Aggregation.getDefaultInstance()); + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series
+         * selected by `denominatorFilter` as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources).
+         *
+         * When computing ratios, the `aggregations` and
+         * `denominator_aggregations` fields must use the same alignment period
+         * and produce time series that have the same periodicity and labels.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + public java.util.List + getDenominatorAggregationsBuilderList() { + return getDenominatorAggregationsFieldBuilder().getBuilderList(); } - // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) - } - - // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) - private static final com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold(); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - getDefaultInstance() { - return DEFAULT_INSTANCE; - } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder> + getDenominatorAggregationsFieldBuilder() { + if (denominatorAggregationsBuilder_ == null) { + denominatorAggregationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder>( + denominatorAggregations_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + denominatorAggregations_ = null; + } + return denominatorAggregationsBuilder_; + } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MetricThreshold parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); + private com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + forecastOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .Builder, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .ForecastOptionsOrBuilder> + forecastOptionsBuilder_; + /** + * + * + *
+         * When this field is present, the `MetricThreshold` condition forecasts
+         * whether the time series is predicted to violate the threshold within
+         * the `forecast_horizon`. When this field is not set, the
+         * `MetricThreshold` tests the current value of the timeseries against the
+         * threshold.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + * + * @return Whether the forecastOptions field is set. + */ + public boolean hasForecastOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+         * When this field is present, the `MetricThreshold` condition forecasts
+         * whether the time series is predicted to violate the threshold within
+         * the `forecast_horizon`. When this field is not set, the
+         * `MetricThreshold` tests the current value of the timeseries against the
+         * threshold.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + * + * @return The forecastOptions. + */ + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + getForecastOptions() { + if (forecastOptionsBuilder_ == null) { + return forecastOptions_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .getDefaultInstance() + : forecastOptions_; + } else { + return forecastOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+         * When this field is present, the `MetricThreshold` condition forecasts
+         * whether the time series is predicted to violate the threshold within
+         * the `forecast_horizon`. When this field is not set, the
+         * `MetricThreshold` tests the current value of the timeseries against the
+         * threshold.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + */ + public Builder setForecastOptions( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions value) { + if (forecastOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface MetricAbsenceOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-       * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-       * identifies which time series should be compared with the threshold.
-       *
-       * The filter is similar to the one that is specified in the
-       * [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-       * (that call is useful to verify the time series that will be retrieved /
-       * processed). The filter must specify the metric type and the resource
-       * type. Optionally, it can specify resource labels and metric labels.
-       * This field must not exceed 2048 Unicode characters in length.
-       * 
- * - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The filter. - */ - java.lang.String getFilter(); - /** - * - * - *
-       * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-       * identifies which time series should be compared with the threshold.
-       *
-       * The filter is similar to the one that is specified in the
-       * [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-       * (that call is useful to verify the time series that will be retrieved /
-       * processed). The filter must specify the metric type and the resource
-       * type. Optionally, it can specify resource labels and metric labels.
-       * This field must not exceed 2048 Unicode characters in length.
-       * 
- * - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for filter. - */ - com.google.protobuf.ByteString getFilterBytes(); + forecastOptions_ = value; + } else { + forecastOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * When this field is present, the `MetricThreshold` condition forecasts
+         * whether the time series is predicted to violate the threshold within
+         * the `forecast_horizon`. When this field is not set, the
+         * `MetricThreshold` tests the current value of the timeseries against the
+         * threshold.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + */ + public Builder setForecastOptions( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions.Builder + builderForValue) { + if (forecastOptionsBuilder_ == null) { + forecastOptions_ = builderForValue.build(); + } else { + forecastOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * When this field is present, the `MetricThreshold` condition forecasts
+         * whether the time series is predicted to violate the threshold within
+         * the `forecast_horizon`. When this field is not set, the
+         * `MetricThreshold` tests the current value of the timeseries against the
+         * threshold.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + */ + public Builder mergeForecastOptions( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions value) { + if (forecastOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && forecastOptions_ != null + && forecastOptions_ + != com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .ForecastOptions.getDefaultInstance()) { + getForecastOptionsBuilder().mergeFrom(value); + } else { + forecastOptions_ = value; + } + } else { + forecastOptionsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * When this field is present, the `MetricThreshold` condition forecasts
+         * whether the time series is predicted to violate the threshold within
+         * the `forecast_horizon`. When this field is not set, the
+         * `MetricThreshold` tests the current value of the timeseries against the
+         * threshold.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + */ + public Builder clearForecastOptions() { + bitField0_ = (bitField0_ & ~0x00000010); + forecastOptions_ = null; + if (forecastOptionsBuilder_ != null) { + forecastOptionsBuilder_.dispose(); + forecastOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * When this field is present, the `MetricThreshold` condition forecasts
+         * whether the time series is predicted to violate the threshold within
+         * the `forecast_horizon`. When this field is not set, the
+         * `MetricThreshold` tests the current value of the timeseries against the
+         * threshold.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + */ + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .Builder + getForecastOptionsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getForecastOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * When this field is present, the `MetricThreshold` condition forecasts
+         * whether the time series is predicted to violate the threshold within
+         * the `forecast_horizon`. When this field is not set, the
+         * `MetricThreshold` tests the current value of the timeseries against the
+         * threshold.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + */ + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .ForecastOptionsOrBuilder + getForecastOptionsOrBuilder() { + if (forecastOptionsBuilder_ != null) { + return forecastOptionsBuilder_.getMessageOrBuilder(); + } else { + return forecastOptions_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .getDefaultInstance() + : forecastOptions_; + } + } + /** + * + * + *
+         * When this field is present, the `MetricThreshold` condition forecasts
+         * whether the time series is predicted to violate the threshold within
+         * the `forecast_horizon`. When this field is not set, the
+         * `MetricThreshold` tests the current value of the timeseries against the
+         * threshold.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .Builder, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .ForecastOptionsOrBuilder> + getForecastOptionsFieldBuilder() { + if (forecastOptionsBuilder_ == null) { + forecastOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + .Builder, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .ForecastOptionsOrBuilder>( + getForecastOptions(), getParentForChildren(), isClean()); + forecastOptions_ = null; + } + return forecastOptionsBuilder_; + } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - java.util.List getAggregationsList(); - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - com.google.monitoring.v3.Aggregation getAggregations(int index); - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - int getAggregationsCount(); - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - java.util.List - getAggregationsOrBuilderList(); - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(int index); + private int comparison_ = 0; + /** + * + * + *
+         * The comparison to apply between the time series (indicated by `filter`
+         * and `aggregation`) and the threshold (indicated by `threshold_value`).
+         * The comparison is applied on each time series, with the time series
+         * on the left-hand side and the threshold on the right-hand side.
+         *
+         * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+         * 
+ * + * .google.monitoring.v3.ComparisonType comparison = 4; + * + * @return The enum numeric value on the wire for comparison. + */ + @java.lang.Override + public int getComparisonValue() { + return comparison_; + } + /** + * + * + *
+         * The comparison to apply between the time series (indicated by `filter`
+         * and `aggregation`) and the threshold (indicated by `threshold_value`).
+         * The comparison is applied on each time series, with the time series
+         * on the left-hand side and the threshold on the right-hand side.
+         *
+         * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+         * 
+ * + * .google.monitoring.v3.ComparisonType comparison = 4; + * + * @param value The enum numeric value on the wire for comparison to set. + * @return This builder for chaining. + */ + public Builder setComparisonValue(int value) { + comparison_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+         * The comparison to apply between the time series (indicated by `filter`
+         * and `aggregation`) and the threshold (indicated by `threshold_value`).
+         * The comparison is applied on each time series, with the time series
+         * on the left-hand side and the threshold on the right-hand side.
+         *
+         * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+         * 
+ * + * .google.monitoring.v3.ComparisonType comparison = 4; + * + * @return The comparison. + */ + @java.lang.Override + public com.google.monitoring.v3.ComparisonType getComparison() { + com.google.monitoring.v3.ComparisonType result = + com.google.monitoring.v3.ComparisonType.forNumber(comparison_); + return result == null ? com.google.monitoring.v3.ComparisonType.UNRECOGNIZED : result; + } + /** + * + * + *
+         * The comparison to apply between the time series (indicated by `filter`
+         * and `aggregation`) and the threshold (indicated by `threshold_value`).
+         * The comparison is applied on each time series, with the time series
+         * on the left-hand side and the threshold on the right-hand side.
+         *
+         * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+         * 
+ * + * .google.monitoring.v3.ComparisonType comparison = 4; + * + * @param value The comparison to set. + * @return This builder for chaining. + */ + public Builder setComparison(com.google.monitoring.v3.ComparisonType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + comparison_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * The comparison to apply between the time series (indicated by `filter`
+         * and `aggregation`) and the threshold (indicated by `threshold_value`).
+         * The comparison is applied on each time series, with the time series
+         * on the left-hand side and the threshold on the right-hand side.
+         *
+         * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
+         * 
+ * + * .google.monitoring.v3.ComparisonType comparison = 4; + * + * @return This builder for chaining. + */ + public Builder clearComparison() { + bitField0_ = (bitField0_ & ~0x00000020); + comparison_ = 0; + onChanged(); + return this; + } - /** - * - * - *
-       * The amount of time that a time series must fail to report new
-       * data to be considered failing. The minimum value of this field
-       * is 120 seconds. Larger values that are a multiple of a
-       * minute--for example, 240 or 300 seconds--are supported.
-       * If an invalid value is given, an
-       * error will be returned. The `Duration.nanos` field is
-       * ignored.
-       * 
- * - * .google.protobuf.Duration duration = 2; - * - * @return Whether the duration field is set. - */ - boolean hasDuration(); - /** - * - * - *
-       * The amount of time that a time series must fail to report new
-       * data to be considered failing. The minimum value of this field
-       * is 120 seconds. Larger values that are a multiple of a
-       * minute--for example, 240 or 300 seconds--are supported.
-       * If an invalid value is given, an
-       * error will be returned. The `Duration.nanos` field is
-       * ignored.
-       * 
- * - * .google.protobuf.Duration duration = 2; - * - * @return The duration. - */ - com.google.protobuf.Duration getDuration(); - /** - * - * - *
-       * The amount of time that a time series must fail to report new
-       * data to be considered failing. The minimum value of this field
-       * is 120 seconds. Larger values that are a multiple of a
-       * minute--for example, 240 or 300 seconds--are supported.
-       * If an invalid value is given, an
-       * error will be returned. The `Duration.nanos` field is
-       * ignored.
-       * 
- * - * .google.protobuf.Duration duration = 2; - */ - com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); + private double thresholdValue_; + /** + * + * + *
+         * A value against which to compare the time series.
+         * 
+ * + * double threshold_value = 5; + * + * @return The thresholdValue. + */ + @java.lang.Override + public double getThresholdValue() { + return thresholdValue_; + } + /** + * + * + *
+         * A value against which to compare the time series.
+         * 
+ * + * double threshold_value = 5; + * + * @param value The thresholdValue to set. + * @return This builder for chaining. + */ + public Builder setThresholdValue(double value) { - /** - * - * - *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; - * - * @return Whether the trigger field is set. - */ - boolean hasTrigger(); - /** - * - * - *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; - * - * @return The trigger. - */ - com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger(); - /** - * - * - *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; - */ - com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder(); - } - /** - * - * - *
-     * A condition type that checks that monitored resources
-     * are reporting data. The configuration defines a metric and
-     * a set of monitored resources. The predicate is considered in violation
-     * when a time series for the specified metric of a monitored
-     * resource does not include any data in the specified `duration`.
-     * 
- * - * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} - */ - public static final class MetricAbsence extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) - MetricAbsenceOrBuilder { - private static final long serialVersionUID = 0L; - // Use MetricAbsence.newBuilder() to construct. - private MetricAbsence(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private MetricAbsence() { - filter_ = ""; - aggregations_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MetricAbsence(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.class, - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder.class); - } - - public static final int FILTER_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object filter_ = ""; - /** - * - * - *
-       * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-       * identifies which time series should be compared with the threshold.
-       *
-       * The filter is similar to the one that is specified in the
-       * [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-       * (that call is useful to verify the time series that will be retrieved /
-       * processed). The filter must specify the metric type and the resource
-       * type. Optionally, it can specify resource labels and metric labels.
-       * This field must not exceed 2048 Unicode characters in length.
-       * 
- * - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The filter. - */ - @java.lang.Override - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; + thresholdValue_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; } - } - /** - * - * - *
-       * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-       * identifies which time series should be compared with the threshold.
-       *
-       * The filter is similar to the one that is specified in the
-       * [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-       * (that call is useful to verify the time series that will be retrieved /
-       * processed). The filter must specify the metric type and the resource
-       * type. Optionally, it can specify resource labels and metric labels.
-       * This field must not exceed 2048 Unicode characters in length.
-       * 
- * - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for filter. - */ - @java.lang.Override - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + /** + * + * + *
+         * A value against which to compare the time series.
+         * 
+ * + * double threshold_value = 5; + * + * @return This builder for chaining. + */ + public Builder clearThresholdValue() { + bitField0_ = (bitField0_ & ~0x00000040); + thresholdValue_ = 0D; + onChanged(); + return this; } - } - public static final int AGGREGATIONS_FIELD_NUMBER = 5; - - @SuppressWarnings("serial") - private java.util.List aggregations_; - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - @java.lang.Override - public java.util.List getAggregationsList() { - return aggregations_; - } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - @java.lang.Override - public java.util.List - getAggregationsOrBuilderList() { - return aggregations_; - } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - @java.lang.Override - public int getAggregationsCount() { - return aggregations_.size(); - } - /** - * - * - *
-       * Specifies the alignment of data points in individual time series as
-       * well as how to combine the retrieved time series together (such as
-       * when aggregating multiple streams on each resource to a single
-       * stream for each resource or when aggregating streams across all
-       * members of a group of resources). Multiple aggregations
-       * are applied in the order specified.
-       *
-       * This field is similar to the one in the [`ListTimeSeries`
-       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-       * It is advisable to use the `ListTimeSeries` method when debugging this
-       * field.
-       * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; + private com.google.protobuf.Duration duration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + durationBuilder_; + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 6; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 6; + * + * @return The duration. + */ + public com.google.protobuf.Duration getDuration() { + if (durationBuilder_ == null) { + return duration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : duration_; + } else { + return durationBuilder_.getMessage(); + } + } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + } else { + durationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && duration_ != null + && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDurationBuilder().mergeFrom(value); + } else { + duration_ = value; + } + } else { + durationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public Builder clearDuration() { + bitField0_ = (bitField0_ & ~0x00000080); + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : duration_; + } + } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDurationFieldBuilder() { + if (durationBuilder_ == null) { + durationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDuration(), getParentForChildren(), isClean()); + duration_ = null; + } + return durationBuilder_; + } + + private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.Trigger, + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> + triggerBuilder_; + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * + * @return Whether the trigger field is set. + */ + public boolean hasTrigger() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * + * @return The trigger. + */ + public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { + if (triggerBuilder_ == null) { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; + } else { + return triggerBuilder_.getMessage(); + } + } + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + */ + public Builder setTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { + if (triggerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + trigger_ = value; + } else { + triggerBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + */ + public Builder setTrigger( + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder builderForValue) { + if (triggerBuilder_ == null) { + trigger_ = builderForValue.build(); + } else { + triggerBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + */ + public Builder mergeTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { + if (triggerBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && trigger_ != null + && trigger_ + != com.google.monitoring.v3.AlertPolicy.Condition.Trigger + .getDefaultInstance()) { + getTriggerBuilder().mergeFrom(value); + } else { + trigger_ = value; + } + } else { + triggerBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + */ + public Builder clearTrigger() { + bitField0_ = (bitField0_ & ~0x00000100); + trigger_ = null; + if (triggerBuilder_ != null) { + triggerBuilder_.dispose(); + triggerBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + */ + public com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder getTriggerBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getTriggerFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + */ + public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder + getTriggerOrBuilder() { + if (triggerBuilder_ != null) { + return triggerBuilder_.getMessageOrBuilder(); + } else { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; + } + } + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.Trigger, + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> + getTriggerFieldBuilder() { + if (triggerBuilder_ == null) { + triggerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.Trigger, + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder>( + getTrigger(), getParentForChildren(), isClean()); + trigger_ = null; + } + return triggerBuilder_; + } + + private int evaluationMissingData_ = 0; + /** + * + * + *
+         * A condition control that determines how metric-threshold conditions
+         * are evaluated when data stops arriving.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + * + * + * @return The enum numeric value on the wire for evaluationMissingData. + */ + @java.lang.Override + public int getEvaluationMissingDataValue() { + return evaluationMissingData_; + } + /** + * + * + *
+         * A condition control that determines how metric-threshold conditions
+         * are evaluated when data stops arriving.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + * + * + * @param value The enum numeric value on the wire for evaluationMissingData to set. + * @return This builder for chaining. + */ + public Builder setEvaluationMissingDataValue(int value) { + evaluationMissingData_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+         * A condition control that determines how metric-threshold conditions
+         * are evaluated when data stops arriving.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + * + * + * @return The evaluationMissingData. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData + getEvaluationMissingData() { + com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData result = + com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.forNumber( + evaluationMissingData_); + return result == null + ? com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.UNRECOGNIZED + : result; + } + /** + * + * + *
+         * A condition control that determines how metric-threshold conditions
+         * are evaluated when data stops arriving.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + * + * + * @param value The evaluationMissingData to set. + * @return This builder for chaining. + */ + public Builder setEvaluationMissingData( + com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + evaluationMissingData_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * A condition control that determines how metric-threshold conditions
+         * are evaluated when data stops arriving.
+         * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + * + * + * @return This builder for chaining. + */ + public Builder clearEvaluationMissingData() { + bitField0_ = (bitField0_ & ~0x00000200); + evaluationMissingData_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) + private static final com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold(); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MetricThreshold parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MetricAbsenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Required. A
+       * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+       * identifies which time series should be compared with the threshold.
+       *
+       * The filter is similar to the one that is specified in the
+       * [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+       * (that call is useful to verify the time series that will be retrieved /
+       * processed). The filter must specify the metric type and the resource
+       * type. Optionally, it can specify resource labels and metric labels.
+       * This field must not exceed 2048 Unicode characters in length.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+       * Required. A
+       * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+       * identifies which time series should be compared with the threshold.
+       *
+       * The filter is similar to the one that is specified in the
+       * [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+       * (that call is useful to verify the time series that will be retrieved /
+       * processed). The filter must specify the metric type and the resource
+       * type. Optionally, it can specify resource labels and metric labels.
+       * This field must not exceed 2048 Unicode characters in length.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + java.util.List getAggregationsList(); + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + com.google.monitoring.v3.Aggregation getAggregations(int index); + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + int getAggregationsCount(); + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + java.util.List + getAggregationsOrBuilderList(); + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(int index); + + /** + * + * + *
+       * The amount of time that a time series must fail to report new
+       * data to be considered failing. The minimum value of this field
+       * is 120 seconds. Larger values that are a multiple of a
+       * minute--for example, 240 or 300 seconds--are supported.
+       * If an invalid value is given, an
+       * error will be returned. The `Duration.nanos` field is
+       * ignored.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + boolean hasDuration(); + /** + * + * + *
+       * The amount of time that a time series must fail to report new
+       * data to be considered failing. The minimum value of this field
+       * is 120 seconds. Larger values that are a multiple of a
+       * minute--for example, 240 or 300 seconds--are supported.
+       * If an invalid value is given, an
+       * error will be returned. The `Duration.nanos` field is
+       * ignored.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + /** + * + * + *
+       * The amount of time that a time series must fail to report new
+       * data to be considered failing. The minimum value of this field
+       * is 120 seconds. Larger values that are a multiple of a
+       * minute--for example, 240 or 300 seconds--are supported.
+       * If an invalid value is given, an
+       * error will be returned. The `Duration.nanos` field is
+       * ignored.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); + + /** + * + * + *
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * + * @return Whether the trigger field is set. + */ + boolean hasTrigger(); + /** + * + * + *
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * + * @return The trigger. + */ + com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger(); + /** + * + * + *
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder(); + } + /** + * + * + *
+     * A condition type that checks that monitored resources
+     * are reporting data. The configuration defines a metric and
+     * a set of monitored resources. The predicate is considered in violation
+     * when a time series for the specified metric of a monitored
+     * resource does not include any data in the specified `duration`.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} + */ + public static final class MetricAbsence extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) + MetricAbsenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use MetricAbsence.newBuilder() to construct. + private MetricAbsence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MetricAbsence() { + filter_ = ""; + aggregations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MetricAbsence(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.class, + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder.class); + } + + public static final int FILTER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+       * Required. A
+       * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+       * identifies which time series should be compared with the threshold.
+       *
+       * The filter is similar to the one that is specified in the
+       * [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+       * (that call is useful to verify the time series that will be retrieved /
+       * processed). The filter must specify the metric type and the resource
+       * type. Optionally, it can specify resource labels and metric labels.
+       * This field must not exceed 2048 Unicode characters in length.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+       * Required. A
+       * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+       * identifies which time series should be compared with the threshold.
+       *
+       * The filter is similar to the one that is specified in the
+       * [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+       * (that call is useful to verify the time series that will be retrieved /
+       * processed). The filter must specify the metric type and the resource
+       * type. Optionally, it can specify resource labels and metric labels.
+       * This field must not exceed 2048 Unicode characters in length.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AGGREGATIONS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List aggregations_; + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + @java.lang.Override + public java.util.List getAggregationsList() { + return aggregations_; + } + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + @java.lang.Override + public java.util.List + getAggregationsOrBuilderList() { + return aggregations_; + } + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + @java.lang.Override + public int getAggregationsCount() { + return aggregations_.size(); + } + /** + * + * + *
+       * Specifies the alignment of data points in individual time series as
+       * well as how to combine the retrieved time series together (such as
+       * when aggregating multiple streams on each resource to a single
+       * stream for each resource or when aggregating streams across all
+       * members of a group of resources). Multiple aggregations
+       * are applied in the order specified.
+       *
+       * This field is similar to the one in the [`ListTimeSeries`
+       * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+       * It is advisable to use the `ListTimeSeries` method when debugging this
+       * field.
+       * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; */ @java.lang.Override public com.google.monitoring.v3.Aggregation getAggregations(int index) { @@ -7055,1737 +8719,2976 @@ public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(in * ignored. *
* - * .google.protobuf.Duration duration = 2; + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return duration_ != null; + } + /** + * + * + *
+       * The amount of time that a time series must fail to report new
+       * data to be considered failing. The minimum value of this field
+       * is 120 seconds. Larger values that are a multiple of a
+       * minute--for example, 240 or 300 seconds--are supported.
+       * If an invalid value is given, an
+       * error will be returned. The `Duration.nanos` field is
+       * ignored.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + /** + * + * + *
+       * The amount of time that a time series must fail to report new
+       * data to be considered failing. The minimum value of this field
+       * is 120 seconds. Larger values that are a multiple of a
+       * minute--for example, 240 or 300 seconds--are supported.
+       * If an invalid value is given, an
+       * error will be returned. The `Duration.nanos` field is
+       * ignored.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + + public static final int TRIGGER_FIELD_NUMBER = 3; + private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; + /** + * + * + *
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * + * @return Whether the trigger field is set. + */ + @java.lang.Override + public boolean hasTrigger() { + return trigger_ != null; + } + /** + * + * + *
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; * - * @return Whether the duration field is set. + * @return The trigger. */ @java.lang.Override - public boolean hasDuration() { - return duration_ != null; + public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; } /** * * *
-       * The amount of time that a time series must fail to report new
-       * data to be considered failing. The minimum value of this field
-       * is 120 seconds. Larger values that are a multiple of a
-       * minute--for example, 240 or 300 seconds--are supported.
-       * If an invalid value is given, an
-       * error will be returned. The `Duration.nanos` field is
-       * ignored.
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`.
        * 
* - * .google.protobuf.Duration duration = 2; - * - * @return The duration. + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; */ @java.lang.Override - public com.google.protobuf.Duration getDuration() { - return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder() { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filter_); + } + if (duration_ != null) { + output.writeMessage(2, getDuration()); + } + if (trigger_ != null) { + output.writeMessage(3, getTrigger()); + } + for (int i = 0; i < aggregations_.size(); i++) { + output.writeMessage(5, aggregations_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filter_); + } + if (duration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDuration()); + } + if (trigger_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTrigger()); + } + for (int i = 0; i < aggregations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, aggregations_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence)) { + return super.equals(obj); + } + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence other = + (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) obj; + + if (!getFilter().equals(other.getFilter())) return false; + if (!getAggregationsList().equals(other.getAggregationsList())) return false; + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) return false; + } + if (hasTrigger() != other.hasTrigger()) return false; + if (hasTrigger()) { + if (!getTrigger().equals(other.getTrigger())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + if (getAggregationsCount() > 0) { + hash = (37 * hash) + AGGREGATIONS_FIELD_NUMBER; + hash = (53 * hash) + getAggregationsList().hashCode(); + } + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); + } + if (hasTrigger()) { + hash = (37 * hash) + TRIGGER_FIELD_NUMBER; + hash = (53 * hash) + getTrigger().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; } /** * * *
-       * The amount of time that a time series must fail to report new
-       * data to be considered failing. The minimum value of this field
-       * is 120 seconds. Larger values that are a multiple of a
-       * minute--for example, 240 or 300 seconds--are supported.
-       * If an invalid value is given, an
-       * error will be returned. The `Duration.nanos` field is
-       * ignored.
+       * A condition type that checks that monitored resources
+       * are reporting data. The configuration defines a metric and
+       * a set of monitored resources. The predicate is considered in violation
+       * when a time series for the specified metric of a monitored
+       * resource does not include any data in the specified `duration`.
        * 
* - * .google.protobuf.Duration duration = 2; + * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { - return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; - } + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.class, + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder.class); + } + + // Construct using com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + filter_ = ""; + if (aggregationsBuilder_ == null) { + aggregations_ = java.util.Collections.emptyList(); + } else { + aggregations_ = null; + aggregationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + trigger_ = null; + if (triggerBuilder_ != null) { + triggerBuilder_.dispose(); + triggerBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + getDefaultInstanceForType() { + return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence build() { + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence buildPartial() { + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence result = + new com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence result) { + if (aggregationsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + aggregations_ = java.util.Collections.unmodifiableList(aggregations_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.aggregations_ = aggregations_; + } else { + result.aggregations_ = aggregationsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.trigger_ = triggerBuilder_ == null ? trigger_ : triggerBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) { + return mergeFrom((com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence other) { + if (other + == com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance()) + return this; + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (aggregationsBuilder_ == null) { + if (!other.aggregations_.isEmpty()) { + if (aggregations_.isEmpty()) { + aggregations_ = other.aggregations_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAggregationsIsMutable(); + aggregations_.addAll(other.aggregations_); + } + onChanged(); + } + } else { + if (!other.aggregations_.isEmpty()) { + if (aggregationsBuilder_.isEmpty()) { + aggregationsBuilder_.dispose(); + aggregationsBuilder_ = null; + aggregations_ = other.aggregations_; + bitField0_ = (bitField0_ & ~0x00000002); + aggregationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAggregationsFieldBuilder() + : null; + } else { + aggregationsBuilder_.addAllMessages(other.aggregations_); + } + } + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + if (other.hasTrigger()) { + mergeTrigger(other.getTrigger()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: + { + input.readMessage(getTriggerFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 42: + { + com.google.monitoring.v3.Aggregation m = + input.readMessage( + com.google.monitoring.v3.Aggregation.parser(), extensionRegistry); + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + aggregations_.add(m); + } else { + aggregationsBuilder_.addMessage(m); + } + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } - public static final int TRIGGER_FIELD_NUMBER = 3; - private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; - /** - * - * - *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; - * - * @return Whether the trigger field is set. - */ - @java.lang.Override - public boolean hasTrigger() { - return trigger_ != null; - } - /** - * - * - *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; - * - * @return The trigger. - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; - } - /** - * - * - *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder() { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; - } + private int bitField0_; - private byte memoizedIsInitialized = -1; + private java.lang.Object filter_ = ""; + /** + * + * + *
+         * Required. A
+         * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies which time series should be compared with the threshold.
+         *
+         * The filter is similar to the one that is specified in the
+         * [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+         * (that call is useful to verify the time series that will be retrieved /
+         * processed). The filter must specify the metric type and the resource
+         * type. Optionally, it can specify resource labels and metric labels.
+         * This field must not exceed 2048 Unicode characters in length.
+         * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Required. A
+         * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies which time series should be compared with the threshold.
+         *
+         * The filter is similar to the one that is specified in the
+         * [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+         * (that call is useful to verify the time series that will be retrieved /
+         * processed). The filter must specify the metric type and the resource
+         * type. Optionally, it can specify resource labels and metric labels.
+         * This field must not exceed 2048 Unicode characters in length.
+         * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Required. A
+         * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies which time series should be compared with the threshold.
+         *
+         * The filter is similar to the one that is specified in the
+         * [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+         * (that call is useful to verify the time series that will be retrieved /
+         * processed). The filter must specify the metric type and the resource
+         * type. Optionally, it can specify resource labels and metric labels.
+         * This field must not exceed 2048 Unicode characters in length.
+         * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. A
+         * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies which time series should be compared with the threshold.
+         *
+         * The filter is similar to the one that is specified in the
+         * [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+         * (that call is useful to verify the time series that will be retrieved /
+         * processed). The filter must specify the metric type and the resource
+         * type. Optionally, it can specify resource labels and metric labels.
+         * This field must not exceed 2048 Unicode characters in length.
+         * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. A
+         * [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+         * identifies which time series should be compared with the threshold.
+         *
+         * The filter is similar to the one that is specified in the
+         * [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+         * (that call is useful to verify the time series that will be retrieved /
+         * processed). The filter must specify the metric type and the resource
+         * type. Optionally, it can specify resource labels and metric labels.
+         * This field must not exceed 2048 Unicode characters in length.
+         * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + private java.util.List aggregations_ = + java.util.Collections.emptyList(); - memoizedIsInitialized = 1; - return true; - } + private void ensureAggregationsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + aggregations_ = + new java.util.ArrayList(aggregations_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder> + aggregationsBuilder_; + + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public java.util.List getAggregationsList() { + if (aggregationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(aggregations_); + } else { + return aggregationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public int getAggregationsCount() { + if (aggregationsBuilder_ == null) { + return aggregations_.size(); + } else { + return aggregationsBuilder_.getCount(); + } + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public com.google.monitoring.v3.Aggregation getAggregations(int index) { + if (aggregationsBuilder_ == null) { + return aggregations_.get(index); + } else { + return aggregationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public Builder setAggregations(int index, com.google.monitoring.v3.Aggregation value) { + if (aggregationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAggregationsIsMutable(); + aggregations_.set(index, value); + onChanged(); + } else { + aggregationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public Builder setAggregations( + int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + aggregations_.set(index, builderForValue.build()); + onChanged(); + } else { + aggregationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public Builder addAggregations(com.google.monitoring.v3.Aggregation value) { + if (aggregationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAggregationsIsMutable(); + aggregations_.add(value); + onChanged(); + } else { + aggregationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public Builder addAggregations(int index, com.google.monitoring.v3.Aggregation value) { + if (aggregationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAggregationsIsMutable(); + aggregations_.add(index, value); + onChanged(); + } else { + aggregationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public Builder addAggregations( + com.google.monitoring.v3.Aggregation.Builder builderForValue) { + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + aggregations_.add(builderForValue.build()); + onChanged(); + } else { + aggregationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public Builder addAggregations( + int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + aggregations_.add(index, builderForValue.build()); + onChanged(); + } else { + aggregationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public Builder addAllAggregations( + java.lang.Iterable values) { + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, aggregations_); + onChanged(); + } else { + aggregationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public Builder clearAggregations() { + if (aggregationsBuilder_ == null) { + aggregations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + aggregationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public Builder removeAggregations(int index) { + if (aggregationsBuilder_ == null) { + ensureAggregationsIsMutable(); + aggregations_.remove(index); + onChanged(); + } else { + aggregationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public com.google.monitoring.v3.Aggregation.Builder getAggregationsBuilder(int index) { + return getAggregationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(int index) { + if (aggregationsBuilder_ == null) { + return aggregations_.get(index); + } else { + return aggregationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public java.util.List + getAggregationsOrBuilderList() { + if (aggregationsBuilder_ != null) { + return aggregationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(aggregations_); + } + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder() { + return getAggregationsFieldBuilder() + .addBuilder(com.google.monitoring.v3.Aggregation.getDefaultInstance()); + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder(int index) { + return getAggregationsFieldBuilder() + .addBuilder(index, com.google.monitoring.v3.Aggregation.getDefaultInstance()); + } + /** + * + * + *
+         * Specifies the alignment of data points in individual time series as
+         * well as how to combine the retrieved time series together (such as
+         * when aggregating multiple streams on each resource to a single
+         * stream for each resource or when aggregating streams across all
+         * members of a group of resources). Multiple aggregations
+         * are applied in the order specified.
+         *
+         * This field is similar to the one in the [`ListTimeSeries`
+         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
+         * It is advisable to use the `ListTimeSeries` method when debugging this
+         * field.
+         * 
+ * + * repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + public java.util.List + getAggregationsBuilderList() { + return getAggregationsFieldBuilder().getBuilderList(); + } - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filter_); + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder> + getAggregationsFieldBuilder() { + if (aggregationsBuilder_ == null) { + aggregationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder>( + aggregations_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + aggregations_ = null; + } + return aggregationsBuilder_; } - if (duration_ != null) { - output.writeMessage(2, getDuration()); + + private com.google.protobuf.Duration duration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + durationBuilder_; + /** + * + * + *
+         * The amount of time that a time series must fail to report new
+         * data to be considered failing. The minimum value of this field
+         * is 120 seconds. Larger values that are a multiple of a
+         * minute--for example, 240 or 300 seconds--are supported.
+         * If an invalid value is given, an
+         * error will be returned. The `Duration.nanos` field is
+         * ignored.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return ((bitField0_ & 0x00000004) != 0); } - if (trigger_ != null) { - output.writeMessage(3, getTrigger()); + /** + * + * + *
+         * The amount of time that a time series must fail to report new
+         * data to be considered failing. The minimum value of this field
+         * is 120 seconds. Larger values that are a multiple of a
+         * minute--for example, 240 or 300 seconds--are supported.
+         * If an invalid value is given, an
+         * error will be returned. The `Duration.nanos` field is
+         * ignored.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + public com.google.protobuf.Duration getDuration() { + if (durationBuilder_ == null) { + return duration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : duration_; + } else { + return durationBuilder_.getMessage(); + } } - for (int i = 0; i < aggregations_.size(); i++) { - output.writeMessage(5, aggregations_.get(i)); + /** + * + * + *
+         * The amount of time that a time series must fail to report new
+         * data to be considered failing. The minimum value of this field
+         * is 120 seconds. Larger values that are a multiple of a
+         * minute--for example, 240 or 300 seconds--are supported.
+         * If an invalid value is given, an
+         * error will be returned. The `Duration.nanos` field is
+         * ignored.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + } else { + durationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * The amount of time that a time series must fail to report new
+         * data to be considered failing. The minimum value of this field
+         * is 120 seconds. Larger values that are a multiple of a
+         * minute--for example, 240 or 300 seconds--are supported.
+         * If an invalid value is given, an
+         * error will be returned. The `Duration.nanos` field is
+         * ignored.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * The amount of time that a time series must fail to report new
+         * data to be considered failing. The minimum value of this field
+         * is 120 seconds. Larger values that are a multiple of a
+         * minute--for example, 240 or 300 seconds--are supported.
+         * If an invalid value is given, an
+         * error will be returned. The `Duration.nanos` field is
+         * ignored.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && duration_ != null + && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDurationBuilder().mergeFrom(value); + } else { + duration_ = value; + } + } else { + durationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * The amount of time that a time series must fail to report new
+         * data to be considered failing. The minimum value of this field
+         * is 120 seconds. Larger values that are a multiple of a
+         * minute--for example, 240 or 300 seconds--are supported.
+         * If an invalid value is given, an
+         * error will be returned. The `Duration.nanos` field is
+         * ignored.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder clearDuration() { + bitField0_ = (bitField0_ & ~0x00000004); + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * The amount of time that a time series must fail to report new
+         * data to be considered failing. The minimum value of this field
+         * is 120 seconds. Larger values that are a multiple of a
+         * minute--for example, 240 or 300 seconds--are supported.
+         * If an invalid value is given, an
+         * error will be returned. The `Duration.nanos` field is
+         * ignored.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * The amount of time that a time series must fail to report new
+         * data to be considered failing. The minimum value of this field
+         * is 120 seconds. Larger values that are a multiple of a
+         * minute--for example, 240 or 300 seconds--are supported.
+         * If an invalid value is given, an
+         * error will be returned. The `Duration.nanos` field is
+         * ignored.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : duration_; + } + } + /** + * + * + *
+         * The amount of time that a time series must fail to report new
+         * data to be considered failing. The minimum value of this field
+         * is 120 seconds. Larger values that are a multiple of a
+         * minute--for example, 240 or 300 seconds--are supported.
+         * If an invalid value is given, an
+         * error will be returned. The `Duration.nanos` field is
+         * ignored.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDurationFieldBuilder() { + if (durationBuilder_ == null) { + durationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDuration(), getParentForChildren(), isClean()); + duration_ = null; + } + return durationBuilder_; + } + + private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.Trigger, + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> + triggerBuilder_; + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * + * @return Whether the trigger field is set. + */ + public boolean hasTrigger() { + return ((bitField0_ & 0x00000008) != 0); } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filter_); + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * + * @return The trigger. + */ + public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { + if (triggerBuilder_ == null) { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; + } else { + return triggerBuilder_.getMessage(); + } } - if (duration_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDuration()); + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + public Builder setTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { + if (triggerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + trigger_ = value; + } else { + triggerBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; } - if (trigger_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTrigger()); + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + public Builder setTrigger( + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder builderForValue) { + if (triggerBuilder_ == null) { + trigger_ = builderForValue.build(); + } else { + triggerBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; } - for (int i = 0; i < aggregations_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, aggregations_.get(i)); + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + public Builder mergeTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { + if (triggerBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && trigger_ != null + && trigger_ + != com.google.monitoring.v3.AlertPolicy.Condition.Trigger + .getDefaultInstance()) { + getTriggerBuilder().mergeFrom(value); + } else { + trigger_ = value; + } + } else { + triggerBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + public Builder clearTrigger() { + bitField0_ = (bitField0_ & ~0x00000008); + trigger_ = null; + if (triggerBuilder_ != null) { + triggerBuilder_.dispose(); + triggerBuilder_ = null; + } + onChanged(); + return this; } - if (!(obj instanceof com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence)) { - return super.equals(obj); + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + public com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder getTriggerBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getTriggerFieldBuilder().getBuilder(); } - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence other = - (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) obj; - - if (!getFilter().equals(other.getFilter())) return false; - if (!getAggregationsList().equals(other.getAggregationsList())) return false; - if (hasDuration() != other.hasDuration()) return false; - if (hasDuration()) { - if (!getDuration().equals(other.getDuration())) return false; + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder + getTriggerOrBuilder() { + if (triggerBuilder_ != null) { + return triggerBuilder_.getMessageOrBuilder(); + } else { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; + } } - if (hasTrigger() != other.hasTrigger()) return false; - if (hasTrigger()) { - if (!getTrigger().equals(other.getTrigger())) return false; + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.Trigger, + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> + getTriggerFieldBuilder() { + if (triggerBuilder_ == null) { + triggerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.Trigger, + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder>( + getTrigger(), getParentForChildren(), isClean()); + trigger_ = null; + } + return triggerBuilder_; } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + FILTER_FIELD_NUMBER; - hash = (53 * hash) + getFilter().hashCode(); - if (getAggregationsCount() > 0) { - hash = (37 * hash) + AGGREGATIONS_FIELD_NUMBER; - hash = (53 * hash) + getAggregationsList().hashCode(); - } - if (hasDuration()) { - hash = (37 * hash) + DURATION_FIELD_NUMBER; - hash = (53 * hash) + getDuration().hashCode(); - } - if (hasTrigger()) { - hash = (37 * hash) + TRIGGER_FIELD_NUMBER; - hash = (53 * hash) + getTrigger().hashCode(); + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) + private static final com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + DEFAULT_INSTANCE; - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence(); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); + public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + getDefaultInstance() { + return DEFAULT_INSTANCE; } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MetricAbsence parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + public static com.google.protobuf.Parser parser() { + return PARSER; } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } + } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } + public interface LogMatchOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.Condition.LogMatch) + com.google.protobuf.MessageOrBuilder { - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + /** + * + * + *
+       * Required. A logs-based filter. See [Advanced Logs
+       * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
+       * for how this filter should be constructed.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+       * Required. A logs-based filter. See [Advanced Logs
+       * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
+       * for how this filter should be constructed.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+       * Optional. A map from a label key to an extractor expression, which is
+       * used to extract the value for this label key. Each entry in this map is
+       * a specification for how data should be extracted from log entries that
+       * match `filter`. Each combination of extracted values is treated as a
+       * separate rule for the purposes of triggering notifications. Label keys
+       * and corresponding values can be used in notifications generated by this
+       * condition.
+       *
+       * Please see [the documentation on logs-based metric
+       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+       * for syntax and examples.
+       * 
+ * + * map<string, string> label_extractors = 2; + */ + int getLabelExtractorsCount(); + /** + * + * + *
+       * Optional. A map from a label key to an extractor expression, which is
+       * used to extract the value for this label key. Each entry in this map is
+       * a specification for how data should be extracted from log entries that
+       * match `filter`. Each combination of extracted values is treated as a
+       * separate rule for the purposes of triggering notifications. Label keys
+       * and corresponding values can be used in notifications generated by this
+       * condition.
+       *
+       * Please see [the documentation on logs-based metric
+       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+       * for syntax and examples.
+       * 
+ * + * map<string, string> label_extractors = 2; + */ + boolean containsLabelExtractors(java.lang.String key); + /** Use {@link #getLabelExtractorsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabelExtractors(); + /** + * + * + *
+       * Optional. A map from a label key to an extractor expression, which is
+       * used to extract the value for this label key. Each entry in this map is
+       * a specification for how data should be extracted from log entries that
+       * match `filter`. Each combination of extracted values is treated as a
+       * separate rule for the purposes of triggering notifications. Label keys
+       * and corresponding values can be used in notifications generated by this
+       * condition.
+       *
+       * Please see [the documentation on logs-based metric
+       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+       * for syntax and examples.
+       * 
+ * + * map<string, string> label_extractors = 2; + */ + java.util.Map getLabelExtractorsMap(); + /** + * + * + *
+       * Optional. A map from a label key to an extractor expression, which is
+       * used to extract the value for this label key. Each entry in this map is
+       * a specification for how data should be extracted from log entries that
+       * match `filter`. Each combination of extracted values is treated as a
+       * separate rule for the purposes of triggering notifications. Label keys
+       * and corresponding values can be used in notifications generated by this
+       * condition.
+       *
+       * Please see [the documentation on logs-based metric
+       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+       * for syntax and examples.
+       * 
+ * + * map<string, string> label_extractors = 2; + */ + /* nullable */ + java.lang.String getLabelExtractorsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+       * Optional. A map from a label key to an extractor expression, which is
+       * used to extract the value for this label key. Each entry in this map is
+       * a specification for how data should be extracted from log entries that
+       * match `filter`. Each combination of extracted values is treated as a
+       * separate rule for the purposes of triggering notifications. Label keys
+       * and corresponding values can be used in notifications generated by this
+       * condition.
+       *
+       * Please see [the documentation on logs-based metric
+       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+       * for syntax and examples.
+       * 
+ * + * map<string, string> label_extractors = 2; + */ + java.lang.String getLabelExtractorsOrThrow(java.lang.String key); + } + /** + * + * + *
+     * A condition type that checks whether a log message in the [scoping
+     * project](https://cloud.google.com/monitoring/api/v3#project_name)
+     * satisfies the given filter. Logs from other projects in the metrics
+     * scope are not evaluated.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition.LogMatch} + */ + public static final class LogMatch extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.Condition.LogMatch) + LogMatchOrBuilder { + private static final long serialVersionUID = 0L; + // Use LogMatch.newBuilder() to construct. + private LogMatch(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); + private LogMatch() { + filter_ = ""; } @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogMatch(); } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_descriptor; } + @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-       * A condition type that checks that monitored resources
-       * are reporting data. The configuration defines a metric and
-       * a set of monitored resources. The predicate is considered in violation
-       * when a time series for the specified metric of a monitored
-       * resource does not include any data in the specified `duration`.
-       * 
- * - * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.class, - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder.class); - } - - // Construct using com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - filter_ = ""; - if (aggregationsBuilder_ == null) { - aggregations_ = java.util.Collections.emptyList(); - } else { - aggregations_ = null; - aggregationsBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - duration_ = null; - if (durationBuilder_ != null) { - durationBuilder_.dispose(); - durationBuilder_ = null; - } - trigger_ = null; - if (triggerBuilder_ != null) { - triggerBuilder_.dispose(); - triggerBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_descriptor; - } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - getDefaultInstanceForType() { - return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); - } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence build() { - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence buildPartial() { - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence result = - new com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields( - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence result) { - if (aggregationsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - aggregations_ = java.util.Collections.unmodifiableList(aggregations_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.aggregations_ = aggregations_; - } else { - result.aggregations_ = aggregationsBuilder_.build(); - } - } - - private void buildPartial0( - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.filter_ = filter_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build(); - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.trigger_ = triggerBuilder_ == null ? trigger_ : triggerBuilder_.build(); - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) { - return mergeFrom((com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence other) { - if (other - == com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance()) - return this; - if (!other.getFilter().isEmpty()) { - filter_ = other.filter_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (aggregationsBuilder_ == null) { - if (!other.aggregations_.isEmpty()) { - if (aggregations_.isEmpty()) { - aggregations_ = other.aggregations_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureAggregationsIsMutable(); - aggregations_.addAll(other.aggregations_); - } - onChanged(); - } - } else { - if (!other.aggregations_.isEmpty()) { - if (aggregationsBuilder_.isEmpty()) { - aggregationsBuilder_.dispose(); - aggregationsBuilder_ = null; - aggregations_ = other.aggregations_; - bitField0_ = (bitField0_ & ~0x00000002); - aggregationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAggregationsFieldBuilder() - : null; - } else { - aggregationsBuilder_.addAllMessages(other.aggregations_); - } - } - } - if (other.hasDuration()) { - mergeDuration(other.getDuration()); - } - if (other.hasTrigger()) { - mergeTrigger(other.getTrigger()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetLabelExtractors(); + default: + throw new RuntimeException("Invalid map field number: " + number); } + } - @java.lang.Override - public final boolean isInitialized() { - return true; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.class, + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder.class); + } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - filter_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000004; - break; - } // case 18 - case 26: - { - input.readMessage(getTriggerFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000008; - break; - } // case 26 - case 42: - { - com.google.monitoring.v3.Aggregation m = - input.readMessage( - com.google.monitoring.v3.Aggregation.parser(), extensionRegistry); - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - aggregations_.add(m); - } else { - aggregationsBuilder_.addMessage(m); - } - break; - } // case 42 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; + public static final int FILTER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+       * Required. A logs-based filter. See [Advanced Logs
+       * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
+       * for how this filter should be constructed.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+       * Required. A logs-based filter. See [Advanced Logs
+       * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
+       * for how this filter should be constructed.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } + } - private int bitField0_; + public static final int LABEL_EXTRACTORS_FIELD_NUMBER = 2; - private java.lang.Object filter_ = ""; - /** - * - * - *
-         * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies which time series should be compared with the threshold.
-         *
-         * The filter is similar to the one that is specified in the
-         * [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-         * (that call is useful to verify the time series that will be retrieved /
-         * processed). The filter must specify the metric type and the resource
-         * type. Optionally, it can specify resource labels and metric labels.
-         * This field must not exceed 2048 Unicode characters in length.
-         * 
- * - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The filter. - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-         * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies which time series should be compared with the threshold.
-         *
-         * The filter is similar to the one that is specified in the
-         * [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-         * (that call is useful to verify the time series that will be retrieved /
-         * processed). The filter must specify the metric type and the resource
-         * type. Optionally, it can specify resource labels and metric labels.
-         * This field must not exceed 2048 Unicode characters in length.
-         * 
- * - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for filter. - */ - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + private static final class LabelExtractorsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_LabelExtractorsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labelExtractors_; + + private com.google.protobuf.MapField + internalGetLabelExtractors() { + if (labelExtractors_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelExtractorsDefaultEntryHolder.defaultEntry); } - /** - * - * - *
-         * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies which time series should be compared with the threshold.
-         *
-         * The filter is similar to the one that is specified in the
-         * [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-         * (that call is useful to verify the time series that will be retrieved /
-         * processed). The filter must specify the metric type and the resource
-         * type. Optionally, it can specify resource labels and metric labels.
-         * This field must not exceed 2048 Unicode characters in length.
-         * 
- * - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The filter to set. - * @return This builder for chaining. - */ - public Builder setFilter(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - filter_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; + return labelExtractors_; + } + + public int getLabelExtractorsCount() { + return internalGetLabelExtractors().getMap().size(); + } + /** + * + * + *
+       * Optional. A map from a label key to an extractor expression, which is
+       * used to extract the value for this label key. Each entry in this map is
+       * a specification for how data should be extracted from log entries that
+       * match `filter`. Each combination of extracted values is treated as a
+       * separate rule for the purposes of triggering notifications. Label keys
+       * and corresponding values can be used in notifications generated by this
+       * condition.
+       *
+       * Please see [the documentation on logs-based metric
+       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+       * for syntax and examples.
+       * 
+ * + * map<string, string> label_extractors = 2; + */ + @java.lang.Override + public boolean containsLabelExtractors(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } - /** - * - * - *
-         * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies which time series should be compared with the threshold.
-         *
-         * The filter is similar to the one that is specified in the
-         * [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-         * (that call is useful to verify the time series that will be retrieved /
-         * processed). The filter must specify the metric type and the resource
-         * type. Optionally, it can specify resource labels and metric labels.
-         * This field must not exceed 2048 Unicode characters in length.
-         * 
- * - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearFilter() { - filter_ = getDefaultInstance().getFilter(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; + return internalGetLabelExtractors().getMap().containsKey(key); + } + /** Use {@link #getLabelExtractorsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabelExtractors() { + return getLabelExtractorsMap(); + } + /** + * + * + *
+       * Optional. A map from a label key to an extractor expression, which is
+       * used to extract the value for this label key. Each entry in this map is
+       * a specification for how data should be extracted from log entries that
+       * match `filter`. Each combination of extracted values is treated as a
+       * separate rule for the purposes of triggering notifications. Label keys
+       * and corresponding values can be used in notifications generated by this
+       * condition.
+       *
+       * Please see [the documentation on logs-based metric
+       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+       * for syntax and examples.
+       * 
+ * + * map<string, string> label_extractors = 2; + */ + @java.lang.Override + public java.util.Map getLabelExtractorsMap() { + return internalGetLabelExtractors().getMap(); + } + /** + * + * + *
+       * Optional. A map from a label key to an extractor expression, which is
+       * used to extract the value for this label key. Each entry in this map is
+       * a specification for how data should be extracted from log entries that
+       * match `filter`. Each combination of extracted values is treated as a
+       * separate rule for the purposes of triggering notifications. Label keys
+       * and corresponding values can be used in notifications generated by this
+       * condition.
+       *
+       * Please see [the documentation on logs-based metric
+       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+       * for syntax and examples.
+       * 
+ * + * map<string, string> label_extractors = 2; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelExtractorsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); } - /** - * - * - *
-         * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
-         * identifies which time series should be compared with the threshold.
-         *
-         * The filter is similar to the one that is specified in the
-         * [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
-         * (that call is useful to verify the time series that will be retrieved /
-         * processed). The filter must specify the metric type and the resource
-         * type. Optionally, it can specify resource labels and metric labels.
-         * This field must not exceed 2048 Unicode characters in length.
-         * 
- * - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for filter to set. - * @return This builder for chaining. - */ - public Builder setFilterBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - filter_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; + java.util.Map map = + internalGetLabelExtractors().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Optional. A map from a label key to an extractor expression, which is
+       * used to extract the value for this label key. Each entry in this map is
+       * a specification for how data should be extracted from log entries that
+       * match `filter`. Each combination of extracted values is treated as a
+       * separate rule for the purposes of triggering notifications. Label keys
+       * and corresponding values can be used in notifications generated by this
+       * condition.
+       *
+       * Please see [the documentation on logs-based metric
+       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+       * for syntax and examples.
+       * 
+ * + * map<string, string> label_extractors = 2; + */ + @java.lang.Override + public java.lang.String getLabelExtractorsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetLabelExtractors().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); } + return map.get(key); + } - private java.util.List aggregations_ = - java.util.Collections.emptyList(); + private byte memoizedIsInitialized = -1; - private void ensureAggregationsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - aggregations_ = - new java.util.ArrayList(aggregations_); - bitField0_ |= 0x00000002; - } + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filter_); } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetLabelExtractors(), + LabelExtractorsDefaultEntryHolder.defaultEntry, + 2); + getUnknownFields().writeTo(output); + } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.monitoring.v3.Aggregation, - com.google.monitoring.v3.Aggregation.Builder, - com.google.monitoring.v3.AggregationOrBuilder> - aggregationsBuilder_; + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public java.util.List getAggregationsList() { - if (aggregationsBuilder_ == null) { - return java.util.Collections.unmodifiableList(aggregations_); - } else { - return aggregationsBuilder_.getMessageList(); - } + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filter_); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public int getAggregationsCount() { - if (aggregationsBuilder_ == null) { - return aggregations_.size(); - } else { - return aggregationsBuilder_.getCount(); - } + for (java.util.Map.Entry entry : + internalGetLabelExtractors().getMap().entrySet()) { + com.google.protobuf.MapEntry labelExtractors__ = + LabelExtractorsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labelExtractors__); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public com.google.monitoring.v3.Aggregation getAggregations(int index) { - if (aggregationsBuilder_ == null) { - return aggregations_.get(index); - } else { - return aggregationsBuilder_.getMessage(index); - } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public Builder setAggregations(int index, com.google.monitoring.v3.Aggregation value) { - if (aggregationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAggregationsIsMutable(); - aggregations_.set(index, value); - onChanged(); - } else { - aggregationsBuilder_.setMessage(index, value); - } - return this; + if (!(obj instanceof com.google.monitoring.v3.AlertPolicy.Condition.LogMatch)) { + return super.equals(obj); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public Builder setAggregations( - int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - aggregations_.set(index, builderForValue.build()); - onChanged(); - } else { - aggregationsBuilder_.setMessage(index, builderForValue.build()); - } - return this; + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch other = + (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) obj; + + if (!getFilter().equals(other.getFilter())) return false; + if (!internalGetLabelExtractors().equals(other.internalGetLabelExtractors())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public Builder addAggregations(com.google.monitoring.v3.Aggregation value) { - if (aggregationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAggregationsIsMutable(); - aggregations_.add(value); - onChanged(); - } else { - aggregationsBuilder_.addMessage(value); - } - return this; + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + if (!internalGetLabelExtractors().getMap().isEmpty()) { + hash = (37 * hash) + LABEL_EXTRACTORS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabelExtractors().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * A condition type that checks whether a log message in the [scoping
+       * project](https://cloud.google.com/monitoring/api/v3#project_name)
+       * satisfies the given filter. Logs from other projects in the metrics
+       * scope are not evaluated.
+       * 
+ * + * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition.LogMatch} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition.LogMatch) + com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_descriptor; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public Builder addAggregations(int index, com.google.monitoring.v3.Aggregation value) { - if (aggregationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAggregationsIsMutable(); - aggregations_.add(index, value); - onChanged(); - } else { - aggregationsBuilder_.addMessage(index, value); + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetLabelExtractors(); + default: + throw new RuntimeException("Invalid map field number: " + number); } - return this; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public Builder addAggregations( - com.google.monitoring.v3.Aggregation.Builder builderForValue) { - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - aggregations_.add(builderForValue.build()); - onChanged(); - } else { - aggregationsBuilder_.addMessage(builderForValue.build()); + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableLabelExtractors(); + default: + throw new RuntimeException("Invalid map field number: " + number); } - return this; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public Builder addAggregations( - int index, com.google.monitoring.v3.Aggregation.Builder builderForValue) { - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - aggregations_.add(index, builderForValue.build()); - onChanged(); - } else { - aggregationsBuilder_.addMessage(index, builderForValue.build()); - } - return this; + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.class, + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder.class); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public Builder addAllAggregations( - java.lang.Iterable values) { - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, aggregations_); - onChanged(); - } else { - aggregationsBuilder_.addAllMessages(values); - } - return this; + + // Construct using com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public Builder clearAggregations() { - if (aggregationsBuilder_ == null) { - aggregations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - aggregationsBuilder_.clear(); - } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + filter_ = ""; + internalGetMutableLabelExtractors().clear(); return this; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public Builder removeAggregations(int index) { - if (aggregationsBuilder_ == null) { - ensureAggregationsIsMutable(); - aggregations_.remove(index); - onChanged(); - } else { - aggregationsBuilder_.remove(index); - } - return this; + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_descriptor; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public com.google.monitoring.v3.Aggregation.Builder getAggregationsBuilder(int index) { - return getAggregationsFieldBuilder().getBuilder(index); + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch getDefaultInstanceForType() { + return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch build() { + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(int index) { - if (aggregationsBuilder_ == null) { - return aggregations_.get(index); - } else { - return aggregationsBuilder_.getMessageOrBuilder(index); + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch buildPartial() { + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch result = + new com.google.monitoring.v3.AlertPolicy.Condition.LogMatch(this); + if (bitField0_ != 0) { + buildPartial0(result); } + onBuilt(); + return result; } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public java.util.List - getAggregationsOrBuilderList() { - if (aggregationsBuilder_ != null) { - return aggregationsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(aggregations_); + + private void buildPartial0(com.google.monitoring.v3.AlertPolicy.Condition.LogMatch result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.labelExtractors_ = internalGetLabelExtractors(); + result.labelExtractors_.makeImmutable(); } } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder() { - return getAggregationsFieldBuilder() - .addBuilder(com.google.monitoring.v3.Aggregation.getDefaultInstance()); + + @java.lang.Override + public Builder clone() { + return super.clone(); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder(int index) { - return getAggregationsFieldBuilder() - .addBuilder(index, com.google.monitoring.v3.Aggregation.getDefaultInstance()); + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); } - /** - * - * - *
-         * Specifies the alignment of data points in individual time series as
-         * well as how to combine the retrieved time series together (such as
-         * when aggregating multiple streams on each resource to a single
-         * stream for each resource or when aggregating streams across all
-         * members of a group of resources). Multiple aggregations
-         * are applied in the order specified.
-         *
-         * This field is similar to the one in the [`ListTimeSeries`
-         * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
-         * It is advisable to use the `ListTimeSeries` method when debugging this
-         * field.
-         * 
- * - * repeated .google.monitoring.v3.Aggregation aggregations = 5; - */ - public java.util.List - getAggregationsBuilderList() { - return getAggregationsFieldBuilder().getBuilderList(); + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.monitoring.v3.Aggregation, - com.google.monitoring.v3.Aggregation.Builder, - com.google.monitoring.v3.AggregationOrBuilder> - getAggregationsFieldBuilder() { - if (aggregationsBuilder_ == null) { - aggregationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.monitoring.v3.Aggregation, - com.google.monitoring.v3.Aggregation.Builder, - com.google.monitoring.v3.AggregationOrBuilder>( - aggregations_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - aggregations_ = null; - } - return aggregationsBuilder_; + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); } - private com.google.protobuf.Duration duration_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - durationBuilder_; - /** - * - * - *
-         * The amount of time that a time series must fail to report new
-         * data to be considered failing. The minimum value of this field
-         * is 120 seconds. Larger values that are a multiple of a
-         * minute--for example, 240 or 300 seconds--are supported.
-         * If an invalid value is given, an
-         * error will be returned. The `Duration.nanos` field is
-         * ignored.
-         * 
- * - * .google.protobuf.Duration duration = 2; - * - * @return Whether the duration field is set. - */ - public boolean hasDuration() { - return ((bitField0_ & 0x00000004) != 0); + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - /** - * - * - *
-         * The amount of time that a time series must fail to report new
-         * data to be considered failing. The minimum value of this field
-         * is 120 seconds. Larger values that are a multiple of a
-         * minute--for example, 240 or 300 seconds--are supported.
-         * If an invalid value is given, an
-         * error will be returned. The `Duration.nanos` field is
-         * ignored.
-         * 
- * - * .google.protobuf.Duration duration = 2; - * - * @return The duration. - */ - public com.google.protobuf.Duration getDuration() { - if (durationBuilder_ == null) { - return duration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : duration_; - } else { - return durationBuilder_.getMessage(); - } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); } - /** - * - * - *
-         * The amount of time that a time series must fail to report new
-         * data to be considered failing. The minimum value of this field
-         * is 120 seconds. Larger values that are a multiple of a
-         * minute--for example, 240 or 300 seconds--are supported.
-         * If an invalid value is given, an
-         * error will be returned. The `Duration.nanos` field is
-         * ignored.
-         * 
- * - * .google.protobuf.Duration duration = 2; - */ - public Builder setDuration(com.google.protobuf.Duration value) { - if (durationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - duration_ = value; + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) { + return mergeFrom((com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) other); } else { - durationBuilder_.setMessage(value); + super.mergeFrom(other); + return this; } - bitField0_ |= 0x00000004; - onChanged(); - return this; } - /** - * - * - *
-         * The amount of time that a time series must fail to report new
-         * data to be considered failing. The minimum value of this field
-         * is 120 seconds. Larger values that are a multiple of a
-         * minute--for example, 240 or 300 seconds--are supported.
-         * If an invalid value is given, an
-         * error will be returned. The `Duration.nanos` field is
-         * ignored.
-         * 
- * - * .google.protobuf.Duration duration = 2; - */ - public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { - if (durationBuilder_ == null) { - duration_ = builderForValue.build(); - } else { - durationBuilder_.setMessage(builderForValue.build()); + + public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy.Condition.LogMatch other) { + if (other == com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance()) + return this; + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000001; + onChanged(); } - bitField0_ |= 0x00000004; + internalGetMutableLabelExtractors().mergeFrom(other.internalGetLabelExtractors()); + bitField0_ |= 0x00000002; + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } - /** - * - * - *
-         * The amount of time that a time series must fail to report new
-         * data to be considered failing. The minimum value of this field
-         * is 120 seconds. Larger values that are a multiple of a
-         * minute--for example, 240 or 300 seconds--are supported.
-         * If an invalid value is given, an
-         * error will be returned. The `Duration.nanos` field is
-         * ignored.
-         * 
- * - * .google.protobuf.Duration duration = 2; - */ - public Builder mergeDuration(com.google.protobuf.Duration value) { - if (durationBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0) - && duration_ != null - && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { - getDurationBuilder().mergeFrom(value); - } else { - duration_ = value; - } - } else { - durationBuilder_.mergeFrom(value); + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - bitField0_ |= 0x00000004; - onChanged(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry + labelExtractors__ = + input.readMessage( + LabelExtractorsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabelExtractors() + .getMutableMap() + .put(labelExtractors__.getKey(), labelExtractors__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally return this; } + + private int bitField0_; + + private java.lang.Object filter_ = ""; /** * * *
-         * The amount of time that a time series must fail to report new
-         * data to be considered failing. The minimum value of this field
-         * is 120 seconds. Larger values that are a multiple of a
-         * minute--for example, 240 or 300 seconds--are supported.
-         * If an invalid value is given, an
-         * error will be returned. The `Duration.nanos` field is
-         * ignored.
+         * Required. A logs-based filter. See [Advanced Logs
+         * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
+         * for how this filter should be constructed.
          * 
* - * .google.protobuf.Duration duration = 2; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. */ - public Builder clearDuration() { - bitField0_ = (bitField0_ & ~0x00000004); - duration_ = null; - if (durationBuilder_ != null) { - durationBuilder_.dispose(); - durationBuilder_ = null; + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; } - onChanged(); - return this; } /** * * *
-         * The amount of time that a time series must fail to report new
-         * data to be considered failing. The minimum value of this field
-         * is 120 seconds. Larger values that are a multiple of a
-         * minute--for example, 240 or 300 seconds--are supported.
-         * If an invalid value is given, an
-         * error will be returned. The `Duration.nanos` field is
-         * ignored.
+         * Required. A logs-based filter. See [Advanced Logs
+         * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
+         * for how this filter should be constructed.
          * 
* - * .google.protobuf.Duration duration = 2; - */ - public com.google.protobuf.Duration.Builder getDurationBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return getDurationFieldBuilder().getBuilder(); - } - /** - * - * - *
-         * The amount of time that a time series must fail to report new
-         * data to be considered failing. The minimum value of this field
-         * is 120 seconds. Larger values that are a multiple of a
-         * minute--for example, 240 or 300 seconds--are supported.
-         * If an invalid value is given, an
-         * error will be returned. The `Duration.nanos` field is
-         * ignored.
-         * 
+ * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * - * .google.protobuf.Duration duration = 2; + * @return The bytes for filter. */ - public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { - if (durationBuilder_ != null) { - return durationBuilder_.getMessageOrBuilder(); + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; } else { - return duration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : duration_; + return (com.google.protobuf.ByteString) ref; } } /** * * *
-         * The amount of time that a time series must fail to report new
-         * data to be considered failing. The minimum value of this field
-         * is 120 seconds. Larger values that are a multiple of a
-         * minute--for example, 240 or 300 seconds--are supported.
-         * If an invalid value is given, an
-         * error will be returned. The `Duration.nanos` field is
-         * ignored.
+         * Required. A logs-based filter. See [Advanced Logs
+         * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
+         * for how this filter should be constructed.
          * 
* - * .google.protobuf.Duration duration = 2; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The filter to set. + * @return This builder for chaining. */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getDurationFieldBuilder() { - if (durationBuilder_ == null) { - durationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getDuration(), getParentForChildren(), isClean()); - duration_ = null; + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } - return durationBuilder_; + filter_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; } - - private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.Trigger, - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> - triggerBuilder_; /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`.
+         * Required. A logs-based filter. See [Advanced Logs
+         * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
+         * for how this filter should be constructed.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * - * @return Whether the trigger field is set. + * @return This builder for chaining. */ - public boolean hasTrigger() { - return ((bitField0_ & 0x00000008) != 0); + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`.
+         * Required. A logs-based filter. See [Advanced Logs
+         * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
+         * for how this filter should be constructed.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * - * @return The trigger. + * @param value The bytes for filter to set. + * @return This builder for chaining. */ - public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { - if (triggerBuilder_ == null) { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; - } else { - return triggerBuilder_.getMessage(); + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labelExtractors_; + + private com.google.protobuf.MapField + internalGetLabelExtractors() { + if (labelExtractors_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelExtractorsDefaultEntryHolder.defaultEntry); } + return labelExtractors_; + } + + private com.google.protobuf.MapField + internalGetMutableLabelExtractors() { + if (labelExtractors_ == null) { + labelExtractors_ = + com.google.protobuf.MapField.newMapField( + LabelExtractorsDefaultEntryHolder.defaultEntry); + } + if (!labelExtractors_.isMutable()) { + labelExtractors_ = labelExtractors_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return labelExtractors_; + } + + public int getLabelExtractorsCount() { + return internalGetLabelExtractors().getMap().size(); } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`.
+         * Optional. A map from a label key to an extractor expression, which is
+         * used to extract the value for this label key. Each entry in this map is
+         * a specification for how data should be extracted from log entries that
+         * match `filter`. Each combination of extracted values is treated as a
+         * separate rule for the purposes of triggering notifications. Label keys
+         * and corresponding values can be used in notifications generated by this
+         * condition.
+         *
+         * Please see [the documentation on logs-based metric
+         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+         * for syntax and examples.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> label_extractors = 2; */ - public Builder setTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { - if (triggerBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - trigger_ = value; - } else { - triggerBuilder_.setMessage(value); + @java.lang.Override + public boolean containsLabelExtractors(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } - bitField0_ |= 0x00000008; - onChanged(); - return this; + return internalGetLabelExtractors().getMap().containsKey(key); + } + /** Use {@link #getLabelExtractorsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabelExtractors() { + return getLabelExtractorsMap(); } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`.
+         * Optional. A map from a label key to an extractor expression, which is
+         * used to extract the value for this label key. Each entry in this map is
+         * a specification for how data should be extracted from log entries that
+         * match `filter`. Each combination of extracted values is treated as a
+         * separate rule for the purposes of triggering notifications. Label keys
+         * and corresponding values can be used in notifications generated by this
+         * condition.
+         *
+         * Please see [the documentation on logs-based metric
+         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+         * for syntax and examples.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> label_extractors = 2; */ - public Builder setTrigger( - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder builderForValue) { - if (triggerBuilder_ == null) { - trigger_ = builderForValue.build(); - } else { - triggerBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000008; - onChanged(); - return this; + @java.lang.Override + public java.util.Map getLabelExtractorsMap() { + return internalGetLabelExtractors().getMap(); } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`.
+         * Optional. A map from a label key to an extractor expression, which is
+         * used to extract the value for this label key. Each entry in this map is
+         * a specification for how data should be extracted from log entries that
+         * match `filter`. Each combination of extracted values is treated as a
+         * separate rule for the purposes of triggering notifications. Label keys
+         * and corresponding values can be used in notifications generated by this
+         * condition.
+         *
+         * Please see [the documentation on logs-based metric
+         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+         * for syntax and examples.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> label_extractors = 2; */ - public Builder mergeTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { - if (triggerBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0) - && trigger_ != null - && trigger_ - != com.google.monitoring.v3.AlertPolicy.Condition.Trigger - .getDefaultInstance()) { - getTriggerBuilder().mergeFrom(value); - } else { - trigger_ = value; - } - } else { - triggerBuilder_.mergeFrom(value); + @java.lang.Override + public /* nullable */ java.lang.String getLabelExtractorsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); } - bitField0_ |= 0x00000008; - onChanged(); - return this; + java.util.Map map = + internalGetLabelExtractors().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`.
+         * Optional. A map from a label key to an extractor expression, which is
+         * used to extract the value for this label key. Each entry in this map is
+         * a specification for how data should be extracted from log entries that
+         * match `filter`. Each combination of extracted values is treated as a
+         * separate rule for the purposes of triggering notifications. Label keys
+         * and corresponding values can be used in notifications generated by this
+         * condition.
+         *
+         * Please see [the documentation on logs-based metric
+         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+         * for syntax and examples.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> label_extractors = 2; */ - public Builder clearTrigger() { - bitField0_ = (bitField0_ & ~0x00000008); - trigger_ = null; - if (triggerBuilder_ != null) { - triggerBuilder_.dispose(); - triggerBuilder_ = null; + @java.lang.Override + public java.lang.String getLabelExtractorsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } - onChanged(); + java.util.Map map = + internalGetLabelExtractors().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabelExtractors() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableLabelExtractors().getMutableMap().clear(); return this; } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`.
+         * Optional. A map from a label key to an extractor expression, which is
+         * used to extract the value for this label key. Each entry in this map is
+         * a specification for how data should be extracted from log entries that
+         * match `filter`. Each combination of extracted values is treated as a
+         * separate rule for the purposes of triggering notifications. Label keys
+         * and corresponding values can be used in notifications generated by this
+         * condition.
+         *
+         * Please see [the documentation on logs-based metric
+         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+         * for syntax and examples.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> label_extractors = 2; */ - public com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder getTriggerBuilder() { - bitField0_ |= 0x00000008; - onChanged(); - return getTriggerFieldBuilder().getBuilder(); + public Builder removeLabelExtractors(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabelExtractors().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabelExtractors() { + bitField0_ |= 0x00000002; + return internalGetMutableLabelExtractors().getMutableMap(); } /** * * - *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`.
+         * 
+         * Optional. A map from a label key to an extractor expression, which is
+         * used to extract the value for this label key. Each entry in this map is
+         * a specification for how data should be extracted from log entries that
+         * match `filter`. Each combination of extracted values is treated as a
+         * separate rule for the purposes of triggering notifications. Label keys
+         * and corresponding values can be used in notifications generated by this
+         * condition.
+         *
+         * Please see [the documentation on logs-based metric
+         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+         * for syntax and examples.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> label_extractors = 2; */ - public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder - getTriggerOrBuilder() { - if (triggerBuilder_ != null) { - return triggerBuilder_.getMessageOrBuilder(); - } else { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; + public Builder putLabelExtractors(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); } + internalGetMutableLabelExtractors().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; + return this; } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`.
+         * Optional. A map from a label key to an extractor expression, which is
+         * used to extract the value for this label key. Each entry in this map is
+         * a specification for how data should be extracted from log entries that
+         * match `filter`. Each combination of extracted values is treated as a
+         * separate rule for the purposes of triggering notifications. Label keys
+         * and corresponding values can be used in notifications generated by this
+         * condition.
+         *
+         * Please see [the documentation on logs-based metric
+         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
+         * for syntax and examples.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> label_extractors = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.Trigger, - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> - getTriggerFieldBuilder() { - if (triggerBuilder_ == null) { - triggerBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.Trigger, - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder>( - getTrigger(), getParentForChildren(), isClean()); - trigger_ = null; - } - return triggerBuilder_; + public Builder putAllLabelExtractors( + java.util.Map values) { + internalGetMutableLabelExtractors().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; + return this; } @java.lang.Override @@ -8800,26 +11703,24 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition.LogMatch) } - // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) - private static final com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition.LogMatch) + private static final com.google.monitoring.v3.AlertPolicy.Condition.LogMatch DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence(); + DEFAULT_INSTANCE = new com.google.monitoring.v3.AlertPolicy.Condition.LogMatch(); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - getDefaultInstance() { + public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public MetricAbsence parsePartialFrom( + public LogMatch parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -8839,248 +11740,273 @@ public MetricAbsence parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - getDefaultInstanceForType() { + public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface LogMatchOrBuilder + public interface MonitoringQueryLanguageConditionOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.Condition.LogMatch) + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) com.google.protobuf.MessageOrBuilder { /** * * *
-       * Required. A logs-based filter. See [Advanced Logs
-       * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
-       * for how this filter should be constructed.
+       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+       * query that outputs a boolean stream.
        * 
* - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * string query = 1; * - * @return The filter. + * @return The query. */ - java.lang.String getFilter(); + java.lang.String getQuery(); /** * * *
-       * Required. A logs-based filter. See [Advanced Logs
-       * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
-       * for how this filter should be constructed.
+       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+       * query that outputs a boolean stream.
        * 
* - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * string query = 1; * - * @return The bytes for filter. + * @return The bytes for query. */ - com.google.protobuf.ByteString getFilterBytes(); + com.google.protobuf.ByteString getQueryBytes(); /** * * *
-       * Optional. A map from a label key to an extractor expression, which is
-       * used to extract the value for this label key. Each entry in this map is
-       * a specification for how data should be extracted from log entries that
-       * match `filter`. Each combination of extracted values is treated as a
-       * separate rule for the purposes of triggering notifications. Label keys
-       * and corresponding values can be used in notifications generated by this
-       * condition.
-       *
-       * Please see [the documentation on logs-based metric
-       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-       * for syntax and examples.
+       * The amount of time that a time series must violate the
+       * threshold to be considered failing. Currently, only values
+       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+       * seconds--are supported. If an invalid value is given, an
+       * error will be returned. When choosing a duration, it is useful to
+       * keep in mind the frequency of the underlying time series data
+       * (which may also be affected by any alignments specified in the
+       * `aggregations` field); a good duration is long enough so that a single
+       * outlier does not generate spurious alerts, but short enough that
+       * unhealthy states are detected and alerted on quickly.
        * 
* - * map<string, string> label_extractors = 2; + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. */ - int getLabelExtractorsCount(); + boolean hasDuration(); /** * * *
-       * Optional. A map from a label key to an extractor expression, which is
-       * used to extract the value for this label key. Each entry in this map is
-       * a specification for how data should be extracted from log entries that
-       * match `filter`. Each combination of extracted values is treated as a
-       * separate rule for the purposes of triggering notifications. Label keys
-       * and corresponding values can be used in notifications generated by this
-       * condition.
+       * The amount of time that a time series must violate the
+       * threshold to be considered failing. Currently, only values
+       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+       * seconds--are supported. If an invalid value is given, an
+       * error will be returned. When choosing a duration, it is useful to
+       * keep in mind the frequency of the underlying time series data
+       * (which may also be affected by any alignments specified in the
+       * `aggregations` field); a good duration is long enough so that a single
+       * outlier does not generate spurious alerts, but short enough that
+       * unhealthy states are detected and alerted on quickly.
+       * 
* - * Please see [the documentation on logs-based metric - * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) - * for syntax and examples. + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + /** + * + * + *
+       * The amount of time that a time series must violate the
+       * threshold to be considered failing. Currently, only values
+       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+       * seconds--are supported. If an invalid value is given, an
+       * error will be returned. When choosing a duration, it is useful to
+       * keep in mind the frequency of the underlying time series data
+       * (which may also be affected by any alignments specified in the
+       * `aggregations` field); a good duration is long enough so that a single
+       * outlier does not generate spurious alerts, but short enough that
+       * unhealthy states are detected and alerted on quickly.
        * 
* - * map<string, string> label_extractors = 2; + * .google.protobuf.Duration duration = 2; */ - boolean containsLabelExtractors(java.lang.String key); - /** Use {@link #getLabelExtractorsMap()} instead. */ - @java.lang.Deprecated - java.util.Map getLabelExtractors(); + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); + /** * * *
-       * Optional. A map from a label key to an extractor expression, which is
-       * used to extract the value for this label key. Each entry in this map is
-       * a specification for how data should be extracted from log entries that
-       * match `filter`. Each combination of extracted values is treated as a
-       * separate rule for the purposes of triggering notifications. Label keys
-       * and corresponding values can be used in notifications generated by this
-       * condition.
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`,
+       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+       * are specified.
+       * 
* - * Please see [the documentation on logs-based metric - * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) - * for syntax and examples. + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * + * @return Whether the trigger field is set. + */ + boolean hasTrigger(); + /** + * + * + *
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`,
+       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+       * are specified.
        * 
* - * map<string, string> label_extractors = 2; + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * + * @return The trigger. */ - java.util.Map getLabelExtractorsMap(); + com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger(); /** * * *
-       * Optional. A map from a label key to an extractor expression, which is
-       * used to extract the value for this label key. Each entry in this map is
-       * a specification for how data should be extracted from log entries that
-       * match `filter`. Each combination of extracted values is treated as a
-       * separate rule for the purposes of triggering notifications. Label keys
-       * and corresponding values can be used in notifications generated by this
-       * condition.
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`,
+       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+       * are specified.
+       * 
* - * Please see [the documentation on logs-based metric - * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) - * for syntax and examples. + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder(); + + /** + * + * + *
+       * A condition control that determines how metric-threshold conditions
+       * are evaluated when data stops arriving.
        * 
* - * map<string, string> label_extractors = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * + * + * @return The enum numeric value on the wire for evaluationMissingData. */ - /* nullable */ - java.lang.String getLabelExtractorsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue); + int getEvaluationMissingDataValue(); /** * * *
-       * Optional. A map from a label key to an extractor expression, which is
-       * used to extract the value for this label key. Each entry in this map is
-       * a specification for how data should be extracted from log entries that
-       * match `filter`. Each combination of extracted values is treated as a
-       * separate rule for the purposes of triggering notifications. Label keys
-       * and corresponding values can be used in notifications generated by this
-       * condition.
-       *
-       * Please see [the documentation on logs-based metric
-       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-       * for syntax and examples.
+       * A condition control that determines how metric-threshold conditions
+       * are evaluated when data stops arriving.
        * 
* - * map<string, string> label_extractors = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * + * + * @return The evaluationMissingData. */ - java.lang.String getLabelExtractorsOrThrow(java.lang.String key); + com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData + getEvaluationMissingData(); } /** * * *
-     * A condition type that checks whether a log message in the [scoping
-     * project](https://cloud.google.com/monitoring/api/v3#project_name)
-     * satisfies the given filter. Logs from other projects in the metrics
-     * scope are not evaluated.
+     * A condition type that allows alert policies to be defined using
+     * [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
      * 
* - * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition.LogMatch} + * Protobuf type {@code + * google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition} */ - public static final class LogMatch extends com.google.protobuf.GeneratedMessageV3 + public static final class MonitoringQueryLanguageCondition + extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.Condition.LogMatch) - LogMatchOrBuilder { + // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + MonitoringQueryLanguageConditionOrBuilder { private static final long serialVersionUID = 0L; - // Use LogMatch.newBuilder() to construct. - private LogMatch(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use MonitoringQueryLanguageCondition.newBuilder() to construct. + private MonitoringQueryLanguageCondition( + com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private LogMatch() { - filter_ = ""; + private MonitoringQueryLanguageCondition() { + query_ = ""; + evaluationMissingData_ = 0; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LogMatch(); + return new MonitoringQueryLanguageCondition(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 2: - return internalGetLabelExtractors(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_fieldAccessorTable + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.class, - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder.class); + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .class, + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .Builder.class); } - public static final int FILTER_FIELD_NUMBER = 1; + public static final int QUERY_FIELD_NUMBER = 1; @SuppressWarnings("serial") - private volatile java.lang.Object filter_ = ""; + private volatile java.lang.Object query_ = ""; /** * * *
-       * Required. A logs-based filter. See [Advanced Logs
-       * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
-       * for how this filter should be constructed.
+       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+       * query that outputs a boolean stream.
        * 
* - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * string query = 1; * - * @return The filter. + * @return The query. */ @java.lang.Override - public java.lang.String getFilter() { - java.lang.Object ref = filter_; + public java.lang.String getQuery() { + java.lang.Object ref = query_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - filter_ = s; + query_ = s; return s; } } @@ -9088,172 +12014,208 @@ public java.lang.String getFilter() { * * *
-       * Required. A logs-based filter. See [Advanced Logs
-       * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
-       * for how this filter should be constructed.
+       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+       * query that outputs a boolean stream.
        * 
* - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * string query = 1; * - * @return The bytes for filter. + * @return The bytes for query. */ @java.lang.Override - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; + query_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } - public static final int LABEL_EXTRACTORS_FIELD_NUMBER = 2; - - private static final class LabelExtractorsDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_LabelExtractorsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); + public static final int DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration duration_; + /** + * + * + *
+       * The amount of time that a time series must violate the
+       * threshold to be considered failing. Currently, only values
+       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+       * seconds--are supported. If an invalid value is given, an
+       * error will be returned. When choosing a duration, it is useful to
+       * keep in mind the frequency of the underlying time series data
+       * (which may also be affected by any alignments specified in the
+       * `aggregations` field); a good duration is long enough so that a single
+       * outlier does not generate spurious alerts, but short enough that
+       * unhealthy states are detected and alerted on quickly.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return duration_ != null; } - - @SuppressWarnings("serial") - private com.google.protobuf.MapField labelExtractors_; - - private com.google.protobuf.MapField - internalGetLabelExtractors() { - if (labelExtractors_ == null) { - return com.google.protobuf.MapField.emptyMapField( - LabelExtractorsDefaultEntryHolder.defaultEntry); - } - return labelExtractors_; + /** + * + * + *
+       * The amount of time that a time series must violate the
+       * threshold to be considered failing. Currently, only values
+       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+       * seconds--are supported. If an invalid value is given, an
+       * error will be returned. When choosing a duration, it is useful to
+       * keep in mind the frequency of the underlying time series data
+       * (which may also be affected by any alignments specified in the
+       * `aggregations` field); a good duration is long enough so that a single
+       * outlier does not generate spurious alerts, but short enough that
+       * unhealthy states are detected and alerted on quickly.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; } - - public int getLabelExtractorsCount() { - return internalGetLabelExtractors().getMap().size(); + /** + * + * + *
+       * The amount of time that a time series must violate the
+       * threshold to be considered failing. Currently, only values
+       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+       * seconds--are supported. If an invalid value is given, an
+       * error will be returned. When choosing a duration, it is useful to
+       * keep in mind the frequency of the underlying time series data
+       * (which may also be affected by any alignments specified in the
+       * `aggregations` field); a good duration is long enough so that a single
+       * outlier does not generate spurious alerts, but short enough that
+       * unhealthy states are detected and alerted on quickly.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; } + + public static final int TRIGGER_FIELD_NUMBER = 3; + private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; /** * * *
-       * Optional. A map from a label key to an extractor expression, which is
-       * used to extract the value for this label key. Each entry in this map is
-       * a specification for how data should be extracted from log entries that
-       * match `filter`. Each combination of extracted values is treated as a
-       * separate rule for the purposes of triggering notifications. Label keys
-       * and corresponding values can be used in notifications generated by this
-       * condition.
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`,
+       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+       * are specified.
+       * 
* - * Please see [the documentation on logs-based metric - * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) - * for syntax and examples. + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * + * @return Whether the trigger field is set. + */ + @java.lang.Override + public boolean hasTrigger() { + return trigger_ != null; + } + /** + * + * + *
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`,
+       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+       * are specified.
        * 
* - * map<string, string> label_extractors = 2; + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * + * @return The trigger. */ @java.lang.Override - public boolean containsLabelExtractors(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabelExtractors().getMap().containsKey(key); - } - /** Use {@link #getLabelExtractorsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabelExtractors() { - return getLabelExtractorsMap(); + public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; } /** * * *
-       * Optional. A map from a label key to an extractor expression, which is
-       * used to extract the value for this label key. Each entry in this map is
-       * a specification for how data should be extracted from log entries that
-       * match `filter`. Each combination of extracted values is treated as a
-       * separate rule for the purposes of triggering notifications. Label keys
-       * and corresponding values can be used in notifications generated by this
-       * condition.
-       *
-       * Please see [the documentation on logs-based metric
-       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-       * for syntax and examples.
+       * The number/percent of time series for which the comparison must hold
+       * in order for the condition to trigger. If unspecified, then the
+       * condition will trigger if the comparison is true for any of the
+       * time series that have been identified by `filter` and `aggregations`,
+       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+       * are specified.
        * 
* - * map<string, string> label_extractors = 2; + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; */ @java.lang.Override - public java.util.Map getLabelExtractorsMap() { - return internalGetLabelExtractors().getMap(); + public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder() { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; } + + public static final int EVALUATION_MISSING_DATA_FIELD_NUMBER = 4; + private int evaluationMissingData_ = 0; /** * * *
-       * Optional. A map from a label key to an extractor expression, which is
-       * used to extract the value for this label key. Each entry in this map is
-       * a specification for how data should be extracted from log entries that
-       * match `filter`. Each combination of extracted values is treated as a
-       * separate rule for the purposes of triggering notifications. Label keys
-       * and corresponding values can be used in notifications generated by this
-       * condition.
-       *
-       * Please see [the documentation on logs-based metric
-       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-       * for syntax and examples.
+       * A condition control that determines how metric-threshold conditions
+       * are evaluated when data stops arriving.
        * 
* - * map<string, string> label_extractors = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * + * + * @return The enum numeric value on the wire for evaluationMissingData. */ @java.lang.Override - public /* nullable */ java.lang.String getLabelExtractorsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = - internalGetLabelExtractors().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + public int getEvaluationMissingDataValue() { + return evaluationMissingData_; } /** * * *
-       * Optional. A map from a label key to an extractor expression, which is
-       * used to extract the value for this label key. Each entry in this map is
-       * a specification for how data should be extracted from log entries that
-       * match `filter`. Each combination of extracted values is treated as a
-       * separate rule for the purposes of triggering notifications. Label keys
-       * and corresponding values can be used in notifications generated by this
-       * condition.
-       *
-       * Please see [the documentation on logs-based metric
-       * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-       * for syntax and examples.
+       * A condition control that determines how metric-threshold conditions
+       * are evaluated when data stops arriving.
        * 
* - * map<string, string> label_extractors = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * + * + * @return The evaluationMissingData. */ @java.lang.Override - public java.lang.String getLabelExtractorsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = - internalGetLabelExtractors().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); + public com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData + getEvaluationMissingData() { + com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData result = + com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.forNumber( + evaluationMissingData_); + return result == null + ? com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.UNRECOGNIZED + : result; } private byte memoizedIsInitialized = -1; @@ -9270,14 +12232,21 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filter_); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_); + } + if (duration_ != null) { + output.writeMessage(2, getDuration()); + } + if (trigger_ != null) { + output.writeMessage(3, getTrigger()); + } + if (evaluationMissingData_ + != com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData + .EVALUATION_MISSING_DATA_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, evaluationMissingData_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, - internalGetLabelExtractors(), - LabelExtractorsDefaultEntryHolder.defaultEntry, - 2); getUnknownFields().writeTo(output); } @@ -9287,18 +12256,20 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filter_); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_); } - for (java.util.Map.Entry entry : - internalGetLabelExtractors().getMap().entrySet()) { - com.google.protobuf.MapEntry labelExtractors__ = - LabelExtractorsDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labelExtractors__); + if (duration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDuration()); + } + if (trigger_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTrigger()); + } + if (evaluationMissingData_ + != com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData + .EVALUATION_MISSING_DATA_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, evaluationMissingData_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -9310,14 +12281,24 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.monitoring.v3.AlertPolicy.Condition.LogMatch)) { + if (!(obj + instanceof + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition)) { return super.equals(obj); } - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch other = - (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) obj; + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition other = + (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) obj; - if (!getFilter().equals(other.getFilter())) return false; - if (!internalGetLabelExtractors().equals(other.internalGetLabelExtractors())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) return false; + } + if (hasTrigger() != other.hasTrigger()) return false; + if (hasTrigger()) { + if (!getTrigger().equals(other.getTrigger())) return false; + } + if (evaluationMissingData_ != other.evaluationMissingData_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -9329,85 +12310,99 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + FILTER_FIELD_NUMBER; - hash = (53 * hash) + getFilter().hashCode(); - if (!internalGetLabelExtractors().getMap().isEmpty()) { - hash = (37 * hash) + LABEL_EXTRACTORS_FIELD_NUMBER; - hash = (53 * hash) + internalGetLabelExtractors().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); + } + if (hasTrigger()) { + hash = (37 * hash) + TRIGGER_FIELD_NUMBER; + hash = (53 * hash) + getTrigger().hashCode(); } + hash = (37 * hash) + EVALUATION_MISSING_DATA_FIELD_NUMBER; + hash = (53 * hash) + evaluationMissingData_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( - java.io.InputStream input) throws java.io.IOException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @@ -9422,7 +12417,8 @@ public static Builder newBuilder() { } public static Builder newBuilder( - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch prototype) { + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -9441,55 +12437,37 @@ protected Builder newBuilderForType( * * *
-       * A condition type that checks whether a log message in the [scoping
-       * project](https://cloud.google.com/monitoring/api/v3#project_name)
-       * satisfies the given filter. Logs from other projects in the metrics
-       * scope are not evaluated.
+       * A condition type that allows alert policies to be defined using
+       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
        * 
* - * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition.LogMatch} + * Protobuf type {@code + * google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition.LogMatch) - com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder { + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageConditionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 2: - return internalGetLabelExtractors(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 2: - return internalGetMutableLabelExtractors(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_fieldAccessorTable + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.class, - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder.class); + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .class, + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .Builder.class); } - // Construct using com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.newBuilder() + // Construct using + // com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -9500,241 +12478,687 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { public Builder clear() { super.clear(); bitField0_ = 0; - filter_ = ""; - internalGetMutableLabelExtractors().clear(); + query_ = ""; + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + trigger_ = null; + if (triggerBuilder_ != null) { + triggerBuilder_.dispose(); + triggerBuilder_ = null; + } + evaluationMissingData_ = 0; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_LogMatch_descriptor; + .internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + getDefaultInstanceForType() { + return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + build() { + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + buildPartial() { + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition result = + new com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.query_ = query_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.trigger_ = triggerBuilder_ == null ? trigger_ : triggerBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.evaluationMissingData_ = evaluationMissingData_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) { + return mergeFrom( + (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition other) { + if (other + == com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .getDefaultInstance()) return this; + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + if (other.hasTrigger()) { + mergeTrigger(other.getTrigger()); + } + if (other.evaluationMissingData_ != 0) { + setEvaluationMissingDataValue(other.getEvaluationMissingDataValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + query_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getTriggerFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + evaluationMissingData_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; } - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch getDefaultInstanceForType() { - return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); - } + private int bitField0_; - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch build() { - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + private java.lang.Object query_ = ""; + /** + * + * + *
+         * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+         * query that outputs a boolean stream.
+         * 
+ * + * string query = 1; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; } - return result; } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch buildPartial() { - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch result = - new com.google.monitoring.v3.AlertPolicy.Condition.LogMatch(this); - if (bitField0_ != 0) { - buildPartial0(result); + /** + * + * + *
+         * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+         * query that outputs a boolean stream.
+         * 
+ * + * string query = 1; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - onBuilt(); - return result; } - - private void buildPartial0(com.google.monitoring.v3.AlertPolicy.Condition.LogMatch result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.filter_ = filter_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.labelExtractors_ = internalGetLabelExtractors(); - result.labelExtractors_.makeImmutable(); + /** + * + * + *
+         * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+         * query that outputs a boolean stream.
+         * 
+ * + * string query = 1; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } + query_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + /** + * + * + *
+         * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+         * query that outputs a boolean stream.
+         * 
+ * + * string query = 1; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + /** + * + * + *
+         * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+         * query that outputs a boolean stream.
+         * 
+ * + * string query = 1; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + query_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); + private com.google.protobuf.Duration duration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + durationBuilder_; + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return ((bitField0_ & 0x00000002) != 0); } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + public com.google.protobuf.Duration getDuration() { + if (durationBuilder_ == null) { + return duration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : duration_; + } else { + return durationBuilder_.getMessage(); + } } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) { - return mergeFrom((com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) other); + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + } else { + durationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); } else { - super.mergeFrom(other); - return this; + durationBuilder_.setMessage(builderForValue.build()); } + bitField0_ |= 0x00000002; + onChanged(); + return this; } - - public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy.Condition.LogMatch other) { - if (other == com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance()) - return this; - if (!other.getFilter().isEmpty()) { - filter_ = other.filter_; - bitField0_ |= 0x00000001; - onChanged(); + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && duration_ != null + && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDurationBuilder().mergeFrom(value); + } else { + duration_ = value; + } + } else { + durationBuilder_.mergeFrom(value); } - internalGetMutableLabelExtractors().mergeFrom(other.internalGetLabelExtractors()); bitField0_ |= 0x00000002; - this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder clearDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - filter_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - com.google.protobuf.MapEntry - labelExtractors__ = - input.readMessage( - LabelExtractorsDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableLabelExtractors() - .getMutableMap() - .put(labelExtractors__.getKey(), labelExtractors__.getValue()); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally + onChanged(); return this; } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : duration_; + } + } + /** + * + * + *
+         * The amount of time that a time series must violate the
+         * threshold to be considered failing. Currently, only values
+         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
+         * seconds--are supported. If an invalid value is given, an
+         * error will be returned. When choosing a duration, it is useful to
+         * keep in mind the frequency of the underlying time series data
+         * (which may also be affected by any alignments specified in the
+         * `aggregations` field); a good duration is long enough so that a single
+         * outlier does not generate spurious alerts, but short enough that
+         * unhealthy states are detected and alerted on quickly.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDurationFieldBuilder() { + if (durationBuilder_ == null) { + durationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDuration(), getParentForChildren(), isClean()); + duration_ = null; + } + return durationBuilder_; + } - private int bitField0_; - - private java.lang.Object filter_ = ""; + private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.Trigger, + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> + triggerBuilder_; + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * + * @return Whether the trigger field is set. + */ + public boolean hasTrigger() { + return ((bitField0_ & 0x00000004) != 0); + } /** * * *
-         * Required. A logs-based filter. See [Advanced Logs
-         * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
-         * for how this filter should be constructed.
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
          * 
* - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; * - * @return The filter. + * @return The trigger. */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; + public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { + if (triggerBuilder_ == null) { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; } else { - return (java.lang.String) ref; + return triggerBuilder_.getMessage(); } } /** * * *
-         * Required. A logs-based filter. See [Advanced Logs
-         * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
-         * for how this filter should be constructed.
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
          * 
* - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for filter. + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; */ - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; + public Builder setTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { + if (triggerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + trigger_ = value; } else { - return (com.google.protobuf.ByteString) ref; + triggerBuilder_.setMessage(value); } + bitField0_ |= 0x00000004; + onChanged(); + return this; } /** * * *
-         * Required. A logs-based filter. See [Advanced Logs
-         * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
-         * for how this filter should be constructed.
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
          * 
* - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The filter to set. - * @return This builder for chaining. + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; */ - public Builder setFilter(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder setTrigger( + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder builderForValue) { + if (triggerBuilder_ == null) { + trigger_ = builderForValue.build(); + } else { + triggerBuilder_.setMessage(builderForValue.build()); } - filter_ = value; - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -9742,18 +13166,31 @@ public Builder setFilter(java.lang.String value) { * * *
-         * Required. A logs-based filter. See [Advanced Logs
-         * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
-         * for how this filter should be constructed.
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
          * 
* - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; */ - public Builder clearFilter() { - filter_ = getDefaultInstance().getFilter(); - bitField0_ = (bitField0_ & ~0x00000001); + public Builder mergeTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { + if (triggerBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && trigger_ != null + && trigger_ + != com.google.monitoring.v3.AlertPolicy.Condition.Trigger + .getDefaultInstance()) { + getTriggerBuilder().mergeFrom(value); + } else { + trigger_ = value; + } + } else { + triggerBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -9761,264 +13198,207 @@ public Builder clearFilter() { * * *
-         * Required. A logs-based filter. See [Advanced Logs
-         * Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
-         * for how this filter should be constructed.
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
          * 
* - * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for filter to set. - * @return This builder for chaining. + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; */ - public Builder setFilterBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder clearTrigger() { + bitField0_ = (bitField0_ & ~0x00000004); + trigger_ = null; + if (triggerBuilder_ != null) { + triggerBuilder_.dispose(); + triggerBuilder_ = null; } - checkByteStringIsUtf8(value); - filter_ = value; - bitField0_ |= 0x00000001; onChanged(); return this; } - - private com.google.protobuf.MapField labelExtractors_; - - private com.google.protobuf.MapField - internalGetLabelExtractors() { - if (labelExtractors_ == null) { - return com.google.protobuf.MapField.emptyMapField( - LabelExtractorsDefaultEntryHolder.defaultEntry); - } - return labelExtractors_; - } - - private com.google.protobuf.MapField - internalGetMutableLabelExtractors() { - if (labelExtractors_ == null) { - labelExtractors_ = - com.google.protobuf.MapField.newMapField( - LabelExtractorsDefaultEntryHolder.defaultEntry); - } - if (!labelExtractors_.isMutable()) { - labelExtractors_ = labelExtractors_.copy(); - } - bitField0_ |= 0x00000002; + /** + * + * + *
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + public com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder getTriggerBuilder() { + bitField0_ |= 0x00000004; onChanged(); - return labelExtractors_; - } - - public int getLabelExtractorsCount() { - return internalGetLabelExtractors().getMap().size(); + return getTriggerFieldBuilder().getBuilder(); } /** * * *
-         * Optional. A map from a label key to an extractor expression, which is
-         * used to extract the value for this label key. Each entry in this map is
-         * a specification for how data should be extracted from log entries that
-         * match `filter`. Each combination of extracted values is treated as a
-         * separate rule for the purposes of triggering notifications. Label keys
-         * and corresponding values can be used in notifications generated by this
-         * condition.
-         *
-         * Please see [the documentation on logs-based metric
-         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-         * for syntax and examples.
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
          * 
* - * map<string, string> label_extractors = 2; + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; */ - @java.lang.Override - public boolean containsLabelExtractors(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); + public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder + getTriggerOrBuilder() { + if (triggerBuilder_ != null) { + return triggerBuilder_.getMessageOrBuilder(); + } else { + return trigger_ == null + ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() + : trigger_; } - return internalGetLabelExtractors().getMap().containsKey(key); - } - /** Use {@link #getLabelExtractorsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabelExtractors() { - return getLabelExtractorsMap(); } /** * * *
-         * Optional. A map from a label key to an extractor expression, which is
-         * used to extract the value for this label key. Each entry in this map is
-         * a specification for how data should be extracted from log entries that
-         * match `filter`. Each combination of extracted values is treated as a
-         * separate rule for the purposes of triggering notifications. Label keys
-         * and corresponding values can be used in notifications generated by this
-         * condition.
-         *
-         * Please see [the documentation on logs-based metric
-         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-         * for syntax and examples.
+         * The number/percent of time series for which the comparison must hold
+         * in order for the condition to trigger. If unspecified, then the
+         * condition will trigger if the comparison is true for any of the
+         * time series that have been identified by `filter` and `aggregations`,
+         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+         * are specified.
          * 
* - * map<string, string> label_extractors = 2; + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; */ - @java.lang.Override - public java.util.Map getLabelExtractorsMap() { - return internalGetLabelExtractors().getMap(); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.Trigger, + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> + getTriggerFieldBuilder() { + if (triggerBuilder_ == null) { + triggerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.Trigger, + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder>( + getTrigger(), getParentForChildren(), isClean()); + trigger_ = null; + } + return triggerBuilder_; } + + private int evaluationMissingData_ = 0; /** * * *
-         * Optional. A map from a label key to an extractor expression, which is
-         * used to extract the value for this label key. Each entry in this map is
-         * a specification for how data should be extracted from log entries that
-         * match `filter`. Each combination of extracted values is treated as a
-         * separate rule for the purposes of triggering notifications. Label keys
-         * and corresponding values can be used in notifications generated by this
-         * condition.
-         *
-         * Please see [the documentation on logs-based metric
-         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-         * for syntax and examples.
+         * A condition control that determines how metric-threshold conditions
+         * are evaluated when data stops arriving.
          * 
* - * map<string, string> label_extractors = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * + * + * @return The enum numeric value on the wire for evaluationMissingData. */ @java.lang.Override - public /* nullable */ java.lang.String getLabelExtractorsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = - internalGetLabelExtractors().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + public int getEvaluationMissingDataValue() { + return evaluationMissingData_; } /** * * *
-         * Optional. A map from a label key to an extractor expression, which is
-         * used to extract the value for this label key. Each entry in this map is
-         * a specification for how data should be extracted from log entries that
-         * match `filter`. Each combination of extracted values is treated as a
-         * separate rule for the purposes of triggering notifications. Label keys
-         * and corresponding values can be used in notifications generated by this
-         * condition.
-         *
-         * Please see [the documentation on logs-based metric
-         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-         * for syntax and examples.
+         * A condition control that determines how metric-threshold conditions
+         * are evaluated when data stops arriving.
          * 
* - * map<string, string> label_extractors = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * + * + * @param value The enum numeric value on the wire for evaluationMissingData to set. + * @return This builder for chaining. */ - @java.lang.Override - public java.lang.String getLabelExtractorsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = - internalGetLabelExtractors().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearLabelExtractors() { - bitField0_ = (bitField0_ & ~0x00000002); - internalGetMutableLabelExtractors().getMutableMap().clear(); + public Builder setEvaluationMissingDataValue(int value) { + evaluationMissingData_ = value; + bitField0_ |= 0x00000008; + onChanged(); return this; } /** * * *
-         * Optional. A map from a label key to an extractor expression, which is
-         * used to extract the value for this label key. Each entry in this map is
-         * a specification for how data should be extracted from log entries that
-         * match `filter`. Each combination of extracted values is treated as a
-         * separate rule for the purposes of triggering notifications. Label keys
-         * and corresponding values can be used in notifications generated by this
-         * condition.
-         *
-         * Please see [the documentation on logs-based metric
-         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-         * for syntax and examples.
+         * A condition control that determines how metric-threshold conditions
+         * are evaluated when data stops arriving.
          * 
* - * map<string, string> label_extractors = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * + * + * @return The evaluationMissingData. */ - public Builder removeLabelExtractors(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - internalGetMutableLabelExtractors().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableLabelExtractors() { - bitField0_ |= 0x00000002; - return internalGetMutableLabelExtractors().getMutableMap(); + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData + getEvaluationMissingData() { + com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData result = + com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.forNumber( + evaluationMissingData_); + return result == null + ? com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.UNRECOGNIZED + : result; } /** * * *
-         * Optional. A map from a label key to an extractor expression, which is
-         * used to extract the value for this label key. Each entry in this map is
-         * a specification for how data should be extracted from log entries that
-         * match `filter`. Each combination of extracted values is treated as a
-         * separate rule for the purposes of triggering notifications. Label keys
-         * and corresponding values can be used in notifications generated by this
-         * condition.
-         *
-         * Please see [the documentation on logs-based metric
-         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-         * for syntax and examples.
+         * A condition control that determines how metric-threshold conditions
+         * are evaluated when data stops arriving.
          * 
* - * map<string, string> label_extractors = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * + * + * @param value The evaluationMissingData to set. + * @return This builder for chaining. */ - public Builder putLabelExtractors(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new NullPointerException("map key"); - } + public Builder setEvaluationMissingData( + com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData value) { if (value == null) { - throw new NullPointerException("map value"); + throw new NullPointerException(); } - internalGetMutableLabelExtractors().getMutableMap().put(key, value); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000008; + evaluationMissingData_ = value.getNumber(); + onChanged(); return this; } /** * * *
-         * Optional. A map from a label key to an extractor expression, which is
-         * used to extract the value for this label key. Each entry in this map is
-         * a specification for how data should be extracted from log entries that
-         * match `filter`. Each combination of extracted values is treated as a
-         * separate rule for the purposes of triggering notifications. Label keys
-         * and corresponding values can be used in notifications generated by this
-         * condition.
-         *
-         * Please see [the documentation on logs-based metric
-         * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
-         * for syntax and examples.
+         * A condition control that determines how metric-threshold conditions
+         * are evaluated when data stops arriving.
          * 
* - * map<string, string> label_extractors = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * + * + * @return This builder for chaining. */ - public Builder putAllLabelExtractors( - java.util.Map values) { - internalGetMutableLabelExtractors().getMutableMap().putAll(values); - bitField0_ |= 0x00000002; + public Builder clearEvaluationMissingData() { + bitField0_ = (bitField0_ & ~0x00000008); + evaluationMissingData_ = 0; + onChanged(); return this; } @@ -10034,24 +13414,28 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition.LogMatch) + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) } - // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition.LogMatch) - private static final com.google.monitoring.v3.AlertPolicy.Condition.LogMatch DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + private static final com.google.monitoring.v3.AlertPolicy.Condition + .MonitoringQueryLanguageCondition + DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.monitoring.v3.AlertPolicy.Condition.LogMatch(); + DEFAULT_INSTANCE = + new com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition(); } - public static com.google.monitoring.v3.AlertPolicy.Condition.LogMatch getDefaultInstance() { + public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public LogMatch parsePartialFrom( + public MonitoringQueryLanguageCondition parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -10071,245 +13455,443 @@ public LogMatch parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch getDefaultInstanceForType() { + public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface MonitoringQueryLanguageConditionOrBuilder + public interface PrometheusQueryLanguageConditionOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) com.google.protobuf.MessageOrBuilder { /** * * *
-       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
-       * query that outputs a boolean stream.
+       * Required. The PromQL expression to evaluate. Every evaluation cycle
+       * this expression is evaluated at the current time, and all resultant
+       * time series become pending/firing alerts. This field must not be empty.
+       * 
+ * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+       * Required. The PromQL expression to evaluate. Every evaluation cycle
+       * this expression is evaluated at the current time, and all resultant
+       * time series become pending/firing alerts. This field must not be empty.
+       * 
+ * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+       * Optional. Alerts are considered firing once their PromQL expression was
+       * evaluated to be "true" for this long.
+       * Alerts whose PromQL expression was not evaluated to be "true" for
+       * long enough are considered pending.
+       * Must be a non-negative duration or missing.
+       * This field is optional. Its default value is zero.
+       * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the duration field is set. + */ + boolean hasDuration(); + /** + * + * + *
+       * Optional. Alerts are considered firing once their PromQL expression was
+       * evaluated to be "true" for this long.
+       * Alerts whose PromQL expression was not evaluated to be "true" for
+       * long enough are considered pending.
+       * Must be a non-negative duration or missing.
+       * This field is optional. Its default value is zero.
+       * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + /** + * + * + *
+       * Optional. Alerts are considered firing once their PromQL expression was
+       * evaluated to be "true" for this long.
+       * Alerts whose PromQL expression was not evaluated to be "true" for
+       * long enough are considered pending.
+       * Must be a non-negative duration or missing.
+       * This field is optional. Its default value is zero.
+       * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); + + /** + * + * + *
+       * Optional. How often this rule should be evaluated.
+       * Must be a positive multiple of 30 seconds or missing.
+       * This field is optional. Its default value is 30 seconds.
+       * If this PrometheusQueryLanguageCondition was generated from a
+       * Prometheus alerting rule, then this value should be taken from the
+       * enclosing rule group.
        * 
* - * string query = 1; + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * * - * @return The query. + * @return Whether the evaluationInterval field is set. */ - java.lang.String getQuery(); + boolean hasEvaluationInterval(); /** * * *
-       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
-       * query that outputs a boolean stream.
+       * Optional. How often this rule should be evaluated.
+       * Must be a positive multiple of 30 seconds or missing.
+       * This field is optional. Its default value is 30 seconds.
+       * If this PrometheusQueryLanguageCondition was generated from a
+       * Prometheus alerting rule, then this value should be taken from the
+       * enclosing rule group.
        * 
* - * string query = 1; + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * * - * @return The bytes for query. + * @return The evaluationInterval. */ - com.google.protobuf.ByteString getQueryBytes(); - + com.google.protobuf.Duration getEvaluationInterval(); /** * * *
-       * The amount of time that a time series must violate the
-       * threshold to be considered failing. Currently, only values
-       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
-       * error will be returned. When choosing a duration, it is useful to
-       * keep in mind the frequency of the underlying time series data
-       * (which may also be affected by any alignments specified in the
-       * `aggregations` field); a good duration is long enough so that a single
-       * outlier does not generate spurious alerts, but short enough that
-       * unhealthy states are detected and alerted on quickly.
+       * Optional. How often this rule should be evaluated.
+       * Must be a positive multiple of 30 seconds or missing.
+       * This field is optional. Its default value is 30 seconds.
+       * If this PrometheusQueryLanguageCondition was generated from a
+       * Prometheus alerting rule, then this value should be taken from the
+       * enclosing rule group.
        * 
* - * .google.protobuf.Duration duration = 2; - * - * @return Whether the duration field is set. + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ - boolean hasDuration(); + com.google.protobuf.DurationOrBuilder getEvaluationIntervalOrBuilder(); + /** * * *
-       * The amount of time that a time series must violate the
-       * threshold to be considered failing. Currently, only values
-       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
-       * error will be returned. When choosing a duration, it is useful to
-       * keep in mind the frequency of the underlying time series data
-       * (which may also be affected by any alignments specified in the
-       * `aggregations` field); a good duration is long enough so that a single
-       * outlier does not generate spurious alerts, but short enough that
-       * unhealthy states are detected and alerted on quickly.
+       * Optional. Labels to add to or overwrite in the PromQL query result.
+       * Label names [must be
+       * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * Label values can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * The only available variable names are the names of the labels in the
+       * PromQL result, including "__name__" and "value". "labels" may be empty.
        * 
* - * .google.protobuf.Duration duration = 2; + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getLabelsCount(); + /** * - * @return The duration. + * + *
+       * Optional. Labels to add to or overwrite in the PromQL query result.
+       * Label names [must be
+       * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * Label values can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * The only available variable names are the names of the labels in the
+       * PromQL result, including "__name__" and "value". "labels" may be empty.
+       * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ - com.google.protobuf.Duration getDuration(); + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); /** * * *
-       * The amount of time that a time series must violate the
-       * threshold to be considered failing. Currently, only values
-       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
-       * error will be returned. When choosing a duration, it is useful to
-       * keep in mind the frequency of the underlying time series data
-       * (which may also be affected by any alignments specified in the
-       * `aggregations` field); a good duration is long enough so that a single
-       * outlier does not generate spurious alerts, but short enough that
-       * unhealthy states are detected and alerted on quickly.
+       * Optional. Labels to add to or overwrite in the PromQL query result.
+       * Label names [must be
+       * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * Label values can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * The only available variable names are the names of the labels in the
+       * PromQL result, including "__name__" and "value". "labels" may be empty.
        * 
* - * .google.protobuf.Duration duration = 2; + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ - com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); - + java.util.Map getLabelsMap(); /** * * *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`,
-       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-       * are specified.
+       * Optional. Labels to add to or overwrite in the PromQL query result.
+       * Label names [must be
+       * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * Label values can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * The only available variable names are the names of the labels in the
+       * PromQL result, including "__name__" and "value". "labels" may be empty.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** * - * @return Whether the trigger field is set. + * + *
+       * Optional. Labels to add to or overwrite in the PromQL query result.
+       * Label names [must be
+       * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * Label values can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * The only available variable names are the names of the labels in the
+       * PromQL result, including "__name__" and "value". "labels" may be empty.
+       * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ - boolean hasTrigger(); + java.lang.String getLabelsOrThrow(java.lang.String key); + /** * * *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`,
-       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-       * are specified.
+       * Optional. The rule group name of this alert in the corresponding
+       * Prometheus configuration file.
+       *
+       * Some external tools may require this field to be populated correctly
+       * in order to refer to the original Prometheus configuration file.
+       * The rule group name and the alert name are necessary to update the
+       * relevant AlertPolicies in case the definition of the rule group changes
+       * in the future.
+       *
+       * This field is optional. If this field is not empty, then it must
+       * contain a valid UTF-8 string.
+       * This field may not exceed 2048 Unicode characters in length.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; * - * @return The trigger. + * @return The ruleGroup. */ - com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger(); + java.lang.String getRuleGroup(); /** * * *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`,
-       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-       * are specified.
+       * Optional. The rule group name of this alert in the corresponding
+       * Prometheus configuration file.
+       *
+       * Some external tools may require this field to be populated correctly
+       * in order to refer to the original Prometheus configuration file.
+       * The rule group name and the alert name are necessary to update the
+       * relevant AlertPolicies in case the definition of the rule group changes
+       * in the future.
+       *
+       * This field is optional. If this field is not empty, then it must
+       * contain a valid UTF-8 string.
+       * This field may not exceed 2048 Unicode characters in length.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for ruleGroup. */ - com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder(); + com.google.protobuf.ByteString getRuleGroupBytes(); /** * * *
-       * A condition control that determines how metric-threshold conditions
-       * are evaluated when data stops arriving.
+       * Optional. The alerting rule name of this alert in the corresponding
+       * Prometheus configuration file.
+       *
+       * Some external tools may require this field to be populated correctly
+       * in order to refer to the original Prometheus configuration file.
+       * The rule group name and the alert name are necessary to update the
+       * relevant AlertPolicies in case the definition of the rule group changes
+       * in the future.
+       *
+       * This field is optional. If this field is not empty, then it must be a
+       * [valid Prometheus label
+       * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * This field may not exceed 2048 Unicode characters in length.
        * 
* - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * + * string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; * - * @return The enum numeric value on the wire for evaluationMissingData. + * @return The alertRule. */ - int getEvaluationMissingDataValue(); + java.lang.String getAlertRule(); /** * * *
-       * A condition control that determines how metric-threshold conditions
-       * are evaluated when data stops arriving.
+       * Optional. The alerting rule name of this alert in the corresponding
+       * Prometheus configuration file.
+       *
+       * Some external tools may require this field to be populated correctly
+       * in order to refer to the original Prometheus configuration file.
+       * The rule group name and the alert name are necessary to update the
+       * relevant AlertPolicies in case the definition of the rule group changes
+       * in the future.
+       *
+       * This field is optional. If this field is not empty, then it must be a
+       * [valid Prometheus label
+       * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * This field may not exceed 2048 Unicode characters in length.
        * 
* - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * + * string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; * - * @return The evaluationMissingData. + * @return The bytes for alertRule. */ - com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData - getEvaluationMissingData(); + com.google.protobuf.ByteString getAlertRuleBytes(); } /** * * *
      * A condition type that allows alert policies to be defined using
-     * [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
+     * [Prometheus Query Language
+     * (PromQL)](https://prometheus.io/docs/prometheus/latest/querying/basics/).
+     *
+     * The PrometheusQueryLanguageCondition message contains information
+     * from a Prometheus alerting rule and its associated rule group.
+     *
+     * A Prometheus alerting rule is described
+     * [here](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/).
+     * The semantics of a Prometheus alerting rule is described
+     * [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule).
+     *
+     * A Prometheus rule group is described
+     * [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/).
+     * The semantics of a Prometheus rule group is described
+     * [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule_group).
+     *
+     * Because Cloud Alerting has no representation of a Prometheus rule
+     * group resource, we must embed the information of the parent rule
+     * group inside each of the conditions that refer to it. We must also
+     * update the contents of all Prometheus alerts in case the information
+     * of their rule group changes.
+     *
+     * The PrometheusQueryLanguageCondition protocol buffer combines the
+     * information of the corresponding rule group and alerting rule.
+     * The structure of the PrometheusQueryLanguageCondition protocol buffer
+     * does NOT mimic the structure of the Prometheus rule group and alerting
+     * rule YAML declarations. The PrometheusQueryLanguageCondition protocol
+     * buffer may change in the future to support future rule group and/or
+     * alerting rule features. There are no new such features at the present
+     * time (2023-06-26).
      * 
* * Protobuf type {@code - * google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition} + * google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition} */ - public static final class MonitoringQueryLanguageCondition + public static final class PrometheusQueryLanguageCondition extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) - MonitoringQueryLanguageConditionOrBuilder { + // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) + PrometheusQueryLanguageConditionOrBuilder { private static final long serialVersionUID = 0L; - // Use MonitoringQueryLanguageCondition.newBuilder() to construct. - private MonitoringQueryLanguageCondition( + // Use PrometheusQueryLanguageCondition.newBuilder() to construct. + private PrometheusQueryLanguageCondition( com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private MonitoringQueryLanguageCondition() { + private PrometheusQueryLanguageCondition() { query_ = ""; - evaluationMissingData_ = 0; + ruleGroup_ = ""; + alertRule_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MonitoringQueryLanguageCondition(); + return new PrometheusQueryLanguageCondition(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_descriptor; + .internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_fieldAccessorTable + .internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition .class, - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition .Builder.class); } @@ -10321,11 +13903,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
-       * query that outputs a boolean stream.
+       * Required. The PromQL expression to evaluate. Every evaluation cycle
+       * this expression is evaluated at the current time, and all resultant
+       * time series become pending/firing alerts. This field must not be empty.
        * 
* - * string query = 1; + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The query. */ @@ -10345,11 +13928,12 @@ public java.lang.String getQuery() { * * *
-       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
-       * query that outputs a boolean stream.
+       * Required. The PromQL expression to evaluate. Every evaluation cycle
+       * this expression is evaluated at the current time, and all resultant
+       * time series become pending/firing alerts. This field must not be empty.
        * 
* - * string query = 1; + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for query. */ @@ -10366,187 +13950,417 @@ public com.google.protobuf.ByteString getQueryBytes() { } } - public static final int DURATION_FIELD_NUMBER = 2; - private com.google.protobuf.Duration duration_; + public static final int DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration duration_; + /** + * + * + *
+       * Optional. Alerts are considered firing once their PromQL expression was
+       * evaluated to be "true" for this long.
+       * Alerts whose PromQL expression was not evaluated to be "true" for
+       * long enough are considered pending.
+       * Must be a non-negative duration or missing.
+       * This field is optional. Its default value is zero.
+       * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return duration_ != null; + } + /** + * + * + *
+       * Optional. Alerts are considered firing once their PromQL expression was
+       * evaluated to be "true" for this long.
+       * Alerts whose PromQL expression was not evaluated to be "true" for
+       * long enough are considered pending.
+       * Must be a non-negative duration or missing.
+       * This field is optional. Its default value is zero.
+       * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The duration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + /** + * + * + *
+       * Optional. Alerts are considered firing once their PromQL expression was
+       * evaluated to be "true" for this long.
+       * Alerts whose PromQL expression was not evaluated to be "true" for
+       * long enough are considered pending.
+       * Must be a non-negative duration or missing.
+       * This field is optional. Its default value is zero.
+       * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + + public static final int EVALUATION_INTERVAL_FIELD_NUMBER = 3; + private com.google.protobuf.Duration evaluationInterval_; + /** + * + * + *
+       * Optional. How often this rule should be evaluated.
+       * Must be a positive multiple of 30 seconds or missing.
+       * This field is optional. Its default value is 30 seconds.
+       * If this PrometheusQueryLanguageCondition was generated from a
+       * Prometheus alerting rule, then this value should be taken from the
+       * enclosing rule group.
+       * 
+ * + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the evaluationInterval field is set. + */ + @java.lang.Override + public boolean hasEvaluationInterval() { + return evaluationInterval_ != null; + } + /** + * + * + *
+       * Optional. How often this rule should be evaluated.
+       * Must be a positive multiple of 30 seconds or missing.
+       * This field is optional. Its default value is 30 seconds.
+       * If this PrometheusQueryLanguageCondition was generated from a
+       * Prometheus alerting rule, then this value should be taken from the
+       * enclosing rule group.
+       * 
+ * + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The evaluationInterval. + */ + @java.lang.Override + public com.google.protobuf.Duration getEvaluationInterval() { + return evaluationInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : evaluationInterval_; + } + /** + * + * + *
+       * Optional. How often this rule should be evaluated.
+       * Must be a positive multiple of 30 seconds or missing.
+       * This field is optional. Its default value is 30 seconds.
+       * If this PrometheusQueryLanguageCondition was generated from a
+       * Prometheus alerting rule, then this value should be taken from the
+       * enclosing rule group.
+       * 
+ * + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getEvaluationIntervalOrBuilder() { + return evaluationInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : evaluationInterval_; + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } /** * * *
-       * The amount of time that a time series must violate the
-       * threshold to be considered failing. Currently, only values
-       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
-       * error will be returned. When choosing a duration, it is useful to
-       * keep in mind the frequency of the underlying time series data
-       * (which may also be affected by any alignments specified in the
-       * `aggregations` field); a good duration is long enough so that a single
-       * outlier does not generate spurious alerts, but short enough that
-       * unhealthy states are detected and alerted on quickly.
+       * Optional. Labels to add to or overwrite in the PromQL query result.
+       * Label names [must be
+       * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * Label values can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * The only available variable names are the names of the labels in the
+       * PromQL result, including "__name__" and "value". "labels" may be empty.
        * 
* - * .google.protobuf.Duration duration = 2; - * - * @return Whether the duration field is set. + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ @java.lang.Override - public boolean hasDuration() { - return duration_ != null; + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); } /** * * *
-       * The amount of time that a time series must violate the
-       * threshold to be considered failing. Currently, only values
-       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
-       * error will be returned. When choosing a duration, it is useful to
-       * keep in mind the frequency of the underlying time series data
-       * (which may also be affected by any alignments specified in the
-       * `aggregations` field); a good duration is long enough so that a single
-       * outlier does not generate spurious alerts, but short enough that
-       * unhealthy states are detected and alerted on quickly.
+       * Optional. Labels to add to or overwrite in the PromQL query result.
+       * Label names [must be
+       * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * Label values can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * The only available variable names are the names of the labels in the
+       * PromQL result, including "__name__" and "value". "labels" may be empty.
        * 
* - * .google.protobuf.Duration duration = 2; - * - * @return The duration. + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ @java.lang.Override - public com.google.protobuf.Duration getDuration() { - return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); } /** * * *
-       * The amount of time that a time series must violate the
-       * threshold to be considered failing. Currently, only values
-       * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
-       * error will be returned. When choosing a duration, it is useful to
-       * keep in mind the frequency of the underlying time series data
-       * (which may also be affected by any alignments specified in the
-       * `aggregations` field); a good duration is long enough so that a single
-       * outlier does not generate spurious alerts, but short enough that
-       * unhealthy states are detected and alerted on quickly.
+       * Optional. Labels to add to or overwrite in the PromQL query result.
+       * Label names [must be
+       * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * Label values can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * The only available variable names are the names of the labels in the
+       * PromQL result, including "__name__" and "value". "labels" may be empty.
        * 
* - * .google.protobuf.Duration duration = 2; + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ @java.lang.Override - public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { - return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; } - - public static final int TRIGGER_FIELD_NUMBER = 3; - private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; /** * * *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`,
-       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-       * are specified.
+       * Optional. Labels to add to or overwrite in the PromQL query result.
+       * Label names [must be
+       * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * Label values can be [templatized by using
+       * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+       * The only available variable names are the names of the labels in the
+       * PromQL result, including "__name__" and "value". "labels" may be empty.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; - * - * @return Whether the trigger field is set. + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ @java.lang.Override - public boolean hasTrigger() { - return trigger_ != null; + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); } + + public static final int RULE_GROUP_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object ruleGroup_ = ""; /** * * *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`,
-       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-       * are specified.
+       * Optional. The rule group name of this alert in the corresponding
+       * Prometheus configuration file.
+       *
+       * Some external tools may require this field to be populated correctly
+       * in order to refer to the original Prometheus configuration file.
+       * The rule group name and the alert name are necessary to update the
+       * relevant AlertPolicies in case the definition of the rule group changes
+       * in the future.
+       *
+       * This field is optional. If this field is not empty, then it must
+       * contain a valid UTF-8 string.
+       * This field may not exceed 2048 Unicode characters in length.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; * - * @return The trigger. + * @return The ruleGroup. */ @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; + public java.lang.String getRuleGroup() { + java.lang.Object ref = ruleGroup_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ruleGroup_ = s; + return s; + } } /** * * *
-       * The number/percent of time series for which the comparison must hold
-       * in order for the condition to trigger. If unspecified, then the
-       * condition will trigger if the comparison is true for any of the
-       * time series that have been identified by `filter` and `aggregations`,
-       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-       * are specified.
+       * Optional. The rule group name of this alert in the corresponding
+       * Prometheus configuration file.
+       *
+       * Some external tools may require this field to be populated correctly
+       * in order to refer to the original Prometheus configuration file.
+       * The rule group name and the alert name are necessary to update the
+       * relevant AlertPolicies in case the definition of the rule group changes
+       * in the future.
+       *
+       * This field is optional. If this field is not empty, then it must
+       * contain a valid UTF-8 string.
+       * This field may not exceed 2048 Unicode characters in length.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for ruleGroup. */ @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder() { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; + public com.google.protobuf.ByteString getRuleGroupBytes() { + java.lang.Object ref = ruleGroup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ruleGroup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - public static final int EVALUATION_MISSING_DATA_FIELD_NUMBER = 4; - private int evaluationMissingData_ = 0; + public static final int ALERT_RULE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object alertRule_ = ""; /** * * *
-       * A condition control that determines how metric-threshold conditions
-       * are evaluated when data stops arriving.
+       * Optional. The alerting rule name of this alert in the corresponding
+       * Prometheus configuration file.
+       *
+       * Some external tools may require this field to be populated correctly
+       * in order to refer to the original Prometheus configuration file.
+       * The rule group name and the alert name are necessary to update the
+       * relevant AlertPolicies in case the definition of the rule group changes
+       * in the future.
+       *
+       * This field is optional. If this field is not empty, then it must be a
+       * [valid Prometheus label
+       * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * This field may not exceed 2048 Unicode characters in length.
        * 
* - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * + * string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; * - * @return The enum numeric value on the wire for evaluationMissingData. + * @return The alertRule. */ @java.lang.Override - public int getEvaluationMissingDataValue() { - return evaluationMissingData_; + public java.lang.String getAlertRule() { + java.lang.Object ref = alertRule_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + alertRule_ = s; + return s; + } } /** * * *
-       * A condition control that determines how metric-threshold conditions
-       * are evaluated when data stops arriving.
+       * Optional. The alerting rule name of this alert in the corresponding
+       * Prometheus configuration file.
+       *
+       * Some external tools may require this field to be populated correctly
+       * in order to refer to the original Prometheus configuration file.
+       * The rule group name and the alert name are necessary to update the
+       * relevant AlertPolicies in case the definition of the rule group changes
+       * in the future.
+       *
+       * This field is optional. If this field is not empty, then it must be a
+       * [valid Prometheus label
+       * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+       * This field may not exceed 2048 Unicode characters in length.
        * 
* - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * + * string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; * - * @return The evaluationMissingData. + * @return The bytes for alertRule. */ @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData - getEvaluationMissingData() { - com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData result = - com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.forNumber( - evaluationMissingData_); - return result == null - ? com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.UNRECOGNIZED - : result; + public com.google.protobuf.ByteString getAlertRuleBytes() { + java.lang.Object ref = alertRule_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + alertRule_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -10569,14 +14383,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (duration_ != null) { output.writeMessage(2, getDuration()); } - if (trigger_ != null) { - output.writeMessage(3, getTrigger()); + if (evaluationInterval_ != null) { + output.writeMessage(3, getEvaluationInterval()); } - if (evaluationMissingData_ - != com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData - .EVALUATION_MISSING_DATA_UNSPECIFIED - .getNumber()) { - output.writeEnum(4, evaluationMissingData_); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ruleGroup_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, ruleGroup_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(alertRule_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, alertRule_); } getUnknownFields().writeTo(output); } @@ -10593,14 +14409,25 @@ public int getSerializedSize() { if (duration_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDuration()); } - if (trigger_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTrigger()); + if (evaluationInterval_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEvaluationInterval()); } - if (evaluationMissingData_ - != com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData - .EVALUATION_MISSING_DATA_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, evaluationMissingData_); + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ruleGroup_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, ruleGroup_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(alertRule_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, alertRule_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -10614,22 +14441,24 @@ public boolean equals(final java.lang.Object obj) { } if (!(obj instanceof - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition)) { + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition)) { return super.equals(obj); } - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition other = - (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) obj; + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition other = + (com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) obj; if (!getQuery().equals(other.getQuery())) return false; if (hasDuration() != other.hasDuration()) return false; if (hasDuration()) { if (!getDuration().equals(other.getDuration())) return false; } - if (hasTrigger() != other.hasTrigger()) return false; - if (hasTrigger()) { - if (!getTrigger().equals(other.getTrigger())) return false; + if (hasEvaluationInterval() != other.hasEvaluationInterval()) return false; + if (hasEvaluationInterval()) { + if (!getEvaluationInterval().equals(other.getEvaluationInterval())) return false; } - if (evaluationMissingData_ != other.evaluationMissingData_) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getRuleGroup().equals(other.getRuleGroup())) return false; + if (!getAlertRule().equals(other.getAlertRule())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -10647,37 +14476,43 @@ public int hashCode() { hash = (37 * hash) + DURATION_FIELD_NUMBER; hash = (53 * hash) + getDuration().hashCode(); } - if (hasTrigger()) { - hash = (37 * hash) + TRIGGER_FIELD_NUMBER; - hash = (53 * hash) + getTrigger().hashCode(); + if (hasEvaluationInterval()) { + hash = (37 * hash) + EVALUATION_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getEvaluationInterval().hashCode(); } - hash = (37 * hash) + EVALUATION_MISSING_DATA_FIELD_NUMBER; - hash = (53 * hash) + evaluationMissingData_; + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + RULE_GROUP_FIELD_NUMBER; + hash = (53 * hash) + getRuleGroup().hashCode(); + hash = (37 * hash) + ALERT_RULE_FIELD_NUMBER; + hash = (53 * hash) + getAlertRule().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -10685,23 +14520,23 @@ public int hashCode() { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -10710,12 +14545,12 @@ public int hashCode() { PARSER, input, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -10724,12 +14559,12 @@ public int hashCode() { PARSER, input, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -10748,7 +14583,7 @@ public static Builder newBuilder() { } public static Builder newBuilder( - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -10769,36 +14604,85 @@ protected Builder newBuilderForType( * *
        * A condition type that allows alert policies to be defined using
-       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
+       * [Prometheus Query Language
+       * (PromQL)](https://prometheus.io/docs/prometheus/latest/querying/basics/).
+       *
+       * The PrometheusQueryLanguageCondition message contains information
+       * from a Prometheus alerting rule and its associated rule group.
+       *
+       * A Prometheus alerting rule is described
+       * [here](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/).
+       * The semantics of a Prometheus alerting rule is described
+       * [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule).
+       *
+       * A Prometheus rule group is described
+       * [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/).
+       * The semantics of a Prometheus rule group is described
+       * [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule_group).
+       *
+       * Because Cloud Alerting has no representation of a Prometheus rule
+       * group resource, we must embed the information of the parent rule
+       * group inside each of the conditions that refer to it. We must also
+       * update the contents of all Prometheus alerts in case the information
+       * of their rule group changes.
+       *
+       * The PrometheusQueryLanguageCondition protocol buffer combines the
+       * information of the corresponding rule group and alerting rule.
+       * The structure of the PrometheusQueryLanguageCondition protocol buffer
+       * does NOT mimic the structure of the Prometheus rule group and alerting
+       * rule YAML declarations. The PrometheusQueryLanguageCondition protocol
+       * buffer may change in the future to support future rule group and/or
+       * alerting rule features. There are no new such features at the present
+       * time (2023-06-26).
        * 
* * Protobuf type {@code - * google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition} + * google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageConditionOrBuilder { + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageConditionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_descriptor; + .internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_fieldAccessorTable + .internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition .class, - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition .Builder.class); } // Construct using - // com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition.newBuilder() + // com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -10815,32 +14699,34 @@ public Builder clear() { durationBuilder_.dispose(); durationBuilder_ = null; } - trigger_ = null; - if (triggerBuilder_ != null) { - triggerBuilder_.dispose(); - triggerBuilder_ = null; + evaluationInterval_ = null; + if (evaluationIntervalBuilder_ != null) { + evaluationIntervalBuilder_.dispose(); + evaluationIntervalBuilder_ = null; } - evaluationMissingData_ = 0; + internalGetMutableLabels().clear(); + ruleGroup_ = ""; + alertRule_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_descriptor; + .internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_descriptor; } @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition getDefaultInstanceForType() { - return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + return com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition .getDefaultInstance(); } @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition build() { - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition result = + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); @@ -10849,10 +14735,10 @@ public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { } @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition buildPartial() { - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition result = - new com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition( + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition result = + new com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition( this); if (bitField0_ != 0) { buildPartial0(result); @@ -10862,7 +14748,7 @@ public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { } private void buildPartial0( - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -10872,10 +14758,20 @@ private void buildPartial0( result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build(); } if (((from_bitField0_ & 0x00000004) != 0)) { - result.trigger_ = triggerBuilder_ == null ? trigger_ : triggerBuilder_.build(); + result.evaluationInterval_ = + evaluationIntervalBuilder_ == null + ? evaluationInterval_ + : evaluationIntervalBuilder_.build(); } if (((from_bitField0_ & 0x00000008) != 0)) { - result.evaluationMissingData_ = evaluationMissingData_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.ruleGroup_ = ruleGroup_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.alertRule_ = alertRule_; } } @@ -10918,9 +14814,9 @@ public Builder addRepeatedField( public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) { + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) { return mergeFrom( - (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + (com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) other); } else { super.mergeFrom(other); @@ -10929,9 +14825,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { } public Builder mergeFrom( - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition other) { + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition other) { if (other - == com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + == com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition .getDefaultInstance()) return this; if (!other.getQuery().isEmpty()) { query_ = other.query_; @@ -10941,11 +14837,20 @@ public Builder mergeFrom( if (other.hasDuration()) { mergeDuration(other.getDuration()); } - if (other.hasTrigger()) { - mergeTrigger(other.getTrigger()); + if (other.hasEvaluationInterval()) { + mergeEvaluationInterval(other.getEvaluationInterval()); } - if (other.evaluationMissingData_ != 0) { - setEvaluationMissingDataValue(other.getEvaluationMissingDataValue()); + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000008; + if (!other.getRuleGroup().isEmpty()) { + ruleGroup_ = other.ruleGroup_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getAlertRule().isEmpty()) { + alertRule_ = other.alertRule_; + bitField0_ |= 0x00000020; + onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); @@ -10987,16 +14892,35 @@ public Builder mergeFrom( } // case 18 case 26: { - input.readMessage(getTriggerFieldBuilder().getBuilder(), extensionRegistry); + input.readMessage( + getEvaluationIntervalFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000004; break; } // case 26 - case 32: + case 34: { - evaluationMissingData_ = input.readEnum(); + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); bitField0_ |= 0x00000008; break; - } // case 32 + } // case 34 + case 42: + { + ruleGroup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + alertRule_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -11021,11 +14945,12 @@ public Builder mergeFrom( * * *
-         * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
-         * query that outputs a boolean stream.
+         * Required. The PromQL expression to evaluate. Every evaluation cycle
+         * this expression is evaluated at the current time, and all resultant
+         * time series become pending/firing alerts. This field must not be empty.
          * 
* - * string query = 1; + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The query. */ @@ -11044,11 +14969,12 @@ public java.lang.String getQuery() { * * *
-         * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
-         * query that outputs a boolean stream.
+         * Required. The PromQL expression to evaluate. Every evaluation cycle
+         * this expression is evaluated at the current time, and all resultant
+         * time series become pending/firing alerts. This field must not be empty.
          * 
* - * string query = 1; + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for query. */ @@ -11067,11 +14993,12 @@ public com.google.protobuf.ByteString getQueryBytes() { * * *
-         * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
-         * query that outputs a boolean stream.
+         * Required. The PromQL expression to evaluate. Every evaluation cycle
+         * this expression is evaluated at the current time, and all resultant
+         * time series become pending/firing alerts. This field must not be empty.
          * 
* - * string query = 1; + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The query to set. * @return This builder for chaining. @@ -11089,11 +15016,12 @@ public Builder setQuery(java.lang.String value) { * * *
-         * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
-         * query that outputs a boolean stream.
+         * Required. The PromQL expression to evaluate. Every evaluation cycle
+         * this expression is evaluated at the current time, and all resultant
+         * time series become pending/firing alerts. This field must not be empty.
          * 
* - * string query = 1; + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -11107,11 +15035,12 @@ public Builder clearQuery() { * * *
-         * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
-         * query that outputs a boolean stream.
+         * Required. The PromQL expression to evaluate. Every evaluation cycle
+         * this expression is evaluated at the current time, and all resultant
+         * time series become pending/firing alerts. This field must not be empty.
          * 
* - * string query = 1; + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for query to set. * @return This builder for chaining. @@ -11137,19 +15066,16 @@ public Builder setQueryBytes(com.google.protobuf.ByteString value) { * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Optional. Alerts are considered firing once their PromQL expression was
+         * evaluated to be "true" for this long.
+         * Alerts whose PromQL expression was not evaluated to be "true" for
+         * long enough are considered pending.
+         * Must be a non-negative duration or missing.
+         * This field is optional. Its default value is zero.
          * 
* - * .google.protobuf.Duration duration = 2; + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the duration field is set. */ @@ -11160,59 +15086,293 @@ public boolean hasDuration() { * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Optional. Alerts are considered firing once their PromQL expression was
+         * evaluated to be "true" for this long.
+         * Alerts whose PromQL expression was not evaluated to be "true" for
+         * long enough are considered pending.
+         * Must be a non-negative duration or missing.
+         * This field is optional. Its default value is zero.
+         * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The duration. + */ + public com.google.protobuf.Duration getDuration() { + if (durationBuilder_ == null) { + return duration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : duration_; + } else { + return durationBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Optional. Alerts are considered firing once their PromQL expression was
+         * evaluated to be "true" for this long.
+         * Alerts whose PromQL expression was not evaluated to be "true" for
+         * long enough are considered pending.
+         * Must be a non-negative duration or missing.
+         * This field is optional. Its default value is zero.
+         * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + } else { + durationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. Alerts are considered firing once their PromQL expression was
+         * evaluated to be "true" for this long.
+         * Alerts whose PromQL expression was not evaluated to be "true" for
+         * long enough are considered pending.
+         * Must be a non-negative duration or missing.
+         * This field is optional. Its default value is zero.
+         * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. Alerts are considered firing once their PromQL expression was
+         * evaluated to be "true" for this long.
+         * Alerts whose PromQL expression was not evaluated to be "true" for
+         * long enough are considered pending.
+         * Must be a non-negative duration or missing.
+         * This field is optional. Its default value is zero.
+         * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && duration_ != null + && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDurationBuilder().mergeFrom(value); + } else { + duration_ = value; + } + } else { + durationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. Alerts are considered firing once their PromQL expression was
+         * evaluated to be "true" for this long.
+         * Alerts whose PromQL expression was not evaluated to be "true" for
+         * long enough are considered pending.
+         * Must be a non-negative duration or missing.
+         * This field is optional. Its default value is zero.
+         * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. Alerts are considered firing once their PromQL expression was
+         * evaluated to be "true" for this long.
+         * Alerts whose PromQL expression was not evaluated to be "true" for
+         * long enough are considered pending.
+         * Must be a non-negative duration or missing.
+         * This field is optional. Its default value is zero.
+         * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Optional. Alerts are considered firing once their PromQL expression was
+         * evaluated to be "true" for this long.
+         * Alerts whose PromQL expression was not evaluated to be "true" for
+         * long enough are considered pending.
+         * Must be a non-negative duration or missing.
+         * This field is optional. Its default value is zero.
+         * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : duration_; + } + } + /** + * + * + *
+         * Optional. Alerts are considered firing once their PromQL expression was
+         * evaluated to be "true" for this long.
+         * Alerts whose PromQL expression was not evaluated to be "true" for
+         * long enough are considered pending.
+         * Must be a non-negative duration or missing.
+         * This field is optional. Its default value is zero.
+         * 
+ * + * .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDurationFieldBuilder() { + if (durationBuilder_ == null) { + durationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDuration(), getParentForChildren(), isClean()); + duration_ = null; + } + return durationBuilder_; + } + + private com.google.protobuf.Duration evaluationInterval_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + evaluationIntervalBuilder_; + /** + * + * + *
+         * Optional. How often this rule should be evaluated.
+         * Must be a positive multiple of 30 seconds or missing.
+         * This field is optional. Its default value is 30 seconds.
+         * If this PrometheusQueryLanguageCondition was generated from a
+         * Prometheus alerting rule, then this value should be taken from the
+         * enclosing rule group.
+         * 
+ * + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the evaluationInterval field is set. + */ + public boolean hasEvaluationInterval() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+         * Optional. How often this rule should be evaluated.
+         * Must be a positive multiple of 30 seconds or missing.
+         * This field is optional. Its default value is 30 seconds.
+         * If this PrometheusQueryLanguageCondition was generated from a
+         * Prometheus alerting rule, then this value should be taken from the
+         * enclosing rule group.
          * 
* - * .google.protobuf.Duration duration = 2; + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * * - * @return The duration. + * @return The evaluationInterval. */ - public com.google.protobuf.Duration getDuration() { - if (durationBuilder_ == null) { - return duration_ == null + public com.google.protobuf.Duration getEvaluationInterval() { + if (evaluationIntervalBuilder_ == null) { + return evaluationInterval_ == null ? com.google.protobuf.Duration.getDefaultInstance() - : duration_; + : evaluationInterval_; } else { - return durationBuilder_.getMessage(); + return evaluationIntervalBuilder_.getMessage(); } } /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Optional. How often this rule should be evaluated.
+         * Must be a positive multiple of 30 seconds or missing.
+         * This field is optional. Its default value is 30 seconds.
+         * If this PrometheusQueryLanguageCondition was generated from a
+         * Prometheus alerting rule, then this value should be taken from the
+         * enclosing rule group.
          * 
* - * .google.protobuf.Duration duration = 2; + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public Builder setDuration(com.google.protobuf.Duration value) { - if (durationBuilder_ == null) { + public Builder setEvaluationInterval(com.google.protobuf.Duration value) { + if (evaluationIntervalBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - duration_ = value; + evaluationInterval_ = value; } else { - durationBuilder_.setMessage(value); + evaluationIntervalBuilder_.setMessage(value); } - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -11220,27 +15380,25 @@ public Builder setDuration(com.google.protobuf.Duration value) { * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Optional. How often this rule should be evaluated.
+         * Must be a positive multiple of 30 seconds or missing.
+         * This field is optional. Its default value is 30 seconds.
+         * If this PrometheusQueryLanguageCondition was generated from a
+         * Prometheus alerting rule, then this value should be taken from the
+         * enclosing rule group.
          * 
* - * .google.protobuf.Duration duration = 2; + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { - if (durationBuilder_ == null) { - duration_ = builderForValue.build(); + public Builder setEvaluationInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (evaluationIntervalBuilder_ == null) { + evaluationInterval_ = builderForValue.build(); } else { - durationBuilder_.setMessage(builderForValue.build()); + evaluationIntervalBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -11248,33 +15406,31 @@ public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Optional. How often this rule should be evaluated.
+         * Must be a positive multiple of 30 seconds or missing.
+         * This field is optional. Its default value is 30 seconds.
+         * If this PrometheusQueryLanguageCondition was generated from a
+         * Prometheus alerting rule, then this value should be taken from the
+         * enclosing rule group.
          * 
* - * .google.protobuf.Duration duration = 2; + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public Builder mergeDuration(com.google.protobuf.Duration value) { - if (durationBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) - && duration_ != null - && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { - getDurationBuilder().mergeFrom(value); + public Builder mergeEvaluationInterval(com.google.protobuf.Duration value) { + if (evaluationIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && evaluationInterval_ != null + && evaluationInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getEvaluationIntervalBuilder().mergeFrom(value); } else { - duration_ = value; + evaluationInterval_ = value; } } else { - durationBuilder_.mergeFrom(value); + evaluationIntervalBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -11282,26 +15438,24 @@ public Builder mergeDuration(com.google.protobuf.Duration value) { * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Optional. How often this rule should be evaluated.
+         * Must be a positive multiple of 30 seconds or missing.
+         * This field is optional. Its default value is 30 seconds.
+         * If this PrometheusQueryLanguageCondition was generated from a
+         * Prometheus alerting rule, then this value should be taken from the
+         * enclosing rule group.
          * 
* - * .google.protobuf.Duration duration = 2; + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public Builder clearDuration() { - bitField0_ = (bitField0_ & ~0x00000002); - duration_ = null; - if (durationBuilder_ != null) { - durationBuilder_.dispose(); - durationBuilder_ = null; + public Builder clearEvaluationInterval() { + bitField0_ = (bitField0_ & ~0x00000004); + evaluationInterval_ = null; + if (evaluationIntervalBuilder_ != null) { + evaluationIntervalBuilder_.dispose(); + evaluationIntervalBuilder_ = null; } onChanged(); return this; @@ -11310,405 +15464,556 @@ public Builder clearDuration() { * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Optional. How often this rule should be evaluated.
+         * Must be a positive multiple of 30 seconds or missing.
+         * This field is optional. Its default value is 30 seconds.
+         * If this PrometheusQueryLanguageCondition was generated from a
+         * Prometheus alerting rule, then this value should be taken from the
+         * enclosing rule group.
          * 
* - * .google.protobuf.Duration duration = 2; + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public com.google.protobuf.Duration.Builder getDurationBuilder() { - bitField0_ |= 0x00000002; + public com.google.protobuf.Duration.Builder getEvaluationIntervalBuilder() { + bitField0_ |= 0x00000004; onChanged(); - return getDurationFieldBuilder().getBuilder(); + return getEvaluationIntervalFieldBuilder().getBuilder(); } /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Optional. How often this rule should be evaluated.
+         * Must be a positive multiple of 30 seconds or missing.
+         * This field is optional. Its default value is 30 seconds.
+         * If this PrometheusQueryLanguageCondition was generated from a
+         * Prometheus alerting rule, then this value should be taken from the
+         * enclosing rule group.
          * 
* - * .google.protobuf.Duration duration = 2; + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { - if (durationBuilder_ != null) { - return durationBuilder_.getMessageOrBuilder(); + public com.google.protobuf.DurationOrBuilder getEvaluationIntervalOrBuilder() { + if (evaluationIntervalBuilder_ != null) { + return evaluationIntervalBuilder_.getMessageOrBuilder(); } else { - return duration_ == null + return evaluationInterval_ == null ? com.google.protobuf.Duration.getDefaultInstance() - : duration_; + : evaluationInterval_; } } /** * * *
-         * The amount of time that a time series must violate the
-         * threshold to be considered failing. Currently, only values
-         * that are a multiple of a minute--e.g., 0, 60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
-         * error will be returned. When choosing a duration, it is useful to
-         * keep in mind the frequency of the underlying time series data
-         * (which may also be affected by any alignments specified in the
-         * `aggregations` field); a good duration is long enough so that a single
-         * outlier does not generate spurious alerts, but short enough that
-         * unhealthy states are detected and alerted on quickly.
+         * Optional. How often this rule should be evaluated.
+         * Must be a positive multiple of 30 seconds or missing.
+         * This field is optional. Its default value is 30 seconds.
+         * If this PrometheusQueryLanguageCondition was generated from a
+         * Prometheus alerting rule, then this value should be taken from the
+         * enclosing rule group.
          * 
* - * .google.protobuf.Duration duration = 2; + * + * .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getDurationFieldBuilder() { - if (durationBuilder_ == null) { - durationBuilder_ = + getEvaluationIntervalFieldBuilder() { + if (evaluationIntervalBuilder_ == null) { + evaluationIntervalBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getDuration(), getParentForChildren(), isClean()); - duration_ = null; + getEvaluationInterval(), getParentForChildren(), isClean()); + evaluationInterval_ = null; } - return durationBuilder_; + return evaluationIntervalBuilder_; } - private com.google.monitoring.v3.AlertPolicy.Condition.Trigger trigger_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.Trigger, - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> - triggerBuilder_; + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField + internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000008; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Optional. Labels to add to or overwrite in the PromQL query result.
+         * Label names [must be
+         * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * Label values can be [templatized by using
+         * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+         * The only available variable names are the names of the labels in the
+         * PromQL result, including "__name__" and "value". "labels" may be empty.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; - * - * @return Whether the trigger field is set. + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public boolean hasTrigger() { - return ((bitField0_ & 0x00000004) != 0); + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Optional. Labels to add to or overwrite in the PromQL query result.
+         * Label names [must be
+         * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * Label values can be [templatized by using
+         * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+         * The only available variable names are the names of the labels in the
+         * PromQL result, including "__name__" and "value". "labels" may be empty.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** * - * @return The trigger. + * + *
+         * Optional. Labels to add to or overwrite in the PromQL query result.
+         * Label names [must be
+         * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * Label values can be [templatized by using
+         * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+         * The only available variable names are the names of the labels in the
+         * PromQL result, including "__name__" and "value". "labels" may be empty.
+         * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public com.google.monitoring.v3.AlertPolicy.Condition.Trigger getTrigger() { - if (triggerBuilder_ == null) { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; - } else { - return triggerBuilder_.getMessage(); + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Optional. Labels to add to or overwrite in the PromQL query result.
+         * Label names [must be
+         * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * Label values can be [templatized by using
+         * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+         * The only available variable names are the names of the labels in the
+         * PromQL result, including "__name__" and "value". "labels" may be empty.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public Builder setTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { - if (triggerBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - trigger_ = value; - } else { - triggerBuilder_.setMessage(value); + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } - bitField0_ |= 0x00000004; - onChanged(); + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableLabels().getMutableMap().clear(); return this; } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Optional. Labels to add to or overwrite in the PromQL query result.
+         * Label names [must be
+         * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * Label values can be [templatized by using
+         * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+         * The only available variable names are the names of the labels in the
+         * PromQL result, including "__name__" and "value". "labels" may be empty.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public Builder setTrigger( - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder builderForValue) { - if (triggerBuilder_ == null) { - trigger_ = builderForValue.build(); - } else { - triggerBuilder_.setMessage(builderForValue.build()); + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } - bitField0_ |= 0x00000004; - onChanged(); + internalGetMutableLabels().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000008; + return internalGetMutableLabels().getMutableMap(); + } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Optional. Labels to add to or overwrite in the PromQL query result.
+         * Label names [must be
+         * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * Label values can be [templatized by using
+         * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+         * The only available variable names are the names of the labels in the
+         * PromQL result, including "__name__" and "value". "labels" may be empty.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public Builder mergeTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { - if (triggerBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0) - && trigger_ != null - && trigger_ - != com.google.monitoring.v3.AlertPolicy.Condition.Trigger - .getDefaultInstance()) { - getTriggerBuilder().mergeFrom(value); - } else { - trigger_ = value; - } - } else { - triggerBuilder_.mergeFrom(value); + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); } - bitField0_ |= 0x00000004; - onChanged(); + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000008; return this; } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Optional. Labels to add to or overwrite in the PromQL query result.
+         * Label names [must be
+         * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * Label values can be [templatized by using
+         * variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+         * The only available variable names are the names of the labels in the
+         * PromQL result, including "__name__" and "value". "labels" may be empty.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ - public Builder clearTrigger() { - bitField0_ = (bitField0_ & ~0x00000004); - trigger_ = null; - if (triggerBuilder_ != null) { - triggerBuilder_.dispose(); - triggerBuilder_ = null; - } - onChanged(); + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000008; return this; } + + private java.lang.Object ruleGroup_ = ""; /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Optional. The rule group name of this alert in the corresponding
+         * Prometheus configuration file.
+         *
+         * Some external tools may require this field to be populated correctly
+         * in order to refer to the original Prometheus configuration file.
+         * The rule group name and the alert name are necessary to update the
+         * relevant AlertPolicies in case the definition of the rule group changes
+         * in the future.
+         *
+         * This field is optional. If this field is not empty, then it must
+         * contain a valid UTF-8 string.
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ruleGroup. */ - public com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder getTriggerBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return getTriggerFieldBuilder().getBuilder(); + public java.lang.String getRuleGroup() { + java.lang.Object ref = ruleGroup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ruleGroup_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Optional. The rule group name of this alert in the corresponding
+         * Prometheus configuration file.
+         *
+         * Some external tools may require this field to be populated correctly
+         * in order to refer to the original Prometheus configuration file.
+         * The rule group name and the alert name are necessary to update the
+         * relevant AlertPolicies in case the definition of the rule group changes
+         * in the future.
+         *
+         * This field is optional. If this field is not empty, then it must
+         * contain a valid UTF-8 string.
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for ruleGroup. */ - public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder - getTriggerOrBuilder() { - if (triggerBuilder_ != null) { - return triggerBuilder_.getMessageOrBuilder(); + public com.google.protobuf.ByteString getRuleGroupBytes() { + java.lang.Object ref = ruleGroup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ruleGroup_ = b; + return b; } else { - return trigger_ == null - ? com.google.monitoring.v3.AlertPolicy.Condition.Trigger.getDefaultInstance() - : trigger_; + return (com.google.protobuf.ByteString) ref; } } /** * * *
-         * The number/percent of time series for which the comparison must hold
-         * in order for the condition to trigger. If unspecified, then the
-         * condition will trigger if the comparison is true for any of the
-         * time series that have been identified by `filter` and `aggregations`,
-         * or by the ratio, if `denominator_filter` and `denominator_aggregations`
-         * are specified.
+         * Optional. The rule group name of this alert in the corresponding
+         * Prometheus configuration file.
+         *
+         * Some external tools may require this field to be populated correctly
+         * in order to refer to the original Prometheus configuration file.
+         * The rule group name and the alert name are necessary to update the
+         * relevant AlertPolicies in case the definition of the rule group changes
+         * in the future.
+         *
+         * This field is optional. If this field is not empty, then it must
+         * contain a valid UTF-8 string.
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The ruleGroup to set. + * @return This builder for chaining. */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.Trigger, - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder> - getTriggerFieldBuilder() { - if (triggerBuilder_ == null) { - triggerBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.Trigger, - com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder>( - getTrigger(), getParentForChildren(), isClean()); - trigger_ = null; + public Builder setRuleGroup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } - return triggerBuilder_; + ruleGroup_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; } - - private int evaluationMissingData_ = 0; /** * * *
-         * A condition control that determines how metric-threshold conditions
-         * are evaluated when data stops arriving.
+         * Optional. The rule group name of this alert in the corresponding
+         * Prometheus configuration file.
+         *
+         * Some external tools may require this field to be populated correctly
+         * in order to refer to the original Prometheus configuration file.
+         * The rule group name and the alert name are necessary to update the
+         * relevant AlertPolicies in case the definition of the rule group changes
+         * in the future.
+         *
+         * This field is optional. If this field is not empty, then it must
+         * contain a valid UTF-8 string.
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * + * string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; * - * @return The enum numeric value on the wire for evaluationMissingData. + * @return This builder for chaining. */ - @java.lang.Override - public int getEvaluationMissingDataValue() { - return evaluationMissingData_; + public Builder clearRuleGroup() { + ruleGroup_ = getDefaultInstance().getRuleGroup(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; } /** * * *
-         * A condition control that determines how metric-threshold conditions
-         * are evaluated when data stops arriving.
+         * Optional. The rule group name of this alert in the corresponding
+         * Prometheus configuration file.
+         *
+         * Some external tools may require this field to be populated correctly
+         * in order to refer to the original Prometheus configuration file.
+         * The rule group name and the alert name are necessary to update the
+         * relevant AlertPolicies in case the definition of the rule group changes
+         * in the future.
+         *
+         * This field is optional. If this field is not empty, then it must
+         * contain a valid UTF-8 string.
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * + * string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; * - * @param value The enum numeric value on the wire for evaluationMissingData to set. + * @param value The bytes for ruleGroup to set. * @return This builder for chaining. */ - public Builder setEvaluationMissingDataValue(int value) { - evaluationMissingData_ = value; - bitField0_ |= 0x00000008; + public Builder setRuleGroupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ruleGroup_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + + private java.lang.Object alertRule_ = ""; /** * * *
-         * A condition control that determines how metric-threshold conditions
-         * are evaluated when data stops arriving.
+         * Optional. The alerting rule name of this alert in the corresponding
+         * Prometheus configuration file.
+         *
+         * Some external tools may require this field to be populated correctly
+         * in order to refer to the original Prometheus configuration file.
+         * The rule group name and the alert name are necessary to update the
+         * relevant AlertPolicies in case the definition of the rule group changes
+         * in the future.
+         *
+         * This field is optional. If this field is not empty, then it must be a
+         * [valid Prometheus label
+         * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * + * string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; * - * @return The evaluationMissingData. + * @return The alertRule. */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData - getEvaluationMissingData() { - com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData result = - com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.forNumber( - evaluationMissingData_); - return result == null - ? com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData.UNRECOGNIZED - : result; + public java.lang.String getAlertRule() { + java.lang.Object ref = alertRule_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + alertRule_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** * * *
-         * A condition control that determines how metric-threshold conditions
-         * are evaluated when data stops arriving.
+         * Optional. The alerting rule name of this alert in the corresponding
+         * Prometheus configuration file.
+         *
+         * Some external tools may require this field to be populated correctly
+         * in order to refer to the original Prometheus configuration file.
+         * The rule group name and the alert name are necessary to update the
+         * relevant AlertPolicies in case the definition of the rule group changes
+         * in the future.
+         *
+         * This field is optional. If this field is not empty, then it must be a
+         * [valid Prometheus label
+         * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * + * string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; * - * @param value The evaluationMissingData to set. + * @return The bytes for alertRule. + */ + public com.google.protobuf.ByteString getAlertRuleBytes() { + java.lang.Object ref = alertRule_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + alertRule_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Optional. The alerting rule name of this alert in the corresponding
+         * Prometheus configuration file.
+         *
+         * Some external tools may require this field to be populated correctly
+         * in order to refer to the original Prometheus configuration file.
+         * The rule group name and the alert name are necessary to update the
+         * relevant AlertPolicies in case the definition of the rule group changes
+         * in the future.
+         *
+         * This field is optional. If this field is not empty, then it must be a
+         * [valid Prometheus label
+         * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * This field may not exceed 2048 Unicode characters in length.
+         * 
+ * + * string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The alertRule to set. * @return This builder for chaining. */ - public Builder setEvaluationMissingData( - com.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData value) { + public Builder setAlertRule(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000008; - evaluationMissingData_ = value.getNumber(); + alertRule_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -11716,19 +16021,62 @@ public Builder setEvaluationMissingData( * * *
-         * A condition control that determines how metric-threshold conditions
-         * are evaluated when data stops arriving.
+         * Optional. The alerting rule name of this alert in the corresponding
+         * Prometheus configuration file.
+         *
+         * Some external tools may require this field to be populated correctly
+         * in order to refer to the original Prometheus configuration file.
+         * The rule group name and the alert name are necessary to update the
+         * relevant AlertPolicies in case the definition of the rule group changes
+         * in the future.
+         *
+         * This field is optional. If this field is not empty, then it must be a
+         * [valid Prometheus label
+         * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * This field may not exceed 2048 Unicode characters in length.
          * 
* - * - * .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * + * string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ - public Builder clearEvaluationMissingData() { - bitField0_ = (bitField0_ & ~0x00000008); - evaluationMissingData_ = 0; + public Builder clearAlertRule() { + alertRule_ = getDefaultInstance().getAlertRule(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. The alerting rule name of this alert in the corresponding
+         * Prometheus configuration file.
+         *
+         * Some external tools may require this field to be populated correctly
+         * in order to refer to the original Prometheus configuration file.
+         * The rule group name and the alert name are necessary to update the
+         * relevant AlertPolicies in case the definition of the rule group changes
+         * in the future.
+         *
+         * This field is optional. If this field is not empty, then it must be a
+         * [valid Prometheus label
+         * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+         * This field may not exceed 2048 Unicode characters in length.
+         * 
+ * + * string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for alertRule to set. + * @return This builder for chaining. + */ + public Builder setAlertRuleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + alertRule_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -11745,28 +16093,28 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) } - // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) private static final com.google.monitoring.v3.AlertPolicy.Condition - .MonitoringQueryLanguageCondition + .PrometheusQueryLanguageCondition DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = - new com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition(); + new com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition(); } - public static com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public static com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public MonitoringQueryLanguageCondition parsePartialFrom( + public PrometheusQueryLanguageCondition parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -11786,17 +16134,17 @@ public MonitoringQueryLanguageCondition parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + public com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -11815,6 +16163,7 @@ public enum ConditionCase CONDITION_ABSENT(2), CONDITION_MATCHED_LOG(20), CONDITION_MONITORING_QUERY_LANGUAGE(19), + CONDITION_PROMETHEUS_QUERY_LANGUAGE(21), CONDITION_NOT_SET(0); private final int value; @@ -11841,6 +16190,8 @@ public static ConditionCase forNumber(int value) { return CONDITION_MATCHED_LOG; case 19: return CONDITION_MONITORING_QUERY_LANGUAGE; + case 21: + return CONDITION_PROMETHEUS_QUERY_LANGUAGE; case 0: return CONDITION_NOT_SET; default: @@ -11989,1199 +16340,2265 @@ public java.lang.String getDisplayName() { * * *
-     * A short name or phrase used to identify the condition in dashboards,
-     * notifications, and incidents. To avoid confusion, don't use the same
-     * display name for multiple conditions in the same policy.
+     * A short name or phrase used to identify the condition in dashboards,
+     * notifications, and incidents. To avoid confusion, don't use the same
+     * display name for multiple conditions in the same policy.
+     * 
+ * + * string display_name = 6; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONDITION_THRESHOLD_FIELD_NUMBER = 1; + /** + * + * + *
+     * A condition that compares a time series against a threshold.
+     * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * + * @return Whether the conditionThreshold field is set. + */ + @java.lang.Override + public boolean hasConditionThreshold() { + return conditionCase_ == 1; + } + /** + * + * + *
+     * A condition that compares a time series against a threshold.
+     * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * + * @return The conditionThreshold. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold getConditionThreshold() { + if (conditionCase_ == 1) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.getDefaultInstance(); + } + /** + * + * + *
+     * A condition that compares a time series against a threshold.
+     * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder + getConditionThresholdOrBuilder() { + if (conditionCase_ == 1) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.getDefaultInstance(); + } + + public static final int CONDITION_ABSENT_FIELD_NUMBER = 2; + /** + * + * + *
+     * A condition that checks that a time series continues to
+     * receive new data points.
+     * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + * @return Whether the conditionAbsent field is set. + */ + @java.lang.Override + public boolean hasConditionAbsent() { + return conditionCase_ == 2; + } + /** + * + * + *
+     * A condition that checks that a time series continues to
+     * receive new data points.
+     * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + * @return The conditionAbsent. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence getConditionAbsent() { + if (conditionCase_ == 2) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); + } + /** + * + * + *
+     * A condition that checks that a time series continues to
+     * receive new data points.
+     * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder + getConditionAbsentOrBuilder() { + if (conditionCase_ == 2) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); + } + + public static final int CONDITION_MATCHED_LOG_FIELD_NUMBER = 20; + /** + * + * + *
+     * A condition that checks for log messages matching given constraints. If
+     * set, no other conditions can be present.
+     * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * + * @return Whether the conditionMatchedLog field is set. + */ + @java.lang.Override + public boolean hasConditionMatchedLog() { + return conditionCase_ == 20; + } + /** + * + * + *
+     * A condition that checks for log messages matching given constraints. If
+     * set, no other conditions can be present.
+     * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * + * @return The conditionMatchedLog. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch getConditionMatchedLog() { + if (conditionCase_ == 20) { + return (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); + } + /** + * + * + *
+     * A condition that checks for log messages matching given constraints. If
+     * set, no other conditions can be present.
+     * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder + getConditionMatchedLogOrBuilder() { + if (conditionCase_ == 20) { + return (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); + } + + public static final int CONDITION_MONITORING_QUERY_LANGUAGE_FIELD_NUMBER = 19; + /** + * + * + *
+     * A condition that uses the Monitoring Query Language to define
+     * alerts.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * + * + * @return Whether the conditionMonitoringQueryLanguage field is set. + */ + @java.lang.Override + public boolean hasConditionMonitoringQueryLanguage() { + return conditionCase_ == 19; + } + /** + * + * + *
+     * A condition that uses the Monitoring Query Language to define
+     * alerts.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * + * + * @return The conditionMonitoringQueryLanguage. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + getConditionMonitoringQueryLanguage() { + if (conditionCase_ == 19) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .getDefaultInstance(); + } + /** + * + * + *
+     * A condition that uses the Monitoring Query Language to define
+     * alerts.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageConditionOrBuilder + getConditionMonitoringQueryLanguageOrBuilder() { + if (conditionCase_ == 19) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .getDefaultInstance(); + } + + public static final int CONDITION_PROMETHEUS_QUERY_LANGUAGE_FIELD_NUMBER = 21; + /** + * + * + *
+     * A condition that uses the Prometheus query language to define alerts.
      * 
* - * string display_name = 6; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; + * * - * @return The bytes for displayName. + * @return Whether the conditionPrometheusQueryLanguage field is set. */ @java.lang.Override - public com.google.protobuf.ByteString getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public boolean hasConditionPrometheusQueryLanguage() { + return conditionCase_ == 21; } - - public static final int CONDITION_THRESHOLD_FIELD_NUMBER = 1; /** * * *
-     * A condition that compares a time series against a threshold.
+     * A condition that uses the Prometheus query language to define alerts.
      * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; * * - * @return Whether the conditionThreshold field is set. + * @return The conditionPrometheusQueryLanguage. */ @java.lang.Override - public boolean hasConditionThreshold() { - return conditionCase_ == 1; + public com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + getConditionPrometheusQueryLanguage() { + if (conditionCase_ == 21) { + return (com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) + condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + .getDefaultInstance(); } /** * * *
-     * A condition that compares a time series against a threshold.
+     * A condition that uses the Prometheus query language to define alerts.
      * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; * - * - * @return The conditionThreshold. */ @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold getConditionThreshold() { + public com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageConditionOrBuilder + getConditionPrometheusQueryLanguageOrBuilder() { + if (conditionCase_ == 21) { + return (com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) + condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + .getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (conditionCase_ == 1) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_; + output.writeMessage( + 1, (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_); } - return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.getDefaultInstance(); + if (conditionCase_ == 2) { + output.writeMessage( + 2, (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, name_); + } + if (conditionCase_ == 19) { + output.writeMessage( + 19, + (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + condition_); + } + if (conditionCase_ == 20) { + output.writeMessage( + 20, (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_); + } + if (conditionCase_ == 21) { + output.writeMessage( + 21, + (com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) + condition_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (conditionCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_); + } + if (conditionCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, name_); + } + if (conditionCase_ == 19) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 19, + (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + condition_); + } + if (conditionCase_ == 20) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 20, (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_); + } + if (conditionCase_ == 21) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 21, + (com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) + condition_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.v3.AlertPolicy.Condition)) { + return super.equals(obj); + } + com.google.monitoring.v3.AlertPolicy.Condition other = + (com.google.monitoring.v3.AlertPolicy.Condition) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getConditionCase().equals(other.getConditionCase())) return false; + switch (conditionCase_) { + case 1: + if (!getConditionThreshold().equals(other.getConditionThreshold())) return false; + break; + case 2: + if (!getConditionAbsent().equals(other.getConditionAbsent())) return false; + break; + case 20: + if (!getConditionMatchedLog().equals(other.getConditionMatchedLog())) return false; + break; + case 19: + if (!getConditionMonitoringQueryLanguage() + .equals(other.getConditionMonitoringQueryLanguage())) return false; + break; + case 21: + if (!getConditionPrometheusQueryLanguage() + .equals(other.getConditionPrometheusQueryLanguage())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + switch (conditionCase_) { + case 1: + hash = (37 * hash) + CONDITION_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getConditionThreshold().hashCode(); + break; + case 2: + hash = (37 * hash) + CONDITION_ABSENT_FIELD_NUMBER; + hash = (53 * hash) + getConditionAbsent().hashCode(); + break; + case 20: + hash = (37 * hash) + CONDITION_MATCHED_LOG_FIELD_NUMBER; + hash = (53 * hash) + getConditionMatchedLog().hashCode(); + break; + case 19: + hash = (37 * hash) + CONDITION_MONITORING_QUERY_LANGUAGE_FIELD_NUMBER; + hash = (53 * hash) + getConditionMonitoringQueryLanguage().hashCode(); + break; + case 21: + hash = (37 * hash) + CONDITION_PROMETHEUS_QUERY_LANGUAGE_FIELD_NUMBER; + hash = (53 * hash) + getConditionPrometheusQueryLanguage().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - /** - * - * - *
-     * A condition that compares a time series against a threshold.
-     * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; - * - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder - getConditionThresholdOrBuilder() { - if (conditionCase_ == 1) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.getDefaultInstance(); + + public static com.google.monitoring.v3.AlertPolicy.Condition parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); } - public static final int CONDITION_ABSENT_FIELD_NUMBER = 2; - /** - * - * - *
-     * A condition that checks that a time series continues to
-     * receive new data points.
-     * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; - * - * @return Whether the conditionAbsent field is set. - */ - @java.lang.Override - public boolean hasConditionAbsent() { - return conditionCase_ == 2; + public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - /** - * - * - *
-     * A condition that checks that a time series continues to
-     * receive new data points.
-     * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; - * - * @return The conditionAbsent. - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence getConditionAbsent() { - if (conditionCase_ == 2) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); + + public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - /** - * - * - *
-     * A condition that checks that a time series continues to
-     * receive new data points.
-     * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; - */ + @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder - getConditionAbsentOrBuilder() { - if (conditionCase_ == 2) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.monitoring.v3.AlertPolicy.Condition prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public static final int CONDITION_MATCHED_LOG_FIELD_NUMBER = 20; - /** - * - * - *
-     * A condition that checks for log messages matching given constraints. If
-     * set, no other conditions can be present.
-     * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * - * @return Whether the conditionMatchedLog field is set. - */ @java.lang.Override - public boolean hasConditionMatchedLog() { - return conditionCase_ == 20; + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - /** - * - * - *
-     * A condition that checks for log messages matching given constraints. If
-     * set, no other conditions can be present.
-     * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * - * @return The conditionMatchedLog. - */ + @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch getConditionMatchedLog() { - if (conditionCase_ == 20) { - return (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; } /** * * *
-     * A condition that checks for log messages matching given constraints. If
-     * set, no other conditions can be present.
+     * A condition is a true/false test that determines when an alerting policy
+     * should open an incident. If a condition evaluates to true, it signifies
+     * that something is wrong.
      * 
* - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition} */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder - getConditionMatchedLogOrBuilder() { - if (conditionCase_ == 20) { - return (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_; + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition) + com.google.monitoring.v3.AlertPolicy.ConditionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.Condition.class, + com.google.monitoring.v3.AlertPolicy.Condition.Builder.class); + } + + // Construct using com.google.monitoring.v3.AlertPolicy.Condition.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + if (conditionThresholdBuilder_ != null) { + conditionThresholdBuilder_.clear(); + } + if (conditionAbsentBuilder_ != null) { + conditionAbsentBuilder_.clear(); + } + if (conditionMatchedLogBuilder_ != null) { + conditionMatchedLogBuilder_.clear(); + } + if (conditionMonitoringQueryLanguageBuilder_ != null) { + conditionMonitoringQueryLanguageBuilder_.clear(); + } + if (conditionPrometheusQueryLanguageBuilder_ != null) { + conditionPrometheusQueryLanguageBuilder_.clear(); + } + conditionCase_ = 0; + condition_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition getDefaultInstanceForType() { + return com.google.monitoring.v3.AlertPolicy.Condition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition build() { + com.google.monitoring.v3.AlertPolicy.Condition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition buildPartial() { + com.google.monitoring.v3.AlertPolicy.Condition result = + new com.google.monitoring.v3.AlertPolicy.Condition(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.monitoring.v3.AlertPolicy.Condition result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + } + + private void buildPartialOneofs(com.google.monitoring.v3.AlertPolicy.Condition result) { + result.conditionCase_ = conditionCase_; + result.condition_ = this.condition_; + if (conditionCase_ == 1 && conditionThresholdBuilder_ != null) { + result.condition_ = conditionThresholdBuilder_.build(); + } + if (conditionCase_ == 2 && conditionAbsentBuilder_ != null) { + result.condition_ = conditionAbsentBuilder_.build(); + } + if (conditionCase_ == 20 && conditionMatchedLogBuilder_ != null) { + result.condition_ = conditionMatchedLogBuilder_.build(); + } + if (conditionCase_ == 19 && conditionMonitoringQueryLanguageBuilder_ != null) { + result.condition_ = conditionMonitoringQueryLanguageBuilder_.build(); + } + if (conditionCase_ == 21 && conditionPrometheusQueryLanguageBuilder_ != null) { + result.condition_ = conditionPrometheusQueryLanguageBuilder_.build(); + } } - return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); - } - public static final int CONDITION_MONITORING_QUERY_LANGUAGE_FIELD_NUMBER = 19; - /** - * - * - *
-     * A condition that uses the Monitoring Query Language to define
-     * alerts.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - * - * @return Whether the conditionMonitoringQueryLanguage field is set. - */ - @java.lang.Override - public boolean hasConditionMonitoringQueryLanguage() { - return conditionCase_ == 19; - } - /** - * - * - *
-     * A condition that uses the Monitoring Query Language to define
-     * alerts.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - * - * @return The conditionMonitoringQueryLanguage. - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - getConditionMonitoringQueryLanguage() { - if (conditionCase_ == 19) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) - condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - .getDefaultInstance(); - } - /** - * - * - *
-     * A condition that uses the Monitoring Query Language to define
-     * alerts.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageConditionOrBuilder - getConditionMonitoringQueryLanguageOrBuilder() { - if (conditionCase_ == 19) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) - condition_; + @java.lang.Override + public Builder clone() { + return super.clone(); } - return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - .getDefaultInstance(); - } - private byte memoizedIsInitialized = -1; + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } - memoizedIsInitialized = 1; - return true; - } + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (conditionCase_ == 1) { - output.writeMessage( - 1, (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_); + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - if (conditionCase_ == 2) { - output.writeMessage( - 2, (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_); + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, displayName_); + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.v3.AlertPolicy.Condition) { + return mergeFrom((com.google.monitoring.v3.AlertPolicy.Condition) other); + } else { + super.mergeFrom(other); + return this; + } } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, name_); + + public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy.Condition other) { + if (other == com.google.monitoring.v3.AlertPolicy.Condition.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + switch (other.getConditionCase()) { + case CONDITION_THRESHOLD: + { + mergeConditionThreshold(other.getConditionThreshold()); + break; + } + case CONDITION_ABSENT: + { + mergeConditionAbsent(other.getConditionAbsent()); + break; + } + case CONDITION_MATCHED_LOG: + { + mergeConditionMatchedLog(other.getConditionMatchedLog()); + break; + } + case CONDITION_MONITORING_QUERY_LANGUAGE: + { + mergeConditionMonitoringQueryLanguage(other.getConditionMonitoringQueryLanguage()); + break; + } + case CONDITION_PROMETHEUS_QUERY_LANGUAGE: + { + mergeConditionPrometheusQueryLanguage(other.getConditionPrometheusQueryLanguage()); + break; + } + case CONDITION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; } - if (conditionCase_ == 19) { - output.writeMessage( - 19, - (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) - condition_); + + @java.lang.Override + public final boolean isInitialized() { + return true; } - if (conditionCase_ == 20) { - output.writeMessage( - 20, (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_); + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getConditionThresholdFieldBuilder().getBuilder(), extensionRegistry); + conditionCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + getConditionAbsentFieldBuilder().getBuilder(), extensionRegistry); + conditionCase_ = 2; + break; + } // case 18 + case 50: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 50 + case 98: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 98 + case 154: + { + input.readMessage( + getConditionMonitoringQueryLanguageFieldBuilder().getBuilder(), + extensionRegistry); + conditionCase_ = 19; + break; + } // case 154 + case 162: + { + input.readMessage( + getConditionMatchedLogFieldBuilder().getBuilder(), extensionRegistry); + conditionCase_ = 20; + break; + } // case 162 + case 170: + { + input.readMessage( + getConditionPrometheusQueryLanguageFieldBuilder().getBuilder(), + extensionRegistry); + conditionCase_ = 21; + break; + } // case 170 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; } - getUnknownFields().writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + private int conditionCase_ = 0; + private java.lang.Object condition_; - size = 0; - if (conditionCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 1, (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_); - } - if (conditionCase_ == 2) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 2, (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, displayName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, name_); - } - if (conditionCase_ == 19) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 19, - (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) - condition_); + public ConditionCase getConditionCase() { + return ConditionCase.forNumber(conditionCase_); } - if (conditionCase_ == 20) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 20, (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_); + + public Builder clearCondition() { + conditionCase_ = 0; + condition_ = null; + onChanged(); + return this; } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Required if the condition exists. The unique resource name for this
+       * condition. Its format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
+       *
+       * `[CONDITION_ID]` is assigned by Cloud Monitoring when the
+       * condition is created as part of a new or updated alerting policy.
+       *
+       * When calling the
+       * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
+       * method, do not include the `name` field in the conditions of the
+       * requested alerting policy. Cloud Monitoring creates the
+       * condition identifiers and includes them in the new policy.
+       *
+       * When calling the
+       * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
+       * method to update a policy, including a condition `name` causes the
+       * existing condition to be updated. Conditions without names are added to
+       * the updated policy. Existing conditions are deleted if they are not
+       * updated.
+       *
+       * Best practice is to preserve `[CONDITION_ID]` if you make only small
+       * changes, such as those to condition thresholds, durations, or trigger
+       * values.  Otherwise, treat the change as a new condition and let the
+       * existing condition be deleted.
+       * 
+ * + * string name = 12; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - if (!(obj instanceof com.google.monitoring.v3.AlertPolicy.Condition)) { - return super.equals(obj); + /** + * + * + *
+       * Required if the condition exists. The unique resource name for this
+       * condition. Its format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
+       *
+       * `[CONDITION_ID]` is assigned by Cloud Monitoring when the
+       * condition is created as part of a new or updated alerting policy.
+       *
+       * When calling the
+       * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
+       * method, do not include the `name` field in the conditions of the
+       * requested alerting policy. Cloud Monitoring creates the
+       * condition identifiers and includes them in the new policy.
+       *
+       * When calling the
+       * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
+       * method to update a policy, including a condition `name` causes the
+       * existing condition to be updated. Conditions without names are added to
+       * the updated policy. Existing conditions are deleted if they are not
+       * updated.
+       *
+       * Best practice is to preserve `[CONDITION_ID]` if you make only small
+       * changes, such as those to condition thresholds, durations, or trigger
+       * values.  Otherwise, treat the change as a new condition and let the
+       * existing condition be deleted.
+       * 
+ * + * string name = 12; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - com.google.monitoring.v3.AlertPolicy.Condition other = - (com.google.monitoring.v3.AlertPolicy.Condition) obj; - - if (!getName().equals(other.getName())) return false; - if (!getDisplayName().equals(other.getDisplayName())) return false; - if (!getConditionCase().equals(other.getConditionCase())) return false; - switch (conditionCase_) { - case 1: - if (!getConditionThreshold().equals(other.getConditionThreshold())) return false; - break; - case 2: - if (!getConditionAbsent().equals(other.getConditionAbsent())) return false; - break; - case 20: - if (!getConditionMatchedLog().equals(other.getConditionMatchedLog())) return false; - break; - case 19: - if (!getConditionMonitoringQueryLanguage() - .equals(other.getConditionMonitoringQueryLanguage())) return false; - break; - case 0: - default: + /** + * + * + *
+       * Required if the condition exists. The unique resource name for this
+       * condition. Its format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
+       *
+       * `[CONDITION_ID]` is assigned by Cloud Monitoring when the
+       * condition is created as part of a new or updated alerting policy.
+       *
+       * When calling the
+       * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
+       * method, do not include the `name` field in the conditions of the
+       * requested alerting policy. Cloud Monitoring creates the
+       * condition identifiers and includes them in the new policy.
+       *
+       * When calling the
+       * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
+       * method to update a policy, including a condition `name` causes the
+       * existing condition to be updated. Conditions without names are added to
+       * the updated policy. Existing conditions are deleted if they are not
+       * updated.
+       *
+       * Best practice is to preserve `[CONDITION_ID]` if you make only small
+       * changes, such as those to condition thresholds, durations, or trigger
+       * values.  Otherwise, treat the change as a new condition and let the
+       * existing condition be deleted.
+       * 
+ * + * string name = 12; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required if the condition exists. The unique resource name for this
+       * condition. Its format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
+       *
+       * `[CONDITION_ID]` is assigned by Cloud Monitoring when the
+       * condition is created as part of a new or updated alerting policy.
+       *
+       * When calling the
+       * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
+       * method, do not include the `name` field in the conditions of the
+       * requested alerting policy. Cloud Monitoring creates the
+       * condition identifiers and includes them in the new policy.
+       *
+       * When calling the
+       * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
+       * method to update a policy, including a condition `name` causes the
+       * existing condition to be updated. Conditions without names are added to
+       * the updated policy. Existing conditions are deleted if they are not
+       * updated.
+       *
+       * Best practice is to preserve `[CONDITION_ID]` if you make only small
+       * changes, such as those to condition thresholds, durations, or trigger
+       * values.  Otherwise, treat the change as a new condition and let the
+       * existing condition be deleted.
+       * 
+ * + * string name = 12; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Required if the condition exists. The unique resource name for this
+       * condition. Its format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
+       *
+       * `[CONDITION_ID]` is assigned by Cloud Monitoring when the
+       * condition is created as part of a new or updated alerting policy.
+       *
+       * When calling the
+       * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
+       * method, do not include the `name` field in the conditions of the
+       * requested alerting policy. Cloud Monitoring creates the
+       * condition identifiers and includes them in the new policy.
+       *
+       * When calling the
+       * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
+       * method to update a policy, including a condition `name` causes the
+       * existing condition to be updated. Conditions without names are added to
+       * the updated policy. Existing conditions are deleted if they are not
+       * updated.
+       *
+       * Best practice is to preserve `[CONDITION_ID]` if you make only small
+       * changes, such as those to condition thresholds, durations, or trigger
+       * values.  Otherwise, treat the change as a new condition and let the
+       * existing condition be deleted.
+       * 
+ * + * string name = 12; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + private java.lang.Object displayName_ = ""; + /** + * + * + *
+       * A short name or phrase used to identify the condition in dashboards,
+       * notifications, and incidents. To avoid confusion, don't use the same
+       * display name for multiple conditions in the same policy.
+       * 
+ * + * string display_name = 6; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDisplayName().hashCode(); - switch (conditionCase_) { - case 1: - hash = (37 * hash) + CONDITION_THRESHOLD_FIELD_NUMBER; - hash = (53 * hash) + getConditionThreshold().hashCode(); - break; - case 2: - hash = (37 * hash) + CONDITION_ABSENT_FIELD_NUMBER; - hash = (53 * hash) + getConditionAbsent().hashCode(); - break; - case 20: - hash = (37 * hash) + CONDITION_MATCHED_LOG_FIELD_NUMBER; - hash = (53 * hash) + getConditionMatchedLog().hashCode(); - break; - case 19: - hash = (37 * hash) + CONDITION_MONITORING_QUERY_LANGUAGE_FIELD_NUMBER; - hash = (53 * hash) + getConditionMonitoringQueryLanguage().hashCode(); - break; - case 0: - default: + /** + * + * + *
+       * A short name or phrase used to identify the condition in dashboards,
+       * notifications, and incidents. To avoid confusion, don't use the same
+       * display name for multiple conditions in the same policy.
+       * 
+ * + * string display_name = 6; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.monitoring.v3.AlertPolicy.Condition prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * A condition is a true/false test that determines when an alerting policy
-     * should open an incident. If a condition evaluates to true, it signifies
-     * that something is wrong.
-     * 
- * - * Protobuf type {@code google.monitoring.v3.AlertPolicy.Condition} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition) - com.google.monitoring.v3.AlertPolicy.ConditionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor; + /** + * + * + *
+       * A short name or phrase used to identify the condition in dashboards,
+       * notifications, and incidents. To avoid confusion, don't use the same
+       * display name for multiple conditions in the same policy.
+       * 
+ * + * string display_name = 6; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.Condition.class, - com.google.monitoring.v3.AlertPolicy.Condition.Builder.class); + /** + * + * + *
+       * A short name or phrase used to identify the condition in dashboards,
+       * notifications, and incidents. To avoid confusion, don't use the same
+       * display name for multiple conditions in the same policy.
+       * 
+ * + * string display_name = 6; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; } - - // Construct using com.google.monitoring.v3.AlertPolicy.Condition.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + /** + * + * + *
+       * A short name or phrase used to identify the condition in dashboards,
+       * notifications, and incidents. To avoid confusion, don't use the same
+       * display name for multiple conditions in the same policy.
+       * 
+ * + * string display_name = 6; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder> + conditionThresholdBuilder_; + /** + * + * + *
+       * A condition that compares a time series against a threshold.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * + * @return Whether the conditionThreshold field is set. + */ @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - displayName_ = ""; - if (conditionThresholdBuilder_ != null) { - conditionThresholdBuilder_.clear(); + public boolean hasConditionThreshold() { + return conditionCase_ == 1; + } + /** + * + * + *
+       * A condition that compares a time series against a threshold.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * + * @return The conditionThreshold. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + getConditionThreshold() { + if (conditionThresholdBuilder_ == null) { + if (conditionCase_ == 1) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .getDefaultInstance(); + } else { + if (conditionCase_ == 1) { + return conditionThresholdBuilder_.getMessage(); + } + return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .getDefaultInstance(); } - if (conditionAbsentBuilder_ != null) { - conditionAbsentBuilder_.clear(); + } + /** + * + * + *
+       * A condition that compares a time series against a threshold.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + */ + public Builder setConditionThreshold( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold value) { + if (conditionThresholdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + condition_ = value; + onChanged(); + } else { + conditionThresholdBuilder_.setMessage(value); } - if (conditionMatchedLogBuilder_ != null) { - conditionMatchedLogBuilder_.clear(); + conditionCase_ = 1; + return this; + } + /** + * + * + *
+       * A condition that compares a time series against a threshold.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + */ + public Builder setConditionThreshold( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder builderForValue) { + if (conditionThresholdBuilder_ == null) { + condition_ = builderForValue.build(); + onChanged(); + } else { + conditionThresholdBuilder_.setMessage(builderForValue.build()); } - if (conditionMonitoringQueryLanguageBuilder_ != null) { - conditionMonitoringQueryLanguageBuilder_.clear(); + conditionCase_ = 1; + return this; + } + /** + * + * + *
+       * A condition that compares a time series against a threshold.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + */ + public Builder mergeConditionThreshold( + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold value) { + if (conditionThresholdBuilder_ == null) { + if (conditionCase_ == 1 + && condition_ + != com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .getDefaultInstance()) { + condition_ = + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.newBuilder( + (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_) + .mergeFrom(value) + .buildPartial(); + } else { + condition_ = value; + } + onChanged(); + } else { + if (conditionCase_ == 1) { + conditionThresholdBuilder_.mergeFrom(value); + } else { + conditionThresholdBuilder_.setMessage(value); + } + } + conditionCase_ = 1; + return this; + } + /** + * + * + *
+       * A condition that compares a time series against a threshold.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + */ + public Builder clearConditionThreshold() { + if (conditionThresholdBuilder_ == null) { + if (conditionCase_ == 1) { + conditionCase_ = 0; + condition_ = null; + onChanged(); + } + } else { + if (conditionCase_ == 1) { + conditionCase_ = 0; + condition_ = null; + } + conditionThresholdBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A condition that compares a time series against a threshold.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + */ + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder + getConditionThresholdBuilder() { + return getConditionThresholdFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A condition that compares a time series against a threshold.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder + getConditionThresholdOrBuilder() { + if ((conditionCase_ == 1) && (conditionThresholdBuilder_ != null)) { + return conditionThresholdBuilder_.getMessageOrBuilder(); + } else { + if (conditionCase_ == 1) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + .getDefaultInstance(); } - conditionCase_ = 0; - condition_ = null; - return this; } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor; + /** + * + * + *
+       * A condition that compares a time series against a threshold.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder> + getConditionThresholdFieldBuilder() { + if (conditionThresholdBuilder_ == null) { + if (!(conditionCase_ == 1)) { + condition_ = + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.getDefaultInstance(); + } + conditionThresholdBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder>( + (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_, + getParentForChildren(), + isClean()); + condition_ = null; + } + conditionCase_ = 1; + onChanged(); + return conditionThresholdBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence, + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder> + conditionAbsentBuilder_; + /** + * + * + *
+       * A condition that checks that a time series continues to
+       * receive new data points.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + * + * @return Whether the conditionAbsent field is set. + */ @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition getDefaultInstanceForType() { - return com.google.monitoring.v3.AlertPolicy.Condition.getDefaultInstance(); + public boolean hasConditionAbsent() { + return conditionCase_ == 2; } - + /** + * + * + *
+       * A condition that checks that a time series continues to
+       * receive new data points.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + * + * @return The conditionAbsent. + */ @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition build() { - com.google.monitoring.v3.AlertPolicy.Condition result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence getConditionAbsent() { + if (conditionAbsentBuilder_ == null) { + if (conditionCase_ == 2) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); + } else { + if (conditionCase_ == 2) { + return conditionAbsentBuilder_.getMessage(); + } + return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); } - return result; } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition buildPartial() { - com.google.monitoring.v3.AlertPolicy.Condition result = - new com.google.monitoring.v3.AlertPolicy.Condition(this); - if (bitField0_ != 0) { - buildPartial0(result); + /** + * + * + *
+       * A condition that checks that a time series continues to
+       * receive new data points.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + */ + public Builder setConditionAbsent( + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence value) { + if (conditionAbsentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + condition_ = value; + onChanged(); + } else { + conditionAbsentBuilder_.setMessage(value); } - buildPartialOneofs(result); - onBuilt(); - return result; + conditionCase_ = 2; + return this; } - - private void buildPartial0(com.google.monitoring.v3.AlertPolicy.Condition result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.displayName_ = displayName_; + /** + * + * + *
+       * A condition that checks that a time series continues to
+       * receive new data points.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + */ + public Builder setConditionAbsent( + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder builderForValue) { + if (conditionAbsentBuilder_ == null) { + condition_ = builderForValue.build(); + onChanged(); + } else { + conditionAbsentBuilder_.setMessage(builderForValue.build()); } + conditionCase_ = 2; + return this; } - - private void buildPartialOneofs(com.google.monitoring.v3.AlertPolicy.Condition result) { - result.conditionCase_ = conditionCase_; - result.condition_ = this.condition_; - if (conditionCase_ == 1 && conditionThresholdBuilder_ != null) { - result.condition_ = conditionThresholdBuilder_.build(); - } - if (conditionCase_ == 2 && conditionAbsentBuilder_ != null) { - result.condition_ = conditionAbsentBuilder_.build(); - } - if (conditionCase_ == 20 && conditionMatchedLogBuilder_ != null) { - result.condition_ = conditionMatchedLogBuilder_.build(); - } - if (conditionCase_ == 19 && conditionMonitoringQueryLanguageBuilder_ != null) { - result.condition_ = conditionMonitoringQueryLanguageBuilder_.build(); + /** + * + * + *
+       * A condition that checks that a time series continues to
+       * receive new data points.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + */ + public Builder mergeConditionAbsent( + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence value) { + if (conditionAbsentBuilder_ == null) { + if (conditionCase_ == 2 + && condition_ + != com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + .getDefaultInstance()) { + condition_ = + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.newBuilder( + (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_) + .mergeFrom(value) + .buildPartial(); + } else { + condition_ = value; + } + onChanged(); + } else { + if (conditionCase_ == 2) { + conditionAbsentBuilder_.mergeFrom(value); + } else { + conditionAbsentBuilder_.setMessage(value); + } } + conditionCase_ = 2; + return this; } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * + * + *
+       * A condition that checks that a time series continues to
+       * receive new data points.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + */ + public Builder clearConditionAbsent() { + if (conditionAbsentBuilder_ == null) { + if (conditionCase_ == 2) { + conditionCase_ = 0; + condition_ = null; + onChanged(); + } + } else { + if (conditionCase_ == 2) { + conditionCase_ = 0; + condition_ = null; + } + conditionAbsentBuilder_.clear(); + } + return this; } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + /** + * + * + *
+       * A condition that checks that a time series continues to
+       * receive new data points.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + */ + public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder + getConditionAbsentBuilder() { + return getConditionAbsentFieldBuilder().getBuilder(); } - + /** + * + * + *
+       * A condition that checks that a time series continues to
+       * receive new data points.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + */ @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.monitoring.v3.AlertPolicy.Condition) { - return mergeFrom((com.google.monitoring.v3.AlertPolicy.Condition) other); + public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder + getConditionAbsentOrBuilder() { + if ((conditionCase_ == 2) && (conditionAbsentBuilder_ != null)) { + return conditionAbsentBuilder_.getMessageOrBuilder(); } else { - super.mergeFrom(other); - return this; + if (conditionCase_ == 2) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); } } - - public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy.Condition other) { - if (other == com.google.monitoring.v3.AlertPolicy.Condition.getDefaultInstance()) - return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getDisplayName().isEmpty()) { - displayName_ = other.displayName_; - bitField0_ |= 0x00000002; - onChanged(); - } - switch (other.getConditionCase()) { - case CONDITION_THRESHOLD: - { - mergeConditionThreshold(other.getConditionThreshold()); - break; - } - case CONDITION_ABSENT: - { - mergeConditionAbsent(other.getConditionAbsent()); - break; - } - case CONDITION_MATCHED_LOG: - { - mergeConditionMatchedLog(other.getConditionMatchedLog()); - break; - } - case CONDITION_MONITORING_QUERY_LANGUAGE: - { - mergeConditionMonitoringQueryLanguage(other.getConditionMonitoringQueryLanguage()); - break; - } - case CONDITION_NOT_SET: - { - break; - } + /** + * + * + *
+       * A condition that checks that a time series continues to
+       * receive new data points.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence, + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder> + getConditionAbsentFieldBuilder() { + if (conditionAbsentBuilder_ == null) { + if (!(conditionCase_ == 2)) { + condition_ = + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); + } + conditionAbsentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence, + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder>( + (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_, + getParentForChildren(), + isClean()); + condition_ = null; } - this.mergeUnknownFields(other.getUnknownFields()); + conditionCase_ = 2; onChanged(); - return this; + return conditionAbsentBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch, + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder> + conditionMatchedLogBuilder_; + /** + * + * + *
+       * A condition that checks for log messages matching given constraints. If
+       * set, no other conditions can be present.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * + * + * @return Whether the conditionMatchedLog field is set. + */ @java.lang.Override - public final boolean isInitialized() { - return true; + public boolean hasConditionMatchedLog() { + return conditionCase_ == 20; } - + /** + * + * + *
+       * A condition that checks for log messages matching given constraints. If
+       * set, no other conditions can be present.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * + * + * @return The conditionMatchedLog. + */ @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage( - getConditionThresholdFieldBuilder().getBuilder(), extensionRegistry); - conditionCase_ = 1; - break; - } // case 10 - case 18: - { - input.readMessage( - getConditionAbsentFieldBuilder().getBuilder(), extensionRegistry); - conditionCase_ = 2; - break; - } // case 18 - case 50: - { - displayName_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 50 - case 98: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 98 - case 154: - { - input.readMessage( - getConditionMonitoringQueryLanguageFieldBuilder().getBuilder(), - extensionRegistry); - conditionCase_ = 19; - break; - } // case 154 - case 162: - { - input.readMessage( - getConditionMatchedLogFieldBuilder().getBuilder(), extensionRegistry); - conditionCase_ = 20; - break; - } // case 162 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int conditionCase_ = 0; - private java.lang.Object condition_; - - public ConditionCase getConditionCase() { - return ConditionCase.forNumber(conditionCase_); - } - - public Builder clearCondition() { - conditionCase_ = 0; - condition_ = null; - onChanged(); - return this; + public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch getConditionMatchedLog() { + if (conditionMatchedLogBuilder_ == null) { + if (conditionCase_ == 20) { + return (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); + } else { + if (conditionCase_ == 20) { + return conditionMatchedLogBuilder_.getMessage(); + } + return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); + } } - - private int bitField0_; - - private java.lang.Object name_ = ""; /** * * *
-       * Required if the condition exists. The unique resource name for this
-       * condition. Its format is:
-       *
-       *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
-       *
-       * `[CONDITION_ID]` is assigned by Cloud Monitoring when the
-       * condition is created as part of a new or updated alerting policy.
+       * A condition that checks for log messages matching given constraints. If
+       * set, no other conditions can be present.
+       * 
* - * When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the conditions of the - * requested alerting policy. Cloud Monitoring creates the - * condition identifiers and includes them in the new policy. + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * + */ + public Builder setConditionMatchedLog( + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch value) { + if (conditionMatchedLogBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + condition_ = value; + onChanged(); + } else { + conditionMatchedLogBuilder_.setMessage(value); + } + conditionCase_ = 20; + return this; + } + /** * - * When calling the - * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] - * method to update a policy, including a condition `name` causes the - * existing condition to be updated. Conditions without names are added to - * the updated policy. Existing conditions are deleted if they are not - * updated. * - * Best practice is to preserve `[CONDITION_ID]` if you make only small - * changes, such as those to condition thresholds, durations, or trigger - * values. Otherwise, treat the change as a new condition and let the - * existing condition be deleted. + *
+       * A condition that checks for log messages matching given constraints. If
+       * set, no other conditions can be present.
        * 
* - * string name = 12; - * - * @return The name. + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; + public Builder setConditionMatchedLog( + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder builderForValue) { + if (conditionMatchedLogBuilder_ == null) { + condition_ = builderForValue.build(); + onChanged(); } else { - return (java.lang.String) ref; + conditionMatchedLogBuilder_.setMessage(builderForValue.build()); } + conditionCase_ = 20; + return this; } /** * * *
-       * Required if the condition exists. The unique resource name for this
-       * condition. Its format is:
-       *
-       *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
-       *
-       * `[CONDITION_ID]` is assigned by Cloud Monitoring when the
-       * condition is created as part of a new or updated alerting policy.
+       * A condition that checks for log messages matching given constraints. If
+       * set, no other conditions can be present.
+       * 
* - * When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the conditions of the - * requested alerting policy. Cloud Monitoring creates the - * condition identifiers and includes them in the new policy. + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * + */ + public Builder mergeConditionMatchedLog( + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch value) { + if (conditionMatchedLogBuilder_ == null) { + if (conditionCase_ == 20 + && condition_ + != com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance()) { + condition_ = + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.newBuilder( + (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_) + .mergeFrom(value) + .buildPartial(); + } else { + condition_ = value; + } + onChanged(); + } else { + if (conditionCase_ == 20) { + conditionMatchedLogBuilder_.mergeFrom(value); + } else { + conditionMatchedLogBuilder_.setMessage(value); + } + } + conditionCase_ = 20; + return this; + } + /** * - * When calling the - * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] - * method to update a policy, including a condition `name` causes the - * existing condition to be updated. Conditions without names are added to - * the updated policy. Existing conditions are deleted if they are not - * updated. * - * Best practice is to preserve `[CONDITION_ID]` if you make only small - * changes, such as those to condition thresholds, durations, or trigger - * values. Otherwise, treat the change as a new condition and let the - * existing condition be deleted. + *
+       * A condition that checks for log messages matching given constraints. If
+       * set, no other conditions can be present.
        * 
* - * string name = 12; - * - * @return The bytes for name. + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; + public Builder clearConditionMatchedLog() { + if (conditionMatchedLogBuilder_ == null) { + if (conditionCase_ == 20) { + conditionCase_ = 0; + condition_ = null; + onChanged(); + } } else { - return (com.google.protobuf.ByteString) ref; + if (conditionCase_ == 20) { + conditionCase_ = 0; + condition_ = null; + } + conditionMatchedLogBuilder_.clear(); } + return this; } /** * * *
-       * Required if the condition exists. The unique resource name for this
-       * condition. Its format is:
+       * A condition that checks for log messages matching given constraints. If
+       * set, no other conditions can be present.
+       * 
* - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * + */ + public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder + getConditionMatchedLogBuilder() { + return getConditionMatchedLogFieldBuilder().getBuilder(); + } + /** * - * `[CONDITION_ID]` is assigned by Cloud Monitoring when the - * condition is created as part of a new or updated alerting policy. * - * When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the conditions of the - * requested alerting policy. Cloud Monitoring creates the - * condition identifiers and includes them in the new policy. + *
+       * A condition that checks for log messages matching given constraints. If
+       * set, no other conditions can be present.
+       * 
* - * When calling the - * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] - * method to update a policy, including a condition `name` causes the - * existing condition to be updated. Conditions without names are added to - * the updated policy. Existing conditions are deleted if they are not - * updated. + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder + getConditionMatchedLogOrBuilder() { + if ((conditionCase_ == 20) && (conditionMatchedLogBuilder_ != null)) { + return conditionMatchedLogBuilder_.getMessageOrBuilder(); + } else { + if (conditionCase_ == 20) { + return (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); + } + } + /** * - * Best practice is to preserve `[CONDITION_ID]` if you make only small - * changes, such as those to condition thresholds, durations, or trigger - * values. Otherwise, treat the change as a new condition and let the - * existing condition be deleted. - *
* - * string name = 12; + *
+       * A condition that checks for log messages matching given constraints. If
+       * set, no other conditions can be present.
+       * 
* - * @param value The name to set. - * @return This builder for chaining. + * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch, + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder> + getConditionMatchedLogFieldBuilder() { + if (conditionMatchedLogBuilder_ == null) { + if (!(conditionCase_ == 20)) { + condition_ = + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); + } + conditionMatchedLogBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch, + com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder, + com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder>( + (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_, + getParentForChildren(), + isClean()); + condition_ = null; } - name_ = value; - bitField0_ |= 0x00000001; + conditionCase_ = 20; onChanged(); - return this; + return conditionMatchedLogBuilder_; } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition, + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .Builder, + com.google.monitoring.v3.AlertPolicy.Condition + .MonitoringQueryLanguageConditionOrBuilder> + conditionMonitoringQueryLanguageBuilder_; /** * * *
-       * Required if the condition exists. The unique resource name for this
-       * condition. Its format is:
-       *
-       *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
-       *
-       * `[CONDITION_ID]` is assigned by Cloud Monitoring when the
-       * condition is created as part of a new or updated alerting policy.
-       *
-       * When calling the
-       * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
-       * method, do not include the `name` field in the conditions of the
-       * requested alerting policy. Cloud Monitoring creates the
-       * condition identifiers and includes them in the new policy.
-       *
-       * When calling the
-       * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
-       * method to update a policy, including a condition `name` causes the
-       * existing condition to be updated. Conditions without names are added to
-       * the updated policy. Existing conditions are deleted if they are not
-       * updated.
-       *
-       * Best practice is to preserve `[CONDITION_ID]` if you make only small
-       * changes, such as those to condition thresholds, durations, or trigger
-       * values.  Otherwise, treat the change as a new condition and let the
-       * existing condition be deleted.
+       * A condition that uses the Monitoring Query Language to define
+       * alerts.
        * 
* - * string name = 12; + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * * - * @return This builder for chaining. + * @return Whether the conditionMonitoringQueryLanguage field is set. */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; + @java.lang.Override + public boolean hasConditionMonitoringQueryLanguage() { + return conditionCase_ == 19; } /** * * *
-       * Required if the condition exists. The unique resource name for this
-       * condition. Its format is:
-       *
-       *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
+       * A condition that uses the Monitoring Query Language to define
+       * alerts.
+       * 
* - * `[CONDITION_ID]` is assigned by Cloud Monitoring when the - * condition is created as part of a new or updated alerting policy. + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * * - * When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the conditions of the - * requested alerting policy. Cloud Monitoring creates the - * condition identifiers and includes them in the new policy. + * @return The conditionMonitoringQueryLanguage. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + getConditionMonitoringQueryLanguage() { + if (conditionMonitoringQueryLanguageBuilder_ == null) { + if (conditionCase_ == 19) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .getDefaultInstance(); + } else { + if (conditionCase_ == 19) { + return conditionMonitoringQueryLanguageBuilder_.getMessage(); + } + return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .getDefaultInstance(); + } + } + /** * - * When calling the - * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] - * method to update a policy, including a condition `name` causes the - * existing condition to be updated. Conditions without names are added to - * the updated policy. Existing conditions are deleted if they are not - * updated. * - * Best practice is to preserve `[CONDITION_ID]` if you make only small - * changes, such as those to condition thresholds, durations, or trigger - * values. Otherwise, treat the change as a new condition and let the - * existing condition be deleted. + *
+       * A condition that uses the Monitoring Query Language to define
+       * alerts.
        * 
* - * string name = 12; - * - * @param value The bytes for name to set. - * @return This builder for chaining. + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder setConditionMonitoringQueryLanguage( + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition value) { + if (conditionMonitoringQueryLanguageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + condition_ = value; + onChanged(); + } else { + conditionMonitoringQueryLanguageBuilder_.setMessage(value); } - checkByteStringIsUtf8(value); - name_ = value; - bitField0_ |= 0x00000001; - onChanged(); + conditionCase_ = 19; return this; } - - private java.lang.Object displayName_ = ""; /** * * *
-       * A short name or phrase used to identify the condition in dashboards,
-       * notifications, and incidents. To avoid confusion, don't use the same
-       * display name for multiple conditions in the same policy.
+       * A condition that uses the Monitoring Query Language to define
+       * alerts.
        * 
* - * string display_name = 6; - * - * @return The displayName. + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; + public Builder setConditionMonitoringQueryLanguage( + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition.Builder + builderForValue) { + if (conditionMonitoringQueryLanguageBuilder_ == null) { + condition_ = builderForValue.build(); + onChanged(); } else { - return (java.lang.String) ref; + conditionMonitoringQueryLanguageBuilder_.setMessage(builderForValue.build()); } + conditionCase_ = 19; + return this; } /** * * *
-       * A short name or phrase used to identify the condition in dashboards,
-       * notifications, and incidents. To avoid confusion, don't use the same
-       * display name for multiple conditions in the same policy.
+       * A condition that uses the Monitoring Query Language to define
+       * alerts.
        * 
* - * string display_name = 6; - * - * @return The bytes for displayName. + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * */ - public com.google.protobuf.ByteString getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - displayName_ = b; - return b; + public Builder mergeConditionMonitoringQueryLanguage( + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition value) { + if (conditionMonitoringQueryLanguageBuilder_ == null) { + if (conditionCase_ == 19 + && condition_ + != com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .getDefaultInstance()) { + condition_ = + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .newBuilder( + (com.google.monitoring.v3.AlertPolicy.Condition + .MonitoringQueryLanguageCondition) + condition_) + .mergeFrom(value) + .buildPartial(); + } else { + condition_ = value; + } + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + if (conditionCase_ == 19) { + conditionMonitoringQueryLanguageBuilder_.mergeFrom(value); + } else { + conditionMonitoringQueryLanguageBuilder_.setMessage(value); + } } + conditionCase_ = 19; + return this; } /** * * *
-       * A short name or phrase used to identify the condition in dashboards,
-       * notifications, and incidents. To avoid confusion, don't use the same
-       * display name for multiple conditions in the same policy.
+       * A condition that uses the Monitoring Query Language to define
+       * alerts.
        * 
* - * string display_name = 6; - * - * @param value The displayName to set. - * @return This builder for chaining. + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * */ - public Builder setDisplayName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder clearConditionMonitoringQueryLanguage() { + if (conditionMonitoringQueryLanguageBuilder_ == null) { + if (conditionCase_ == 19) { + conditionCase_ = 0; + condition_ = null; + onChanged(); + } + } else { + if (conditionCase_ == 19) { + conditionCase_ = 0; + condition_ = null; + } + conditionMonitoringQueryLanguageBuilder_.clear(); } - displayName_ = value; - bitField0_ |= 0x00000002; - onChanged(); return this; } /** * * *
-       * A short name or phrase used to identify the condition in dashboards,
-       * notifications, and incidents. To avoid confusion, don't use the same
-       * display name for multiple conditions in the same policy.
+       * A condition that uses the Monitoring Query Language to define
+       * alerts.
        * 
* - * string display_name = 6; - * - * @return This builder for chaining. + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * */ - public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; + public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition.Builder + getConditionMonitoringQueryLanguageBuilder() { + return getConditionMonitoringQueryLanguageFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A condition that uses the Monitoring Query Language to define
+       * alerts.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition + .MonitoringQueryLanguageConditionOrBuilder + getConditionMonitoringQueryLanguageOrBuilder() { + if ((conditionCase_ == 19) && (conditionMonitoringQueryLanguageBuilder_ != null)) { + return conditionMonitoringQueryLanguageBuilder_.getMessageOrBuilder(); + } else { + if (conditionCase_ == 19) { + return (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + condition_; + } + return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .getDefaultInstance(); + } } /** * * *
-       * A short name or phrase used to identify the condition in dashboards,
-       * notifications, and incidents. To avoid confusion, don't use the same
-       * display name for multiple conditions in the same policy.
+       * A condition that uses the Monitoring Query Language to define
+       * alerts.
        * 
* - * string display_name = 6; - * - * @param value The bytes for displayName to set. - * @return This builder for chaining. + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * */ - public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition, + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .Builder, + com.google.monitoring.v3.AlertPolicy.Condition + .MonitoringQueryLanguageConditionOrBuilder> + getConditionMonitoringQueryLanguageFieldBuilder() { + if (conditionMonitoringQueryLanguageBuilder_ == null) { + if (!(conditionCase_ == 19)) { + condition_ = + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .getDefaultInstance(); + } + conditionMonitoringQueryLanguageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition, + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .Builder, + com.google.monitoring.v3.AlertPolicy.Condition + .MonitoringQueryLanguageConditionOrBuilder>( + (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + condition_, + getParentForChildren(), + isClean()); + condition_ = null; } - checkByteStringIsUtf8(value); - displayName_ = value; - bitField0_ |= 0x00000002; + conditionCase_ = 19; onChanged(); - return this; + return conditionMonitoringQueryLanguageBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold, - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder> - conditionThresholdBuilder_; + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition, + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + .Builder, + com.google.monitoring.v3.AlertPolicy.Condition + .PrometheusQueryLanguageConditionOrBuilder> + conditionPrometheusQueryLanguageBuilder_; /** * * *
-       * A condition that compares a time series against a threshold.
+       * A condition that uses the Prometheus query language to define alerts.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; * * - * @return Whether the conditionThreshold field is set. + * @return Whether the conditionPrometheusQueryLanguage field is set. */ @java.lang.Override - public boolean hasConditionThreshold() { - return conditionCase_ == 1; + public boolean hasConditionPrometheusQueryLanguage() { + return conditionCase_ == 21; } /** * * *
-       * A condition that compares a time series against a threshold.
+       * A condition that uses the Prometheus query language to define alerts.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; * * - * @return The conditionThreshold. + * @return The conditionPrometheusQueryLanguage. */ @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - getConditionThreshold() { - if (conditionThresholdBuilder_ == null) { - if (conditionCase_ == 1) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_; + public com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + getConditionPrometheusQueryLanguage() { + if (conditionPrometheusQueryLanguageBuilder_ == null) { + if (conditionCase_ == 21) { + return (com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) + condition_; } - return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + return com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition .getDefaultInstance(); } else { - if (conditionCase_ == 1) { - return conditionThresholdBuilder_.getMessage(); + if (conditionCase_ == 21) { + return conditionPrometheusQueryLanguageBuilder_.getMessage(); } - return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + return com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition .getDefaultInstance(); } } @@ -13189,67 +18606,74 @@ public boolean hasConditionThreshold() { * * *
-       * A condition that compares a time series against a threshold.
+       * A condition that uses the Prometheus query language to define alerts.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; * */ - public Builder setConditionThreshold( - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold value) { - if (conditionThresholdBuilder_ == null) { + public Builder setConditionPrometheusQueryLanguage( + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition value) { + if (conditionPrometheusQueryLanguageBuilder_ == null) { if (value == null) { throw new NullPointerException(); } condition_ = value; onChanged(); } else { - conditionThresholdBuilder_.setMessage(value); + conditionPrometheusQueryLanguageBuilder_.setMessage(value); } - conditionCase_ = 1; + conditionCase_ = 21; return this; } /** * * *
-       * A condition that compares a time series against a threshold.
+       * A condition that uses the Prometheus query language to define alerts.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; * */ - public Builder setConditionThreshold( - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder builderForValue) { - if (conditionThresholdBuilder_ == null) { + public Builder setConditionPrometheusQueryLanguage( + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder + builderForValue) { + if (conditionPrometheusQueryLanguageBuilder_ == null) { condition_ = builderForValue.build(); onChanged(); } else { - conditionThresholdBuilder_.setMessage(builderForValue.build()); + conditionPrometheusQueryLanguageBuilder_.setMessage(builderForValue.build()); } - conditionCase_ = 1; + conditionCase_ = 21; return this; } /** * * *
-       * A condition that compares a time series against a threshold.
+       * A condition that uses the Prometheus query language to define alerts.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; * */ - public Builder mergeConditionThreshold( - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold value) { - if (conditionThresholdBuilder_ == null) { - if (conditionCase_ == 1 + public Builder mergeConditionPrometheusQueryLanguage( + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition value) { + if (conditionPrometheusQueryLanguageBuilder_ == null) { + if (conditionCase_ == 21 && condition_ - != com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + != com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition .getDefaultInstance()) { condition_ = - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.newBuilder( - (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_) + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + .newBuilder( + (com.google.monitoring.v3.AlertPolicy.Condition + .PrometheusQueryLanguageCondition) + condition_) .mergeFrom(value) .buildPartial(); } else { @@ -13257,38 +18681,39 @@ public Builder mergeConditionThreshold( } onChanged(); } else { - if (conditionCase_ == 1) { - conditionThresholdBuilder_.mergeFrom(value); + if (conditionCase_ == 21) { + conditionPrometheusQueryLanguageBuilder_.mergeFrom(value); } else { - conditionThresholdBuilder_.setMessage(value); + conditionPrometheusQueryLanguageBuilder_.setMessage(value); } } - conditionCase_ = 1; + conditionCase_ = 21; return this; } /** * * *
-       * A condition that compares a time series against a threshold.
+       * A condition that uses the Prometheus query language to define alerts.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; * */ - public Builder clearConditionThreshold() { - if (conditionThresholdBuilder_ == null) { - if (conditionCase_ == 1) { + public Builder clearConditionPrometheusQueryLanguage() { + if (conditionPrometheusQueryLanguageBuilder_ == null) { + if (conditionCase_ == 21) { conditionCase_ = 0; condition_ = null; onChanged(); } } else { - if (conditionCase_ == 1) { + if (conditionCase_ == 21) { conditionCase_ = 0; condition_ = null; } - conditionThresholdBuilder_.clear(); + conditionPrometheusQueryLanguageBuilder_.clear(); } return this; } @@ -13296,1130 +18721,1413 @@ public Builder clearConditionThreshold() { * * *
-       * A condition that compares a time series against a threshold.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; - * - */ - public com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder - getConditionThresholdBuilder() { - return getConditionThresholdFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * A condition that compares a time series against a threshold.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; - * - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder - getConditionThresholdOrBuilder() { - if ((conditionCase_ == 1) && (conditionThresholdBuilder_ != null)) { - return conditionThresholdBuilder_.getMessageOrBuilder(); - } else { - if (conditionCase_ == 1) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - .getDefaultInstance(); - } - } - /** - * - * - *
-       * A condition that compares a time series against a threshold.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold, - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder> - getConditionThresholdFieldBuilder() { - if (conditionThresholdBuilder_ == null) { - if (!(conditionCase_ == 1)) { - condition_ = - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.getDefaultInstance(); - } - conditionThresholdBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold, - com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdOrBuilder>( - (com.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) condition_, - getParentForChildren(), - isClean()); - condition_ = null; - } - conditionCase_ = 1; - onChanged(); - return conditionThresholdBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence, - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder> - conditionAbsentBuilder_; - /** - * - * - *
-       * A condition that checks that a time series continues to
-       * receive new data points.
+       * A condition that uses the Prometheus query language to define alerts.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; * - * - * @return Whether the conditionAbsent field is set. */ - @java.lang.Override - public boolean hasConditionAbsent() { - return conditionCase_ == 2; + public com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder + getConditionPrometheusQueryLanguageBuilder() { + return getConditionPrometheusQueryLanguageFieldBuilder().getBuilder(); } /** * * *
-       * A condition that checks that a time series continues to
-       * receive new data points.
+       * A condition that uses the Prometheus query language to define alerts.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; * - * - * @return The conditionAbsent. */ @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence getConditionAbsent() { - if (conditionAbsentBuilder_ == null) { - if (conditionCase_ == 2) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); + public com.google.monitoring.v3.AlertPolicy.Condition + .PrometheusQueryLanguageConditionOrBuilder + getConditionPrometheusQueryLanguageOrBuilder() { + if ((conditionCase_ == 21) && (conditionPrometheusQueryLanguageBuilder_ != null)) { + return conditionPrometheusQueryLanguageBuilder_.getMessageOrBuilder(); } else { - if (conditionCase_ == 2) { - return conditionAbsentBuilder_.getMessage(); - } - return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); - } - } - /** - * - * - *
-       * A condition that checks that a time series continues to
-       * receive new data points.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; - * - */ - public Builder setConditionAbsent( - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence value) { - if (conditionAbsentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + if (conditionCase_ == 21) { + return (com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) + condition_; } - condition_ = value; - onChanged(); - } else { - conditionAbsentBuilder_.setMessage(value); + return com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + .getDefaultInstance(); } - conditionCase_ = 2; - return this; } /** * * *
-       * A condition that checks that a time series continues to
-       * receive new data points.
+       * A condition that uses the Prometheus query language to define alerts.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * + * .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; * */ - public Builder setConditionAbsent( - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder builderForValue) { - if (conditionAbsentBuilder_ == null) { - condition_ = builderForValue.build(); - onChanged(); - } else { - conditionAbsentBuilder_.setMessage(builderForValue.build()); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition, + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + .Builder, + com.google.monitoring.v3.AlertPolicy.Condition + .PrometheusQueryLanguageConditionOrBuilder> + getConditionPrometheusQueryLanguageFieldBuilder() { + if (conditionPrometheusQueryLanguageBuilder_ == null) { + if (!(conditionCase_ == 21)) { + condition_ = + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + .getDefaultInstance(); + } + conditionPrometheusQueryLanguageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition, + com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + .Builder, + com.google.monitoring.v3.AlertPolicy.Condition + .PrometheusQueryLanguageConditionOrBuilder>( + (com.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition) + condition_, + getParentForChildren(), + isClean()); + condition_ = null; } - conditionCase_ = 2; - return this; + conditionCase_ = 21; + onChanged(); + return conditionPrometheusQueryLanguageBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); } + + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition) + private static final com.google.monitoring.v3.AlertPolicy.Condition DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.AlertPolicy.Condition(); + } + + public static com.google.monitoring.v3.AlertPolicy.Condition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Condition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AlertStrategyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.AlertStrategy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required for alert policies with a `LogMatch` condition.
+     *
+     * This limit is not implemented for alert policies that are not log-based.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + * + * @return Whether the notificationRateLimit field is set. + */ + boolean hasNotificationRateLimit(); + /** + * + * + *
+     * Required for alert policies with a `LogMatch` condition.
+     *
+     * This limit is not implemented for alert policies that are not log-based.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + * + * @return The notificationRateLimit. + */ + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + getNotificationRateLimit(); + /** + * + * + *
+     * Required for alert policies with a `LogMatch` condition.
+     *
+     * This limit is not implemented for alert policies that are not log-based.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + */ + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitOrBuilder + getNotificationRateLimitOrBuilder(); + + /** + * + * + *
+     * If an alert policy that was active has no data for this long, any open
+     * incidents will close
+     * 
+ * + * .google.protobuf.Duration auto_close = 3; + * + * @return Whether the autoClose field is set. + */ + boolean hasAutoClose(); + /** + * + * + *
+     * If an alert policy that was active has no data for this long, any open
+     * incidents will close
+     * 
+ * + * .google.protobuf.Duration auto_close = 3; + * + * @return The autoClose. + */ + com.google.protobuf.Duration getAutoClose(); + /** + * + * + *
+     * If an alert policy that was active has no data for this long, any open
+     * incidents will close
+     * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + com.google.protobuf.DurationOrBuilder getAutoCloseOrBuilder(); + + /** + * + * + *
+     * Control how notifications will be sent out, on a per-channel basis.
+     * 
+ * + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * + */ + java.util.List + getNotificationChannelStrategyList(); + /** + * + * + *
+     * Control how notifications will be sent out, on a per-channel basis.
+     * 
+ * + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * + */ + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + getNotificationChannelStrategy(int index); + /** + * + * + *
+     * Control how notifications will be sent out, on a per-channel basis.
+     * 
+ * + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * + */ + int getNotificationChannelStrategyCount(); + /** + * + * + *
+     * Control how notifications will be sent out, on a per-channel basis.
+     * 
+ * + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * + */ + java.util.List< + ? extends + com.google.monitoring.v3.AlertPolicy.AlertStrategy + .NotificationChannelStrategyOrBuilder> + getNotificationChannelStrategyOrBuilderList(); + /** + * + * + *
+     * Control how notifications will be sent out, on a per-channel basis.
+     * 
+ * + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * + */ + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategyOrBuilder + getNotificationChannelStrategyOrBuilder(int index); + } + /** + * + * + *
+   * Control over how the notification channels in `notification_channels`
+   * are notified when this alert fires.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.AlertPolicy.AlertStrategy} + */ + public static final class AlertStrategy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.AlertStrategy) + AlertStrategyOrBuilder { + private static final long serialVersionUID = 0L; + // Use AlertStrategy.newBuilder() to construct. + private AlertStrategy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AlertStrategy() { + notificationChannelStrategy_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AlertStrategy(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.class, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.Builder.class); + } + + public interface NotificationRateLimitOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) + com.google.protobuf.MessageOrBuilder { + /** * * *
-       * A condition that checks that a time series continues to
-       * receive new data points.
+       * Not more than one notification per `period`.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; - * - */ - public Builder mergeConditionAbsent( - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence value) { - if (conditionAbsentBuilder_ == null) { - if (conditionCase_ == 2 - && condition_ - != com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - .getDefaultInstance()) { - condition_ = - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.newBuilder( - (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_) - .mergeFrom(value) - .buildPartial(); - } else { - condition_ = value; - } - onChanged(); - } else { - if (conditionCase_ == 2) { - conditionAbsentBuilder_.mergeFrom(value); - } else { - conditionAbsentBuilder_.setMessage(value); - } - } - conditionCase_ = 2; - return this; - } - /** - * - * - *
-       * A condition that checks that a time series continues to
-       * receive new data points.
-       * 
+ * .google.protobuf.Duration period = 1; * - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; - * + * @return Whether the period field is set. */ - public Builder clearConditionAbsent() { - if (conditionAbsentBuilder_ == null) { - if (conditionCase_ == 2) { - conditionCase_ = 0; - condition_ = null; - onChanged(); - } - } else { - if (conditionCase_ == 2) { - conditionCase_ = 0; - condition_ = null; - } - conditionAbsentBuilder_.clear(); - } - return this; - } + boolean hasPeriod(); /** * * *
-       * A condition that checks that a time series continues to
-       * receive new data points.
+       * Not more than one notification per `period`.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; - * - */ - public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder - getConditionAbsentBuilder() { - return getConditionAbsentFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * A condition that checks that a time series continues to
-       * receive new data points.
-       * 
+ * .google.protobuf.Duration period = 1; * - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; - * + * @return The period. */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder - getConditionAbsentOrBuilder() { - if ((conditionCase_ == 2) && (conditionAbsentBuilder_ != null)) { - return conditionAbsentBuilder_.getMessageOrBuilder(); - } else { - if (conditionCase_ == 2) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); - } - } + com.google.protobuf.Duration getPeriod(); /** * * *
-       * A condition that checks that a time series continues to
-       * receive new data points.
+       * Not more than one notification per `period`.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; - * + * .google.protobuf.Duration period = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence, - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder> - getConditionAbsentFieldBuilder() { - if (conditionAbsentBuilder_ == null) { - if (!(conditionCase_ == 2)) { - condition_ = - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); - } - conditionAbsentBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence, - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder>( - (com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) condition_, - getParentForChildren(), - isClean()); - condition_ = null; - } - conditionCase_ = 2; - onChanged(); - return conditionAbsentBuilder_; + com.google.protobuf.DurationOrBuilder getPeriodOrBuilder(); + } + /** + * + * + *
+     * Control over the rate of notifications sent to this alert policy's
+     * notification channels.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit} + */ + public static final class NotificationRateLimit extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) + NotificationRateLimitOrBuilder { + private static final long serialVersionUID = 0L; + // Use NotificationRateLimit.newBuilder() to construct. + private NotificationRateLimit(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); } - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch, - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder> - conditionMatchedLogBuilder_; - /** - * - * - *
-       * A condition that checks for log messages matching given constraints. If
-       * set, no other conditions can be present.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * - * - * @return Whether the conditionMatchedLog field is set. - */ + private NotificationRateLimit() {} + @java.lang.Override - public boolean hasConditionMatchedLog() { - return conditionCase_ == 20; + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NotificationRateLimit(); } - /** - * - * - *
-       * A condition that checks for log messages matching given constraints. If
-       * set, no other conditions can be present.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * - * - * @return The conditionMatchedLog. - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch getConditionMatchedLog() { - if (conditionMatchedLogBuilder_ == null) { - if (conditionCase_ == 20) { - return (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); - } else { - if (conditionCase_ == 20) { - return conditionMatchedLogBuilder_.getMessage(); - } - return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); - } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_descriptor; } - /** - * - * - *
-       * A condition that checks for log messages matching given constraints. If
-       * set, no other conditions can be present.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * - */ - public Builder setConditionMatchedLog( - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch value) { - if (conditionMatchedLogBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - condition_ = value; - onChanged(); - } else { - conditionMatchedLogBuilder_.setMessage(value); - } - conditionCase_ = 20; - return this; + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.class, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder + .class); } + + public static final int PERIOD_FIELD_NUMBER = 1; + private com.google.protobuf.Duration period_; /** * * *
-       * A condition that checks for log messages matching given constraints. If
-       * set, no other conditions can be present.
+       * Not more than one notification per `period`.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * + * .google.protobuf.Duration period = 1; + * + * @return Whether the period field is set. */ - public Builder setConditionMatchedLog( - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder builderForValue) { - if (conditionMatchedLogBuilder_ == null) { - condition_ = builderForValue.build(); - onChanged(); - } else { - conditionMatchedLogBuilder_.setMessage(builderForValue.build()); - } - conditionCase_ = 20; - return this; + @java.lang.Override + public boolean hasPeriod() { + return period_ != null; } /** * * *
-       * A condition that checks for log messages matching given constraints. If
-       * set, no other conditions can be present.
+       * Not more than one notification per `period`.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * + * .google.protobuf.Duration period = 1; + * + * @return The period. */ - public Builder mergeConditionMatchedLog( - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch value) { - if (conditionMatchedLogBuilder_ == null) { - if (conditionCase_ == 20 - && condition_ - != com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance()) { - condition_ = - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.newBuilder( - (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_) - .mergeFrom(value) - .buildPartial(); - } else { - condition_ = value; - } - onChanged(); - } else { - if (conditionCase_ == 20) { - conditionMatchedLogBuilder_.mergeFrom(value); - } else { - conditionMatchedLogBuilder_.setMessage(value); - } - } - conditionCase_ = 20; - return this; + @java.lang.Override + public com.google.protobuf.Duration getPeriod() { + return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; } /** * * *
-       * A condition that checks for log messages matching given constraints. If
-       * set, no other conditions can be present.
+       * Not more than one notification per `period`.
        * 
* - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * + * .google.protobuf.Duration period = 1; */ - public Builder clearConditionMatchedLog() { - if (conditionMatchedLogBuilder_ == null) { - if (conditionCase_ == 20) { - conditionCase_ = 0; - condition_ = null; - onChanged(); - } - } else { - if (conditionCase_ == 20) { - conditionCase_ = 0; - condition_ = null; - } - conditionMatchedLogBuilder_.clear(); + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getPeriodOrBuilder() { + return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (period_ != null) { + output.writeMessage(1, getPeriod()); } - return this; + getUnknownFields().writeTo(output); } - /** - * - * - *
-       * A condition that checks for log messages matching given constraints. If
-       * set, no other conditions can be present.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * - */ - public com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder - getConditionMatchedLogBuilder() { - return getConditionMatchedLogFieldBuilder().getBuilder(); + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (period_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPeriod()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; } - /** - * - * - *
-       * A condition that checks for log messages matching given constraints. If
-       * set, no other conditions can be present.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * - */ + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit)) { + return super.equals(obj); + } + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit other = + (com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) obj; + + if (hasPeriod() != other.hasPeriod()) return false; + if (hasPeriod()) { + if (!getPeriod().equals(other.getPeriod())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPeriod()) { + hash = (37 * hash) + PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getPeriod().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder - getConditionMatchedLogOrBuilder() { - if ((conditionCase_ == 20) && (conditionMatchedLogBuilder_ != null)) { - return conditionMatchedLogBuilder_.getMessageOrBuilder(); - } else { - if (conditionCase_ == 20) { - return (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); - } + public Builder newBuilderForType() { + return newBuilder(); } - /** - * - * - *
-       * A condition that checks for log messages matching given constraints. If
-       * set, no other conditions can be present.
-       * 
- * - * .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch, - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder> - getConditionMatchedLogFieldBuilder() { - if (conditionMatchedLogBuilder_ == null) { - if (!(conditionCase_ == 20)) { - condition_ = - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.getDefaultInstance(); - } - conditionMatchedLogBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch, - com.google.monitoring.v3.AlertPolicy.Condition.LogMatch.Builder, - com.google.monitoring.v3.AlertPolicy.Condition.LogMatchOrBuilder>( - (com.google.monitoring.v3.AlertPolicy.Condition.LogMatch) condition_, - getParentForChildren(), - isClean()); - condition_ = null; - } - conditionCase_ = 20; - onChanged(); - return conditionMatchedLogBuilder_; + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition, - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - .Builder, - com.google.monitoring.v3.AlertPolicy.Condition - .MonitoringQueryLanguageConditionOrBuilder> - conditionMonitoringQueryLanguageBuilder_; - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - * - * @return Whether the conditionMonitoringQueryLanguage field is set. - */ @java.lang.Override - public boolean hasConditionMonitoringQueryLanguage() { - return conditionCase_ == 19; + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; } /** * * *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
+       * Control over the rate of notifications sent to this alert policy's
+       * notification channels.
        * 
* - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - * - * @return The conditionMonitoringQueryLanguage. + * Protobuf type {@code google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit} */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - getConditionMonitoringQueryLanguage() { - if (conditionMonitoringQueryLanguageBuilder_ == null) { - if (conditionCase_ == 19) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) - condition_; + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.class, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder + .class); + } + + // Construct using + // com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + period_ = null; + if (periodBuilder_ != null) { + periodBuilder_.dispose(); + periodBuilder_ = null; } - return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + getDefaultInstanceForType() { + return com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit .getDefaultInstance(); - } else { - if (conditionCase_ == 19) { - return conditionMonitoringQueryLanguageBuilder_.getMessage(); + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit build() { + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } - return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - .getDefaultInstance(); + return result; } - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - */ - public Builder setConditionMonitoringQueryLanguage( - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition value) { - if (conditionMonitoringQueryLanguageBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + buildPartial() { + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit result = + new com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.period_ = periodBuilder_ == null ? period_ : periodBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) { + return mergeFrom( + (com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit other) { + if (other + == com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + .getDefaultInstance()) return this; + if (other.hasPeriod()) { + mergePeriod(other.getPeriod()); } - condition_ = value; + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); - } else { - conditionMonitoringQueryLanguageBuilder_.setMessage(value); + return this; } - conditionCase_ = 19; - return this; - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - */ - public Builder setConditionMonitoringQueryLanguage( - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition.Builder - builderForValue) { - if (conditionMonitoringQueryLanguageBuilder_ == null) { - condition_ = builderForValue.build(); - onChanged(); - } else { - conditionMonitoringQueryLanguageBuilder_.setMessage(builderForValue.build()); + + @java.lang.Override + public final boolean isInitialized() { + return true; } - conditionCase_ = 19; - return this; - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - */ - public Builder mergeConditionMonitoringQueryLanguage( - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition value) { - if (conditionMonitoringQueryLanguageBuilder_ == null) { - if (conditionCase_ == 19 - && condition_ - != com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - .getDefaultInstance()) { - condition_ = - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - .newBuilder( - (com.google.monitoring.v3.AlertPolicy.Condition - .MonitoringQueryLanguageCondition) - condition_) - .mergeFrom(value) - .buildPartial(); - } else { - condition_ = value; + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - onChanged(); - } else { - if (conditionCase_ == 19) { - conditionMonitoringQueryLanguageBuilder_.mergeFrom(value); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getPeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration period_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + periodBuilder_; + /** + * + * + *
+         * Not more than one notification per `period`.
+         * 
+ * + * .google.protobuf.Duration period = 1; + * + * @return Whether the period field is set. + */ + public boolean hasPeriod() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+         * Not more than one notification per `period`.
+         * 
+ * + * .google.protobuf.Duration period = 1; + * + * @return The period. + */ + public com.google.protobuf.Duration getPeriod() { + if (periodBuilder_ == null) { + return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; } else { - conditionMonitoringQueryLanguageBuilder_.setMessage(value); + return periodBuilder_.getMessage(); } } - conditionCase_ = 19; - return this; - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - */ - public Builder clearConditionMonitoringQueryLanguage() { - if (conditionMonitoringQueryLanguageBuilder_ == null) { - if (conditionCase_ == 19) { - conditionCase_ = 0; - condition_ = null; - onChanged(); + /** + * + * + *
+         * Not more than one notification per `period`.
+         * 
+ * + * .google.protobuf.Duration period = 1; + */ + public Builder setPeriod(com.google.protobuf.Duration value) { + if (periodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + period_ = value; + } else { + periodBuilder_.setMessage(value); } - } else { - if (conditionCase_ == 19) { - conditionCase_ = 0; - condition_ = null; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Not more than one notification per `period`.
+         * 
+ * + * .google.protobuf.Duration period = 1; + */ + public Builder setPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (periodBuilder_ == null) { + period_ = builderForValue.build(); + } else { + periodBuilder_.setMessage(builderForValue.build()); } - conditionMonitoringQueryLanguageBuilder_.clear(); + bitField0_ |= 0x00000001; + onChanged(); + return this; } - return this; - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - */ - public com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition.Builder - getConditionMonitoringQueryLanguageBuilder() { - return getConditionMonitoringQueryLanguageFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - */ - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition - .MonitoringQueryLanguageConditionOrBuilder - getConditionMonitoringQueryLanguageOrBuilder() { - if ((conditionCase_ == 19) && (conditionMonitoringQueryLanguageBuilder_ != null)) { - return conditionMonitoringQueryLanguageBuilder_.getMessageOrBuilder(); - } else { - if (conditionCase_ == 19) { - return (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) - condition_; + /** + * + * + *
+         * Not more than one notification per `period`.
+         * 
+ * + * .google.protobuf.Duration period = 1; + */ + public Builder mergePeriod(com.google.protobuf.Duration value) { + if (periodBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && period_ != null + && period_ != com.google.protobuf.Duration.getDefaultInstance()) { + getPeriodBuilder().mergeFrom(value); + } else { + period_ = value; + } + } else { + periodBuilder_.mergeFrom(value); } - return com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - .getDefaultInstance(); + bitField0_ |= 0x00000001; + onChanged(); + return this; } - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition, - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - .Builder, - com.google.monitoring.v3.AlertPolicy.Condition - .MonitoringQueryLanguageConditionOrBuilder> - getConditionMonitoringQueryLanguageFieldBuilder() { - if (conditionMonitoringQueryLanguageBuilder_ == null) { - if (!(conditionCase_ == 19)) { - condition_ = - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - .getDefaultInstance(); + /** + * + * + *
+         * Not more than one notification per `period`.
+         * 
+ * + * .google.protobuf.Duration period = 1; + */ + public Builder clearPeriod() { + bitField0_ = (bitField0_ & ~0x00000001); + period_ = null; + if (periodBuilder_ != null) { + periodBuilder_.dispose(); + periodBuilder_ = null; } - conditionMonitoringQueryLanguageBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition, - com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition - .Builder, - com.google.monitoring.v3.AlertPolicy.Condition - .MonitoringQueryLanguageConditionOrBuilder>( - (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) - condition_, - getParentForChildren(), - isClean()); - condition_ = null; + onChanged(); + return this; } - conditionCase_ = 19; - onChanged(); - return conditionMonitoringQueryLanguageBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition) - } - - // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition) - private static final com.google.monitoring.v3.AlertPolicy.Condition DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.monitoring.v3.AlertPolicy.Condition(); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Condition parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); + /** + * + * + *
+         * Not more than one notification per `period`.
+         * 
+ * + * .google.protobuf.Duration period = 1; + */ + public com.google.protobuf.Duration.Builder getPeriodBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Not more than one notification per `period`.
+         * 
+ * + * .google.protobuf.Duration period = 1; + */ + public com.google.protobuf.DurationOrBuilder getPeriodOrBuilder() { + if (periodBuilder_ != null) { + return periodBuilder_.getMessageOrBuilder(); + } else { + return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } + } + /** + * + * + *
+         * Not more than one notification per `period`.
+         * 
+ * + * .google.protobuf.Duration period = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getPeriodFieldBuilder() { + if (periodBuilder_ == null) { + periodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getPeriod(), getParentForChildren(), isClean()); + period_ = null; + } + return periodBuilder_; + } - public interface AlertStrategyOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.AlertStrategy) - com.google.protobuf.MessageOrBuilder { + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } - /** - * - * - *
-     * Required for alert policies with a `LogMatch` condition.
-     *
-     * This limit is not implemented for alert policies that are not log-based.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; - * - * - * @return Whether the notificationRateLimit field is set. - */ - boolean hasNotificationRateLimit(); - /** - * - * - *
-     * Required for alert policies with a `LogMatch` condition.
-     *
-     * This limit is not implemented for alert policies that are not log-based.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; - * - * - * @return The notificationRateLimit. - */ - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit - getNotificationRateLimit(); - /** - * - * - *
-     * Required for alert policies with a `LogMatch` condition.
-     *
-     * This limit is not implemented for alert policies that are not log-based.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; - * - */ - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitOrBuilder - getNotificationRateLimitOrBuilder(); + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } - /** - * - * - *
-     * If an alert policy that was active has no data for this long, any open
-     * incidents will close
-     * 
- * - * .google.protobuf.Duration auto_close = 3; - * - * @return Whether the autoClose field is set. - */ - boolean hasAutoClose(); - /** - * - * - *
-     * If an alert policy that was active has no data for this long, any open
-     * incidents will close
-     * 
- * - * .google.protobuf.Duration auto_close = 3; - * - * @return The autoClose. - */ - com.google.protobuf.Duration getAutoClose(); - /** - * - * - *
-     * If an alert policy that was active has no data for this long, any open
-     * incidents will close
-     * 
- * - * .google.protobuf.Duration auto_close = 3; - */ - com.google.protobuf.DurationOrBuilder getAutoCloseOrBuilder(); - } - /** - * - * - *
-   * Control over how the notification channels in `notification_channels`
-   * are notified when this alert fires.
-   * 
- * - * Protobuf type {@code google.monitoring.v3.AlertPolicy.AlertStrategy} - */ - public static final class AlertStrategy extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.AlertStrategy) - AlertStrategyOrBuilder { - private static final long serialVersionUID = 0L; - // Use AlertStrategy.newBuilder() to construct. - private AlertStrategy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) + } - private AlertStrategy() {} + // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) + private static final com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + DEFAULT_INSTANCE; - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AlertStrategy(); - } + static { + DEFAULT_INSTANCE = + new com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit(); + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor; - } + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + getDefaultInstance() { + return DEFAULT_INSTANCE; + } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.AlertStrategy.class, - com.google.monitoring.v3.AlertPolicy.AlertStrategy.Builder.class); + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NotificationRateLimit parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } } - public interface NotificationRateLimitOrBuilder + public interface NotificationChannelStrategyOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy) com.google.protobuf.MessageOrBuilder { /** * * *
-       * Not more than one notification per `period`.
+       * The full REST resource name for the notification channels that these
+       * settings apply to. Each of these correspond to the name field in one
+       * of the NotificationChannel objects referenced in the
+       * notification_channels field of this AlertPolicy.
+       * The format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
        * 
* - * .google.protobuf.Duration period = 1; + * repeated string notification_channel_names = 1; * - * @return Whether the period field is set. + * @return A list containing the notificationChannelNames. */ - boolean hasPeriod(); + java.util.List getNotificationChannelNamesList(); /** * * *
-       * Not more than one notification per `period`.
+       * The full REST resource name for the notification channels that these
+       * settings apply to. Each of these correspond to the name field in one
+       * of the NotificationChannel objects referenced in the
+       * notification_channels field of this AlertPolicy.
+       * The format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
        * 
* - * .google.protobuf.Duration period = 1; + * repeated string notification_channel_names = 1; * - * @return The period. + * @return The count of notificationChannelNames. */ - com.google.protobuf.Duration getPeriod(); + int getNotificationChannelNamesCount(); /** * * *
-       * Not more than one notification per `period`.
+       * The full REST resource name for the notification channels that these
+       * settings apply to. Each of these correspond to the name field in one
+       * of the NotificationChannel objects referenced in the
+       * notification_channels field of this AlertPolicy.
+       * The format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
        * 
* - * .google.protobuf.Duration period = 1; + * repeated string notification_channel_names = 1; + * + * @param index The index of the element to return. + * @return The notificationChannelNames at the given index. */ - com.google.protobuf.DurationOrBuilder getPeriodOrBuilder(); + java.lang.String getNotificationChannelNames(int index); + /** + * + * + *
+       * The full REST resource name for the notification channels that these
+       * settings apply to. Each of these correspond to the name field in one
+       * of the NotificationChannel objects referenced in the
+       * notification_channels field of this AlertPolicy.
+       * The format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+       * 
+ * + * repeated string notification_channel_names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the notificationChannelNames at the given index. + */ + com.google.protobuf.ByteString getNotificationChannelNamesBytes(int index); + + /** + * + * + *
+       * The frequency at which to send reminder notifications for open
+       * incidents.
+       * 
+ * + * .google.protobuf.Duration renotify_interval = 2; + * + * @return Whether the renotifyInterval field is set. + */ + boolean hasRenotifyInterval(); + /** + * + * + *
+       * The frequency at which to send reminder notifications for open
+       * incidents.
+       * 
+ * + * .google.protobuf.Duration renotify_interval = 2; + * + * @return The renotifyInterval. + */ + com.google.protobuf.Duration getRenotifyInterval(); + /** + * + * + *
+       * The frequency at which to send reminder notifications for open
+       * incidents.
+       * 
+ * + * .google.protobuf.Duration renotify_interval = 2; + */ + com.google.protobuf.DurationOrBuilder getRenotifyIntervalOrBuilder(); } /** * * *
-     * Control over the rate of notifications sent to this alert policy's
-     * notification channels.
+     * Control over how the notification channels in `notification_channels`
+     * are notified when this alert fires, on a per-channel basis.
      * 
* - * Protobuf type {@code google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit} + * Protobuf type {@code + * google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy} */ - public static final class NotificationRateLimit extends com.google.protobuf.GeneratedMessageV3 + public static final class NotificationChannelStrategy + extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) - NotificationRateLimitOrBuilder { + // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy) + NotificationChannelStrategyOrBuilder { private static final long serialVersionUID = 0L; - // Use NotificationRateLimit.newBuilder() to construct. - private NotificationRateLimit(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use NotificationChannelStrategy.newBuilder() to construct. + private NotificationChannelStrategy( + com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private NotificationRateLimit() {} + private NotificationChannelStrategy() { + notificationChannelNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new NotificationRateLimit(); + return new NotificationChannelStrategy(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_descriptor; + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationChannelStrategy_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_fieldAccessorTable + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationChannelStrategy_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.class, - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder - .class); + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + .class, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + .Builder.class); } - public static final int PERIOD_FIELD_NUMBER = 1; - private com.google.protobuf.Duration period_; + public static final int NOTIFICATION_CHANNEL_NAMES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList notificationChannelNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); /** * * *
-       * Not more than one notification per `period`.
+       * The full REST resource name for the notification channels that these
+       * settings apply to. Each of these correspond to the name field in one
+       * of the NotificationChannel objects referenced in the
+       * notification_channels field of this AlertPolicy.
+       * The format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
        * 
* - * .google.protobuf.Duration period = 1; + * repeated string notification_channel_names = 1; * - * @return Whether the period field is set. + * @return A list containing the notificationChannelNames. + */ + public com.google.protobuf.ProtocolStringList getNotificationChannelNamesList() { + return notificationChannelNames_; + } + /** + * + * + *
+       * The full REST resource name for the notification channels that these
+       * settings apply to. Each of these correspond to the name field in one
+       * of the NotificationChannel objects referenced in the
+       * notification_channels field of this AlertPolicy.
+       * The format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+       * 
+ * + * repeated string notification_channel_names = 1; + * + * @return The count of notificationChannelNames. + */ + public int getNotificationChannelNamesCount() { + return notificationChannelNames_.size(); + } + /** + * + * + *
+       * The full REST resource name for the notification channels that these
+       * settings apply to. Each of these correspond to the name field in one
+       * of the NotificationChannel objects referenced in the
+       * notification_channels field of this AlertPolicy.
+       * The format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+       * 
+ * + * repeated string notification_channel_names = 1; + * + * @param index The index of the element to return. + * @return The notificationChannelNames at the given index. + */ + public java.lang.String getNotificationChannelNames(int index) { + return notificationChannelNames_.get(index); + } + /** + * + * + *
+       * The full REST resource name for the notification channels that these
+       * settings apply to. Each of these correspond to the name field in one
+       * of the NotificationChannel objects referenced in the
+       * notification_channels field of this AlertPolicy.
+       * The format is:
+       *
+       *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+       * 
+ * + * repeated string notification_channel_names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the notificationChannelNames at the given index. + */ + public com.google.protobuf.ByteString getNotificationChannelNamesBytes(int index) { + return notificationChannelNames_.getByteString(index); + } + + public static final int RENOTIFY_INTERVAL_FIELD_NUMBER = 2; + private com.google.protobuf.Duration renotifyInterval_; + /** + * + * + *
+       * The frequency at which to send reminder notifications for open
+       * incidents.
+       * 
+ * + * .google.protobuf.Duration renotify_interval = 2; + * + * @return Whether the renotifyInterval field is set. */ @java.lang.Override - public boolean hasPeriod() { - return period_ != null; + public boolean hasRenotifyInterval() { + return renotifyInterval_ != null; } /** * * *
-       * Not more than one notification per `period`.
+       * The frequency at which to send reminder notifications for open
+       * incidents.
        * 
* - * .google.protobuf.Duration period = 1; + * .google.protobuf.Duration renotify_interval = 2; * - * @return The period. + * @return The renotifyInterval. */ @java.lang.Override - public com.google.protobuf.Duration getPeriod() { - return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; + public com.google.protobuf.Duration getRenotifyInterval() { + return renotifyInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : renotifyInterval_; } /** * * *
-       * Not more than one notification per `period`.
+       * The frequency at which to send reminder notifications for open
+       * incidents.
        * 
* - * .google.protobuf.Duration period = 1; + * .google.protobuf.Duration renotify_interval = 2; */ @java.lang.Override - public com.google.protobuf.DurationOrBuilder getPeriodOrBuilder() { - return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; + public com.google.protobuf.DurationOrBuilder getRenotifyIntervalOrBuilder() { + return renotifyInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : renotifyInterval_; } private byte memoizedIsInitialized = -1; @@ -14436,8 +20144,12 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (period_ != null) { - output.writeMessage(1, getPeriod()); + for (int i = 0; i < notificationChannelNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 1, notificationChannelNames_.getRaw(i)); + } + if (renotifyInterval_ != null) { + output.writeMessage(2, getRenotifyInterval()); } getUnknownFields().writeTo(output); } @@ -14448,8 +20160,17 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (period_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPeriod()); + { + int dataSize = 0; + for (int i = 0; i < notificationChannelNames_.size(); i++) { + dataSize += computeStringSizeNoTag(notificationChannelNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getNotificationChannelNamesList().size(); + } + if (renotifyInterval_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRenotifyInterval()); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -14462,15 +20183,18 @@ public boolean equals(final java.lang.Object obj) { return true; } if (!(obj - instanceof com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit)) { + instanceof + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy)) { return super.equals(obj); } - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit other = - (com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) obj; + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy other = + (com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy) obj; - if (hasPeriod() != other.hasPeriod()) return false; - if (hasPeriod()) { - if (!getPeriod().equals(other.getPeriod())) return false; + if (!getNotificationChannelNamesList().equals(other.getNotificationChannelNamesList())) + return false; + if (hasRenotifyInterval() != other.hasRenotifyInterval()) return false; + if (hasRenotifyInterval()) { + if (!getRenotifyInterval().equals(other.getRenotifyInterval())) return false; } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; @@ -14483,35 +20207,39 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPeriod()) { - hash = (37 * hash) + PERIOD_FIELD_NUMBER; - hash = (53 * hash) + getPeriod().hashCode(); + if (getNotificationChannelNamesCount() > 0) { + hash = (37 * hash) + NOTIFICATION_CHANNEL_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getNotificationChannelNamesList().hashCode(); + } + if (hasRenotifyInterval()) { + hash = (37 * hash) + RENOTIFY_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getRenotifyInterval().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -14519,23 +20247,23 @@ public int hashCode() { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -14544,12 +20272,12 @@ public int hashCode() { PARSER, input, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -14558,12 +20286,12 @@ public int hashCode() { PARSER, input, extensionRegistry); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -14582,7 +20310,8 @@ public static Builder newBuilder() { } public static Builder newBuilder( - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit prototype) { + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -14601,35 +20330,37 @@ protected Builder newBuilderForType( * * *
-       * Control over the rate of notifications sent to this alert policy's
-       * notification channels.
+       * Control over how the notification channels in `notification_channels`
+       * are notified when this alert fires, on a per-channel basis.
        * 
* - * Protobuf type {@code google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit} + * Protobuf type {@code + * google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitOrBuilder { + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy) + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategyOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_descriptor; + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationChannelStrategy_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_fieldAccessorTable + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationChannelStrategy_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.class, - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder - .class); + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + .class, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + .Builder.class); } // Construct using - // com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.newBuilder() + // com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -14640,10 +20371,11 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { public Builder clear() { super.clear(); bitField0_ = 0; - period_ = null; - if (periodBuilder_ != null) { - periodBuilder_.dispose(); - periodBuilder_ = null; + notificationChannelNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + renotifyInterval_ = null; + if (renotifyIntervalBuilder_ != null) { + renotifyIntervalBuilder_.dispose(); + renotifyIntervalBuilder_ = null; } return this; } @@ -14651,19 +20383,20 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_descriptor; + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationChannelStrategy_descriptor; } @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy getDefaultInstanceForType() { - return com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + return com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy .getDefaultInstance(); } @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit build() { - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit result = + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + build() { + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); @@ -14672,10 +20405,11 @@ public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit } @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy buildPartial() { - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit result = - new com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit(this); + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy result = + new com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy( + this); if (bitField0_ != 0) { buildPartial0(result); } @@ -14684,10 +20418,17 @@ public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit } private void buildPartial0( - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit result) { + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { - result.period_ = periodBuilder_ == null ? period_ : periodBuilder_.build(); + notificationChannelNames_.makeImmutable(); + result.notificationChannelNames_ = notificationChannelNames_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.renotifyInterval_ = + renotifyIntervalBuilder_ == null + ? renotifyInterval_ + : renotifyIntervalBuilder_.build(); } } @@ -14729,9 +20470,11 @@ public Builder addRepeatedField( @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other - instanceof com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) { + instanceof + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy) { return mergeFrom( - (com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) other); + (com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy) + other); } else { super.mergeFrom(other); return this; @@ -14739,12 +20482,22 @@ public Builder mergeFrom(com.google.protobuf.Message other) { } public Builder mergeFrom( - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit other) { + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy other) { if (other - == com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + == com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy .getDefaultInstance()) return this; - if (other.hasPeriod()) { - mergePeriod(other.getPeriod()); + if (!other.notificationChannelNames_.isEmpty()) { + if (notificationChannelNames_.isEmpty()) { + notificationChannelNames_ = other.notificationChannelNames_; + bitField0_ |= 0x00000001; + } else { + ensureNotificationChannelNamesIsMutable(); + notificationChannelNames_.addAll(other.notificationChannelNames_); + } + onChanged(); + } + if (other.hasRenotifyInterval()) { + mergeRenotifyInterval(other.getRenotifyInterval()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); @@ -14774,10 +20527,18 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getPeriodFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000001; + java.lang.String s = input.readStringRequireUtf8(); + ensureNotificationChannelNamesIsMutable(); + notificationChannelNames_.add(s); break; } // case 10 + case 18: + { + input.readMessage( + getRenotifyIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -14797,63 +20558,297 @@ public Builder mergeFrom( private int bitField0_; - private com.google.protobuf.Duration period_; + private com.google.protobuf.LazyStringArrayList notificationChannelNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureNotificationChannelNamesIsMutable() { + if (!notificationChannelNames_.isModifiable()) { + notificationChannelNames_ = + new com.google.protobuf.LazyStringArrayList(notificationChannelNames_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+         * The full REST resource name for the notification channels that these
+         * settings apply to. Each of these correspond to the name field in one
+         * of the NotificationChannel objects referenced in the
+         * notification_channels field of this AlertPolicy.
+         * The format is:
+         *
+         *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+         * 
+ * + * repeated string notification_channel_names = 1; + * + * @return A list containing the notificationChannelNames. + */ + public com.google.protobuf.ProtocolStringList getNotificationChannelNamesList() { + notificationChannelNames_.makeImmutable(); + return notificationChannelNames_; + } + /** + * + * + *
+         * The full REST resource name for the notification channels that these
+         * settings apply to. Each of these correspond to the name field in one
+         * of the NotificationChannel objects referenced in the
+         * notification_channels field of this AlertPolicy.
+         * The format is:
+         *
+         *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+         * 
+ * + * repeated string notification_channel_names = 1; + * + * @return The count of notificationChannelNames. + */ + public int getNotificationChannelNamesCount() { + return notificationChannelNames_.size(); + } + /** + * + * + *
+         * The full REST resource name for the notification channels that these
+         * settings apply to. Each of these correspond to the name field in one
+         * of the NotificationChannel objects referenced in the
+         * notification_channels field of this AlertPolicy.
+         * The format is:
+         *
+         *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+         * 
+ * + * repeated string notification_channel_names = 1; + * + * @param index The index of the element to return. + * @return The notificationChannelNames at the given index. + */ + public java.lang.String getNotificationChannelNames(int index) { + return notificationChannelNames_.get(index); + } + /** + * + * + *
+         * The full REST resource name for the notification channels that these
+         * settings apply to. Each of these correspond to the name field in one
+         * of the NotificationChannel objects referenced in the
+         * notification_channels field of this AlertPolicy.
+         * The format is:
+         *
+         *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+         * 
+ * + * repeated string notification_channel_names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the notificationChannelNames at the given index. + */ + public com.google.protobuf.ByteString getNotificationChannelNamesBytes(int index) { + return notificationChannelNames_.getByteString(index); + } + /** + * + * + *
+         * The full REST resource name for the notification channels that these
+         * settings apply to. Each of these correspond to the name field in one
+         * of the NotificationChannel objects referenced in the
+         * notification_channels field of this AlertPolicy.
+         * The format is:
+         *
+         *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+         * 
+ * + * repeated string notification_channel_names = 1; + * + * @param index The index to set the value at. + * @param value The notificationChannelNames to set. + * @return This builder for chaining. + */ + public Builder setNotificationChannelNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationChannelNamesIsMutable(); + notificationChannelNames_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The full REST resource name for the notification channels that these
+         * settings apply to. Each of these correspond to the name field in one
+         * of the NotificationChannel objects referenced in the
+         * notification_channels field of this AlertPolicy.
+         * The format is:
+         *
+         *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+         * 
+ * + * repeated string notification_channel_names = 1; + * + * @param value The notificationChannelNames to add. + * @return This builder for chaining. + */ + public Builder addNotificationChannelNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationChannelNamesIsMutable(); + notificationChannelNames_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The full REST resource name for the notification channels that these
+         * settings apply to. Each of these correspond to the name field in one
+         * of the NotificationChannel objects referenced in the
+         * notification_channels field of this AlertPolicy.
+         * The format is:
+         *
+         *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+         * 
+ * + * repeated string notification_channel_names = 1; + * + * @param values The notificationChannelNames to add. + * @return This builder for chaining. + */ + public Builder addAllNotificationChannelNames(java.lang.Iterable values) { + ensureNotificationChannelNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, notificationChannelNames_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The full REST resource name for the notification channels that these
+         * settings apply to. Each of these correspond to the name field in one
+         * of the NotificationChannel objects referenced in the
+         * notification_channels field of this AlertPolicy.
+         * The format is:
+         *
+         *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+         * 
+ * + * repeated string notification_channel_names = 1; + * + * @return This builder for chaining. + */ + public Builder clearNotificationChannelNames() { + notificationChannelNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * The full REST resource name for the notification channels that these
+         * settings apply to. Each of these correspond to the name field in one
+         * of the NotificationChannel objects referenced in the
+         * notification_channels field of this AlertPolicy.
+         * The format is:
+         *
+         *     projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+         * 
+ * + * repeated string notification_channel_names = 1; + * + * @param value The bytes of the notificationChannelNames to add. + * @return This builder for chaining. + */ + public Builder addNotificationChannelNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNotificationChannelNamesIsMutable(); + notificationChannelNames_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Duration renotifyInterval_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - periodBuilder_; + renotifyIntervalBuilder_; /** * * *
-         * Not more than one notification per `period`.
+         * The frequency at which to send reminder notifications for open
+         * incidents.
          * 
* - * .google.protobuf.Duration period = 1; + * .google.protobuf.Duration renotify_interval = 2; * - * @return Whether the period field is set. + * @return Whether the renotifyInterval field is set. */ - public boolean hasPeriod() { - return ((bitField0_ & 0x00000001) != 0); + public boolean hasRenotifyInterval() { + return ((bitField0_ & 0x00000002) != 0); } /** * * *
-         * Not more than one notification per `period`.
+         * The frequency at which to send reminder notifications for open
+         * incidents.
          * 
* - * .google.protobuf.Duration period = 1; + * .google.protobuf.Duration renotify_interval = 2; * - * @return The period. + * @return The renotifyInterval. */ - public com.google.protobuf.Duration getPeriod() { - if (periodBuilder_ == null) { - return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; + public com.google.protobuf.Duration getRenotifyInterval() { + if (renotifyIntervalBuilder_ == null) { + return renotifyInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : renotifyInterval_; } else { - return periodBuilder_.getMessage(); + return renotifyIntervalBuilder_.getMessage(); } } /** * * *
-         * Not more than one notification per `period`.
+         * The frequency at which to send reminder notifications for open
+         * incidents.
          * 
* - * .google.protobuf.Duration period = 1; + * .google.protobuf.Duration renotify_interval = 2; */ - public Builder setPeriod(com.google.protobuf.Duration value) { - if (periodBuilder_ == null) { + public Builder setRenotifyInterval(com.google.protobuf.Duration value) { + if (renotifyIntervalBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - period_ = value; + renotifyInterval_ = value; } else { - periodBuilder_.setMessage(value); + renotifyIntervalBuilder_.setMessage(value); } - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -14861,18 +20856,19 @@ public Builder setPeriod(com.google.protobuf.Duration value) { * * *
-         * Not more than one notification per `period`.
+         * The frequency at which to send reminder notifications for open
+         * incidents.
          * 
* - * .google.protobuf.Duration period = 1; + * .google.protobuf.Duration renotify_interval = 2; */ - public Builder setPeriod(com.google.protobuf.Duration.Builder builderForValue) { - if (periodBuilder_ == null) { - period_ = builderForValue.build(); + public Builder setRenotifyInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (renotifyIntervalBuilder_ == null) { + renotifyInterval_ = builderForValue.build(); } else { - periodBuilder_.setMessage(builderForValue.build()); + renotifyIntervalBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -14880,24 +20876,25 @@ public Builder setPeriod(com.google.protobuf.Duration.Builder builderForValue) { * * *
-         * Not more than one notification per `period`.
+         * The frequency at which to send reminder notifications for open
+         * incidents.
          * 
* - * .google.protobuf.Duration period = 1; + * .google.protobuf.Duration renotify_interval = 2; */ - public Builder mergePeriod(com.google.protobuf.Duration value) { - if (periodBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) - && period_ != null - && period_ != com.google.protobuf.Duration.getDefaultInstance()) { - getPeriodBuilder().mergeFrom(value); + public Builder mergeRenotifyInterval(com.google.protobuf.Duration value) { + if (renotifyIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && renotifyInterval_ != null + && renotifyInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRenotifyIntervalBuilder().mergeFrom(value); } else { - period_ = value; + renotifyInterval_ = value; } } else { - periodBuilder_.mergeFrom(value); + renotifyIntervalBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -14905,17 +20902,18 @@ public Builder mergePeriod(com.google.protobuf.Duration value) { * * *
-         * Not more than one notification per `period`.
+         * The frequency at which to send reminder notifications for open
+         * incidents.
          * 
* - * .google.protobuf.Duration period = 1; + * .google.protobuf.Duration renotify_interval = 2; */ - public Builder clearPeriod() { - bitField0_ = (bitField0_ & ~0x00000001); - period_ = null; - if (periodBuilder_ != null) { - periodBuilder_.dispose(); - periodBuilder_ = null; + public Builder clearRenotifyInterval() { + bitField0_ = (bitField0_ & ~0x00000002); + renotifyInterval_ = null; + if (renotifyIntervalBuilder_ != null) { + renotifyIntervalBuilder_.dispose(); + renotifyIntervalBuilder_ = null; } onChanged(); return this; @@ -14924,56 +20922,61 @@ public Builder clearPeriod() { * * *
-         * Not more than one notification per `period`.
+         * The frequency at which to send reminder notifications for open
+         * incidents.
          * 
* - * .google.protobuf.Duration period = 1; + * .google.protobuf.Duration renotify_interval = 2; */ - public com.google.protobuf.Duration.Builder getPeriodBuilder() { - bitField0_ |= 0x00000001; + public com.google.protobuf.Duration.Builder getRenotifyIntervalBuilder() { + bitField0_ |= 0x00000002; onChanged(); - return getPeriodFieldBuilder().getBuilder(); + return getRenotifyIntervalFieldBuilder().getBuilder(); } /** * * *
-         * Not more than one notification per `period`.
+         * The frequency at which to send reminder notifications for open
+         * incidents.
          * 
* - * .google.protobuf.Duration period = 1; + * .google.protobuf.Duration renotify_interval = 2; */ - public com.google.protobuf.DurationOrBuilder getPeriodOrBuilder() { - if (periodBuilder_ != null) { - return periodBuilder_.getMessageOrBuilder(); + public com.google.protobuf.DurationOrBuilder getRenotifyIntervalOrBuilder() { + if (renotifyIntervalBuilder_ != null) { + return renotifyIntervalBuilder_.getMessageOrBuilder(); } else { - return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; + return renotifyInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : renotifyInterval_; } } /** * * *
-         * Not more than one notification per `period`.
+         * The frequency at which to send reminder notifications for open
+         * incidents.
          * 
* - * .google.protobuf.Duration period = 1; + * .google.protobuf.Duration renotify_interval = 2; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getPeriodFieldBuilder() { - if (periodBuilder_ == null) { - periodBuilder_ = + getRenotifyIntervalFieldBuilder() { + if (renotifyIntervalBuilder_ == null) { + renotifyIntervalBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getPeriod(), getParentForChildren(), isClean()); - period_ = null; + getRenotifyInterval(), getParentForChildren(), isClean()); + renotifyInterval_ = null; } - return periodBuilder_; + return renotifyIntervalBuilder_; } @java.lang.Override @@ -14988,27 +20991,28 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy) } - // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit) - private static final com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy) + private static final com.google.monitoring.v3.AlertPolicy.AlertStrategy + .NotificationChannelStrategy DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = - new com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit(); + new com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy(); } - public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public static com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public NotificationRateLimit parsePartialFrom( + public NotificationChannelStrategy parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -15028,17 +21032,17 @@ public NotificationRateLimit parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -15160,6 +21164,96 @@ public com.google.protobuf.DurationOrBuilder getAutoCloseOrBuilder() { return autoClose_ == null ? com.google.protobuf.Duration.getDefaultInstance() : autoClose_; } + public static final int NOTIFICATION_CHANNEL_STRATEGY_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy> + notificationChannelStrategy_; + /** + * + * + *
+     * Control how notifications will be sent out, on a per-channel basis.
+     * 
+ * + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * + */ + @java.lang.Override + public java.util.List< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy> + getNotificationChannelStrategyList() { + return notificationChannelStrategy_; + } + /** + * + * + *
+     * Control how notifications will be sent out, on a per-channel basis.
+     * 
+ * + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.monitoring.v3.AlertPolicy.AlertStrategy + .NotificationChannelStrategyOrBuilder> + getNotificationChannelStrategyOrBuilderList() { + return notificationChannelStrategy_; + } + /** + * + * + *
+     * Control how notifications will be sent out, on a per-channel basis.
+     * 
+ * + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * + */ + @java.lang.Override + public int getNotificationChannelStrategyCount() { + return notificationChannelStrategy_.size(); + } + /** + * + * + *
+     * Control how notifications will be sent out, on a per-channel basis.
+     * 
+ * + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + getNotificationChannelStrategy(int index) { + return notificationChannelStrategy_.get(index); + } + /** + * + * + *
+     * Control how notifications will be sent out, on a per-channel basis.
+     * 
+ * + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategyOrBuilder + getNotificationChannelStrategyOrBuilder(int index) { + return notificationChannelStrategy_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -15180,6 +21274,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (autoClose_ != null) { output.writeMessage(3, getAutoClose()); } + for (int i = 0; i < notificationChannelStrategy_.size(); i++) { + output.writeMessage(4, notificationChannelStrategy_.get(i)); + } getUnknownFields().writeTo(output); } @@ -15196,6 +21293,11 @@ public int getSerializedSize() { if (autoClose_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAutoClose()); } + for (int i = 0; i < notificationChannelStrategy_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, notificationChannelStrategy_.get(i)); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -15220,6 +21322,8 @@ public boolean equals(final java.lang.Object obj) { if (hasAutoClose()) { if (!getAutoClose().equals(other.getAutoClose())) return false; } + if (!getNotificationChannelStrategyList().equals(other.getNotificationChannelStrategyList())) + return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -15239,6 +21343,10 @@ public int hashCode() { hash = (37 * hash) + AUTO_CLOSE_FIELD_NUMBER; hash = (53 * hash) + getAutoClose().hashCode(); } + if (getNotificationChannelStrategyCount() > 0) { + hash = (37 * hash) + NOTIFICATION_CHANNEL_STRATEGY_FIELD_NUMBER; + hash = (53 * hash) + getNotificationChannelStrategyList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -15321,657 +21429,1153 @@ public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.monitoring.v3.AlertPolicy.AlertStrategy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Control over how the notification channels in `notification_channels`
+     * are notified when this alert fires.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.AlertPolicy.AlertStrategy} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.AlertStrategy) + com.google.monitoring.v3.AlertPolicy.AlertStrategyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.class, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.Builder.class); + } + + // Construct using com.google.monitoring.v3.AlertPolicy.AlertStrategy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + notificationRateLimit_ = null; + if (notificationRateLimitBuilder_ != null) { + notificationRateLimitBuilder_.dispose(); + notificationRateLimitBuilder_ = null; + } + autoClose_ = null; + if (autoCloseBuilder_ != null) { + autoCloseBuilder_.dispose(); + autoCloseBuilder_ = null; + } + if (notificationChannelStrategyBuilder_ == null) { + notificationChannelStrategy_ = java.util.Collections.emptyList(); + } else { + notificationChannelStrategy_ = null; + notificationChannelStrategyBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.AlertProto + .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.AlertStrategy getDefaultInstanceForType() { + return com.google.monitoring.v3.AlertPolicy.AlertStrategy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.AlertStrategy build() { + com.google.monitoring.v3.AlertPolicy.AlertStrategy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.AlertStrategy buildPartial() { + com.google.monitoring.v3.AlertPolicy.AlertStrategy result = + new com.google.monitoring.v3.AlertPolicy.AlertStrategy(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.monitoring.v3.AlertPolicy.AlertStrategy result) { + if (notificationChannelStrategyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + notificationChannelStrategy_ = + java.util.Collections.unmodifiableList(notificationChannelStrategy_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.notificationChannelStrategy_ = notificationChannelStrategy_; + } else { + result.notificationChannelStrategy_ = notificationChannelStrategyBuilder_.build(); + } + } + + private void buildPartial0(com.google.monitoring.v3.AlertPolicy.AlertStrategy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.notificationRateLimit_ = + notificationRateLimitBuilder_ == null + ? notificationRateLimit_ + : notificationRateLimitBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.autoClose_ = autoCloseBuilder_ == null ? autoClose_ : autoCloseBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } - public static Builder newBuilder(com.google.monitoring.v3.AlertPolicy.AlertStrategy prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.v3.AlertPolicy.AlertStrategy) { + return mergeFrom((com.google.monitoring.v3.AlertPolicy.AlertStrategy) other); + } else { + super.mergeFrom(other); + return this; + } + } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } + public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy.AlertStrategy other) { + if (other == com.google.monitoring.v3.AlertPolicy.AlertStrategy.getDefaultInstance()) + return this; + if (other.hasNotificationRateLimit()) { + mergeNotificationRateLimit(other.getNotificationRateLimit()); + } + if (other.hasAutoClose()) { + mergeAutoClose(other.getAutoClose()); + } + if (notificationChannelStrategyBuilder_ == null) { + if (!other.notificationChannelStrategy_.isEmpty()) { + if (notificationChannelStrategy_.isEmpty()) { + notificationChannelStrategy_ = other.notificationChannelStrategy_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureNotificationChannelStrategyIsMutable(); + notificationChannelStrategy_.addAll(other.notificationChannelStrategy_); + } + onChanged(); + } + } else { + if (!other.notificationChannelStrategy_.isEmpty()) { + if (notificationChannelStrategyBuilder_.isEmpty()) { + notificationChannelStrategyBuilder_.dispose(); + notificationChannelStrategyBuilder_ = null; + notificationChannelStrategy_ = other.notificationChannelStrategy_; + bitField0_ = (bitField0_ & ~0x00000004); + notificationChannelStrategyBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNotificationChannelStrategyFieldBuilder() + : null; + } else { + notificationChannelStrategyBuilder_.addAllMessages( + other.notificationChannelStrategy_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Control over how the notification channels in `notification_channels`
-     * are notified when this alert fires.
-     * 
- * - * Protobuf type {@code google.monitoring.v3.AlertPolicy.AlertStrategy} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.AlertStrategy) - com.google.monitoring.v3.AlertPolicy.AlertStrategyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor; + @java.lang.Override + public final boolean isInitialized() { + return true; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.AlertStrategy.class, - com.google.monitoring.v3.AlertPolicy.AlertStrategy.Builder.class); + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getNotificationRateLimitFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + input.readMessage(getAutoCloseFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: + { + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy m = + input.readMessage( + com.google.monitoring.v3.AlertPolicy.AlertStrategy + .NotificationChannelStrategy.parser(), + extensionRegistry); + if (notificationChannelStrategyBuilder_ == null) { + ensureNotificationChannelStrategyIsMutable(); + notificationChannelStrategy_.add(m); + } else { + notificationChannelStrategyBuilder_.addMessage(m); + } + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; } - // Construct using com.google.monitoring.v3.AlertPolicy.AlertStrategy.newBuilder() - private Builder() {} + private int bitField0_; - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + private com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + notificationRateLimit_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitOrBuilder> + notificationRateLimitBuilder_; + /** + * + * + *
+       * Required for alert policies with a `LogMatch` condition.
+       *
+       * This limit is not implemented for alert policies that are not log-based.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + * + * @return Whether the notificationRateLimit field is set. + */ + public boolean hasNotificationRateLimit() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Required for alert policies with a `LogMatch` condition.
+       *
+       * This limit is not implemented for alert policies that are not log-based.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + * + * @return The notificationRateLimit. + */ + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + getNotificationRateLimit() { + if (notificationRateLimitBuilder_ == null) { + return notificationRateLimit_ == null + ? com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + .getDefaultInstance() + : notificationRateLimit_; + } else { + return notificationRateLimitBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required for alert policies with a `LogMatch` condition.
+       *
+       * This limit is not implemented for alert policies that are not log-based.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + */ + public Builder setNotificationRateLimit( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit value) { + if (notificationRateLimitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + notificationRateLimit_ = value; + } else { + notificationRateLimitBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required for alert policies with a `LogMatch` condition.
+       *
+       * This limit is not implemented for alert policies that are not log-based.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + */ + public Builder setNotificationRateLimit( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder + builderForValue) { + if (notificationRateLimitBuilder_ == null) { + notificationRateLimit_ = builderForValue.build(); + } else { + notificationRateLimitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required for alert policies with a `LogMatch` condition.
+       *
+       * This limit is not implemented for alert policies that are not log-based.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + */ + public Builder mergeNotificationRateLimit( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit value) { + if (notificationRateLimitBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && notificationRateLimit_ != null + && notificationRateLimit_ + != com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + .getDefaultInstance()) { + getNotificationRateLimitBuilder().mergeFrom(value); + } else { + notificationRateLimit_ = value; + } + } else { + notificationRateLimitBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; + /** + * + * + *
+       * Required for alert policies with a `LogMatch` condition.
+       *
+       * This limit is not implemented for alert policies that are not log-based.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + */ + public Builder clearNotificationRateLimit() { + bitField0_ = (bitField0_ & ~0x00000001); notificationRateLimit_ = null; if (notificationRateLimitBuilder_ != null) { notificationRateLimitBuilder_.dispose(); notificationRateLimitBuilder_ = null; } - autoClose_ = null; - if (autoCloseBuilder_ != null) { - autoCloseBuilder_.dispose(); - autoCloseBuilder_ = null; - } + onChanged(); return this; } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor; - } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.AlertStrategy getDefaultInstanceForType() { - return com.google.monitoring.v3.AlertPolicy.AlertStrategy.getDefaultInstance(); - } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.AlertStrategy build() { - com.google.monitoring.v3.AlertPolicy.AlertStrategy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; + /** + * + * + *
+       * Required for alert policies with a `LogMatch` condition.
+       *
+       * This limit is not implemented for alert policies that are not log-based.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + */ + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder + getNotificationRateLimitBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getNotificationRateLimitFieldBuilder().getBuilder(); } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.AlertStrategy buildPartial() { - com.google.monitoring.v3.AlertPolicy.AlertStrategy result = - new com.google.monitoring.v3.AlertPolicy.AlertStrategy(this); - if (bitField0_ != 0) { - buildPartial0(result); + /** + * + * + *
+       * Required for alert policies with a `LogMatch` condition.
+       *
+       * This limit is not implemented for alert policies that are not log-based.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + */ + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitOrBuilder + getNotificationRateLimitOrBuilder() { + if (notificationRateLimitBuilder_ != null) { + return notificationRateLimitBuilder_.getMessageOrBuilder(); + } else { + return notificationRateLimit_ == null + ? com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + .getDefaultInstance() + : notificationRateLimit_; } - onBuilt(); - return result; } - - private void buildPartial0(com.google.monitoring.v3.AlertPolicy.AlertStrategy result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.notificationRateLimit_ = - notificationRateLimitBuilder_ == null - ? notificationRateLimit_ - : notificationRateLimitBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.autoClose_ = autoCloseBuilder_ == null ? autoClose_ : autoCloseBuilder_.build(); + /** + * + * + *
+       * Required for alert policies with a `LogMatch` condition.
+       *
+       * This limit is not implemented for alert policies that are not log-based.
+       * 
+ * + * + * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitOrBuilder> + getNotificationRateLimitFieldBuilder() { + if (notificationRateLimitBuilder_ == null) { + notificationRateLimitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder, + com.google.monitoring.v3.AlertPolicy.AlertStrategy + .NotificationRateLimitOrBuilder>( + getNotificationRateLimit(), getParentForChildren(), isClean()); + notificationRateLimit_ = null; } + return notificationRateLimitBuilder_; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + private com.google.protobuf.Duration autoClose_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + autoCloseBuilder_; + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + * + * @return Whether the autoClose field is set. + */ + public boolean hasAutoClose() { + return ((bitField0_ & 0x00000002) != 0); } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + * + * @return The autoClose. + */ + public com.google.protobuf.Duration getAutoClose() { + if (autoCloseBuilder_ == null) { + return autoClose_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : autoClose_; + } else { + return autoCloseBuilder_.getMessage(); + } } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public Builder setAutoClose(com.google.protobuf.Duration value) { + if (autoCloseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + autoClose_ = value; + } else { + autoCloseBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.monitoring.v3.AlertPolicy.AlertStrategy) { - return mergeFrom((com.google.monitoring.v3.AlertPolicy.AlertStrategy) other); + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public Builder setAutoClose(com.google.protobuf.Duration.Builder builderForValue) { + if (autoCloseBuilder_ == null) { + autoClose_ = builderForValue.build(); } else { - super.mergeFrom(other); - return this; + autoCloseBuilder_.setMessage(builderForValue.build()); } + bitField0_ |= 0x00000002; + onChanged(); + return this; } - - public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy.AlertStrategy other) { - if (other == com.google.monitoring.v3.AlertPolicy.AlertStrategy.getDefaultInstance()) - return this; - if (other.hasNotificationRateLimit()) { - mergeNotificationRateLimit(other.getNotificationRateLimit()); + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public Builder mergeAutoClose(com.google.protobuf.Duration value) { + if (autoCloseBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && autoClose_ != null + && autoClose_ != com.google.protobuf.Duration.getDefaultInstance()) { + getAutoCloseBuilder().mergeFrom(value); + } else { + autoClose_ = value; + } + } else { + autoCloseBuilder_.mergeFrom(value); } - if (other.hasAutoClose()) { - mergeAutoClose(other.getAutoClose()); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public Builder clearAutoClose() { + bitField0_ = (bitField0_ & ~0x00000002); + autoClose_ = null; + if (autoCloseBuilder_ != null) { + autoCloseBuilder_.dispose(); + autoCloseBuilder_ = null; } - this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } - - @java.lang.Override - public final boolean isInitialized() { - return true; + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public com.google.protobuf.Duration.Builder getAutoCloseBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAutoCloseFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public com.google.protobuf.DurationOrBuilder getAutoCloseOrBuilder() { + if (autoCloseBuilder_ != null) { + return autoCloseBuilder_.getMessageOrBuilder(); + } else { + return autoClose_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : autoClose_; + } + } + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getAutoCloseFieldBuilder() { + if (autoCloseBuilder_ == null) { + autoCloseBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getAutoClose(), getParentForChildren(), isClean()); + autoClose_ = null; + } + return autoCloseBuilder_; } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + private java.util.List< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy> + notificationChannelStrategy_ = java.util.Collections.emptyList(); + + private void ensureNotificationChannelStrategyIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + notificationChannelStrategy_ = + new java.util.ArrayList< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy>( + notificationChannelStrategy_); + bitField0_ |= 0x00000004; } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage( - getNotificationRateLimitFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 26: - { - input.readMessage(getAutoCloseFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; } - private int bitField0_; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + .Builder, + com.google.monitoring.v3.AlertPolicy.AlertStrategy + .NotificationChannelStrategyOrBuilder> + notificationChannelStrategyBuilder_; - private com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit - notificationRateLimit_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit, - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder, - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitOrBuilder> - notificationRateLimitBuilder_; /** * * *
-       * Required for alert policies with a `LogMatch` condition.
-       *
-       * This limit is not implemented for alert policies that are not log-based.
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; * - * - * @return Whether the notificationRateLimit field is set. */ - public boolean hasNotificationRateLimit() { - return ((bitField0_ & 0x00000001) != 0); + public java.util.List< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy> + getNotificationChannelStrategyList() { + if (notificationChannelStrategyBuilder_ == null) { + return java.util.Collections.unmodifiableList(notificationChannelStrategy_); + } else { + return notificationChannelStrategyBuilder_.getMessageList(); + } } /** * * *
-       * Required for alert policies with a `LogMatch` condition.
-       *
-       * This limit is not implemented for alert policies that are not log-based.
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; * - * - * @return The notificationRateLimit. */ - public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit - getNotificationRateLimit() { - if (notificationRateLimitBuilder_ == null) { - return notificationRateLimit_ == null - ? com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit - .getDefaultInstance() - : notificationRateLimit_; + public int getNotificationChannelStrategyCount() { + if (notificationChannelStrategyBuilder_ == null) { + return notificationChannelStrategy_.size(); } else { - return notificationRateLimitBuilder_.getMessage(); + return notificationChannelStrategyBuilder_.getCount(); } } /** * * *
-       * Required for alert policies with a `LogMatch` condition.
-       *
-       * This limit is not implemented for alert policies that are not log-based.
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; * */ - public Builder setNotificationRateLimit( - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit value) { - if (notificationRateLimitBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - notificationRateLimit_ = value; + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + getNotificationChannelStrategy(int index) { + if (notificationChannelStrategyBuilder_ == null) { + return notificationChannelStrategy_.get(index); } else { - notificationRateLimitBuilder_.setMessage(value); + return notificationChannelStrategyBuilder_.getMessage(index); } - bitField0_ |= 0x00000001; - onChanged(); - return this; } /** * * *
-       * Required for alert policies with a `LogMatch` condition.
-       *
-       * This limit is not implemented for alert policies that are not log-based.
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; * */ - public Builder setNotificationRateLimit( - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder - builderForValue) { - if (notificationRateLimitBuilder_ == null) { - notificationRateLimit_ = builderForValue.build(); + public Builder setNotificationChannelStrategy( + int index, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy value) { + if (notificationChannelStrategyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationChannelStrategyIsMutable(); + notificationChannelStrategy_.set(index, value); + onChanged(); } else { - notificationRateLimitBuilder_.setMessage(builderForValue.build()); + notificationChannelStrategyBuilder_.setMessage(index, value); } - bitField0_ |= 0x00000001; - onChanged(); return this; } /** * * *
-       * Required for alert policies with a `LogMatch` condition.
-       *
-       * This limit is not implemented for alert policies that are not log-based.
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; * */ - public Builder mergeNotificationRateLimit( - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit value) { - if (notificationRateLimitBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) - && notificationRateLimit_ != null - && notificationRateLimit_ - != com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit - .getDefaultInstance()) { - getNotificationRateLimitBuilder().mergeFrom(value); - } else { - notificationRateLimit_ = value; - } + public Builder setNotificationChannelStrategy( + int index, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy.Builder + builderForValue) { + if (notificationChannelStrategyBuilder_ == null) { + ensureNotificationChannelStrategyIsMutable(); + notificationChannelStrategy_.set(index, builderForValue.build()); + onChanged(); } else { - notificationRateLimitBuilder_.mergeFrom(value); + notificationChannelStrategyBuilder_.setMessage(index, builderForValue.build()); } - bitField0_ |= 0x00000001; - onChanged(); return this; } /** * * *
-       * Required for alert policies with a `LogMatch` condition.
-       *
-       * This limit is not implemented for alert policies that are not log-based.
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; * */ - public Builder clearNotificationRateLimit() { - bitField0_ = (bitField0_ & ~0x00000001); - notificationRateLimit_ = null; - if (notificationRateLimitBuilder_ != null) { - notificationRateLimitBuilder_.dispose(); - notificationRateLimitBuilder_ = null; + public Builder addNotificationChannelStrategy( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy value) { + if (notificationChannelStrategyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationChannelStrategyIsMutable(); + notificationChannelStrategy_.add(value); + onChanged(); + } else { + notificationChannelStrategyBuilder_.addMessage(value); } - onChanged(); return this; } /** * * *
-       * Required for alert policies with a `LogMatch` condition.
-       *
-       * This limit is not implemented for alert policies that are not log-based.
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; * */ - public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder - getNotificationRateLimitBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getNotificationRateLimitFieldBuilder().getBuilder(); + public Builder addNotificationChannelStrategy( + int index, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy value) { + if (notificationChannelStrategyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationChannelStrategyIsMutable(); + notificationChannelStrategy_.add(index, value); + onChanged(); + } else { + notificationChannelStrategyBuilder_.addMessage(index, value); + } + return this; } /** * * *
-       * Required for alert policies with a `LogMatch` condition.
-       *
-       * This limit is not implemented for alert policies that are not log-based.
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; * */ - public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitOrBuilder - getNotificationRateLimitOrBuilder() { - if (notificationRateLimitBuilder_ != null) { - return notificationRateLimitBuilder_.getMessageOrBuilder(); + public Builder addNotificationChannelStrategy( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy.Builder + builderForValue) { + if (notificationChannelStrategyBuilder_ == null) { + ensureNotificationChannelStrategyIsMutable(); + notificationChannelStrategy_.add(builderForValue.build()); + onChanged(); } else { - return notificationRateLimit_ == null - ? com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit - .getDefaultInstance() - : notificationRateLimit_; + notificationChannelStrategyBuilder_.addMessage(builderForValue.build()); } + return this; } /** * * *
-       * Required for alert policies with a `LogMatch` condition.
-       *
-       * This limit is not implemented for alert policies that are not log-based.
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* * - * .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; * */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit, - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder, - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitOrBuilder> - getNotificationRateLimitFieldBuilder() { - if (notificationRateLimitBuilder_ == null) { - notificationRateLimitBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit, - com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit.Builder, - com.google.monitoring.v3.AlertPolicy.AlertStrategy - .NotificationRateLimitOrBuilder>( - getNotificationRateLimit(), getParentForChildren(), isClean()); - notificationRateLimit_ = null; + public Builder addNotificationChannelStrategy( + int index, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy.Builder + builderForValue) { + if (notificationChannelStrategyBuilder_ == null) { + ensureNotificationChannelStrategyIsMutable(); + notificationChannelStrategy_.add(index, builderForValue.build()); + onChanged(); + } else { + notificationChannelStrategyBuilder_.addMessage(index, builderForValue.build()); } - return notificationRateLimitBuilder_; + return this; } - - private com.google.protobuf.Duration autoClose_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - autoCloseBuilder_; /** * * *
-       * If an alert policy that was active has no data for this long, any open
-       * incidents will close
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* - * .google.protobuf.Duration auto_close = 3; - * - * @return Whether the autoClose field is set. + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * */ - public boolean hasAutoClose() { - return ((bitField0_ & 0x00000002) != 0); + public Builder addAllNotificationChannelStrategy( + java.lang.Iterable< + ? extends + com.google.monitoring.v3.AlertPolicy.AlertStrategy + .NotificationChannelStrategy> + values) { + if (notificationChannelStrategyBuilder_ == null) { + ensureNotificationChannelStrategyIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, notificationChannelStrategy_); + onChanged(); + } else { + notificationChannelStrategyBuilder_.addAllMessages(values); + } + return this; } /** * * *
-       * If an alert policy that was active has no data for this long, any open
-       * incidents will close
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* - * .google.protobuf.Duration auto_close = 3; - * - * @return The autoClose. + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * */ - public com.google.protobuf.Duration getAutoClose() { - if (autoCloseBuilder_ == null) { - return autoClose_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : autoClose_; + public Builder clearNotificationChannelStrategy() { + if (notificationChannelStrategyBuilder_ == null) { + notificationChannelStrategy_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); } else { - return autoCloseBuilder_.getMessage(); + notificationChannelStrategyBuilder_.clear(); } + return this; } /** * * *
-       * If an alert policy that was active has no data for this long, any open
-       * incidents will close
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* - * .google.protobuf.Duration auto_close = 3; + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * */ - public Builder setAutoClose(com.google.protobuf.Duration value) { - if (autoCloseBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - autoClose_ = value; + public Builder removeNotificationChannelStrategy(int index) { + if (notificationChannelStrategyBuilder_ == null) { + ensureNotificationChannelStrategyIsMutable(); + notificationChannelStrategy_.remove(index); + onChanged(); } else { - autoCloseBuilder_.setMessage(value); + notificationChannelStrategyBuilder_.remove(index); } - bitField0_ |= 0x00000002; - onChanged(); return this; } /** * * *
-       * If an alert policy that was active has no data for this long, any open
-       * incidents will close
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* - * .google.protobuf.Duration auto_close = 3; + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * */ - public Builder setAutoClose(com.google.protobuf.Duration.Builder builderForValue) { - if (autoCloseBuilder_ == null) { - autoClose_ = builderForValue.build(); - } else { - autoCloseBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy.Builder + getNotificationChannelStrategyBuilder(int index) { + return getNotificationChannelStrategyFieldBuilder().getBuilder(index); } /** * * *
-       * If an alert policy that was active has no data for this long, any open
-       * incidents will close
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* - * .google.protobuf.Duration auto_close = 3; + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * */ - public Builder mergeAutoClose(com.google.protobuf.Duration value) { - if (autoCloseBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) - && autoClose_ != null - && autoClose_ != com.google.protobuf.Duration.getDefaultInstance()) { - getAutoCloseBuilder().mergeFrom(value); - } else { - autoClose_ = value; - } + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategyOrBuilder + getNotificationChannelStrategyOrBuilder(int index) { + if (notificationChannelStrategyBuilder_ == null) { + return notificationChannelStrategy_.get(index); } else { - autoCloseBuilder_.mergeFrom(value); + return notificationChannelStrategyBuilder_.getMessageOrBuilder(index); } - bitField0_ |= 0x00000002; - onChanged(); - return this; } /** * * *
-       * If an alert policy that was active has no data for this long, any open
-       * incidents will close
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* - * .google.protobuf.Duration auto_close = 3; + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * */ - public Builder clearAutoClose() { - bitField0_ = (bitField0_ & ~0x00000002); - autoClose_ = null; - if (autoCloseBuilder_ != null) { - autoCloseBuilder_.dispose(); - autoCloseBuilder_ = null; + public java.util.List< + ? extends + com.google.monitoring.v3.AlertPolicy.AlertStrategy + .NotificationChannelStrategyOrBuilder> + getNotificationChannelStrategyOrBuilderList() { + if (notificationChannelStrategyBuilder_ != null) { + return notificationChannelStrategyBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(notificationChannelStrategy_); } - onChanged(); - return this; } /** * * *
-       * If an alert policy that was active has no data for this long, any open
-       * incidents will close
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* - * .google.protobuf.Duration auto_close = 3; + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * */ - public com.google.protobuf.Duration.Builder getAutoCloseBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getAutoCloseFieldBuilder().getBuilder(); + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy.Builder + addNotificationChannelStrategyBuilder() { + return getNotificationChannelStrategyFieldBuilder() + .addBuilder( + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + .getDefaultInstance()); } /** * * *
-       * If an alert policy that was active has no data for this long, any open
-       * incidents will close
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* - * .google.protobuf.Duration auto_close = 3; + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * */ - public com.google.protobuf.DurationOrBuilder getAutoCloseOrBuilder() { - if (autoCloseBuilder_ != null) { - return autoCloseBuilder_.getMessageOrBuilder(); - } else { - return autoClose_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : autoClose_; - } + public com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy.Builder + addNotificationChannelStrategyBuilder(int index) { + return getNotificationChannelStrategyFieldBuilder() + .addBuilder( + index, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + .getDefaultInstance()); } /** * * *
-       * If an alert policy that was active has no data for this long, any open
-       * incidents will close
+       * Control how notifications will be sent out, on a per-channel basis.
        * 
* - * .google.protobuf.Duration auto_close = 3; + * + * repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getAutoCloseFieldBuilder() { - if (autoCloseBuilder_ == null) { - autoCloseBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getAutoClose(), getParentForChildren(), isClean()); - autoClose_ = null; + public java.util.List< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + .Builder> + getNotificationChannelStrategyBuilderList() { + return getNotificationChannelStrategyFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + .Builder, + com.google.monitoring.v3.AlertPolicy.AlertStrategy + .NotificationChannelStrategyOrBuilder> + getNotificationChannelStrategyFieldBuilder() { + if (notificationChannelStrategyBuilder_ == null) { + notificationChannelStrategyBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy, + com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + .Builder, + com.google.monitoring.v3.AlertPolicy.AlertStrategy + .NotificationChannelStrategyOrBuilder>( + notificationChannelStrategy_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + notificationChannelStrategy_ = null; } - return autoCloseBuilder_; + return notificationChannelStrategyBuilder_; } @java.lang.Override @@ -16119,6 +22723,12 @@ public com.google.protobuf.ByteString getNameBytes() { * notifications, and incidents. To avoid confusion, don't use the same * display name for multiple policies in the same project. The name is * limited to 512 Unicode characters. + * + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. *
* * string display_name = 2; @@ -16145,6 +22755,12 @@ public java.lang.String getDisplayName() { * notifications, and incidents. To avoid confusion, don't use the same * display name for multiple policies in the same project. The name is * limited to 512 Unicode characters. + * + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. *
* * string display_name = 2; @@ -16263,6 +22879,13 @@ public int getUserLabelsCount() { * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. *
* * map<string, string> user_labels = 16; @@ -16291,6 +22914,13 @@ public java.util.Map getUserLabels() { * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. *
* * map<string, string> user_labels = 16; @@ -16310,6 +22940,13 @@ public java.util.Map getUserLabelsMap() { * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. *
* * map<string, string> user_labels = 16; @@ -16336,6 +22973,13 @@ public java.util.Map getUserLabelsMap() { * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. *
* * map<string, string> user_labels = 16; @@ -16366,6 +23010,8 @@ public java.lang.String getUserLabelsOrThrow(java.lang.String key) { * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. *
* * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -16384,6 +23030,8 @@ public java.util.List getConditi * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. *
* * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -16403,6 +23051,8 @@ public java.util.List getConditi * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. *
* * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -16421,6 +23071,8 @@ public int getConditionsCount() { * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. *
* * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -16439,6 +23091,8 @@ public com.google.monitoring.v3.AlertPolicy.Condition getConditions(int index) { * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. *
* * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -16555,8 +23209,9 @@ public com.google.protobuf.BoolValueOrBuilder getEnabledOrBuilder() { * * *
-   * Read-only description of how the alert policy is invalid. OK if the alert
-   * policy is valid. If not OK, the alert policy will not generate incidents.
+   * Read-only description of how the alert policy is invalid. This field is
+   * only set when the alert policy is invalid. An invalid alert policy will not
+   * generate incidents.
    * 
* * .google.rpc.Status validity = 18; @@ -16571,8 +23226,9 @@ public boolean hasValidity() { * * *
-   * Read-only description of how the alert policy is invalid. OK if the alert
-   * policy is valid. If not OK, the alert policy will not generate incidents.
+   * Read-only description of how the alert policy is invalid. This field is
+   * only set when the alert policy is invalid. An invalid alert policy will not
+   * generate incidents.
    * 
* * .google.rpc.Status validity = 18; @@ -16587,8 +23243,9 @@ public com.google.rpc.Status getValidity() { * * *
-   * Read-only description of how the alert policy is invalid. OK if the alert
-   * policy is valid. If not OK, the alert policy will not generate incidents.
+   * Read-only description of how the alert policy is invalid. This field is
+   * only set when the alert policy is invalid. An invalid alert policy will not
+   * generate incidents.
    * 
* * .google.rpc.Status validity = 18; @@ -17761,6 +24418,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * notifications, and incidents. To avoid confusion, don't use the same * display name for multiple policies in the same project. The name is * limited to 512 Unicode characters. + * + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. *
* * string display_name = 2; @@ -17786,6 +24449,12 @@ public java.lang.String getDisplayName() { * notifications, and incidents. To avoid confusion, don't use the same * display name for multiple policies in the same project. The name is * limited to 512 Unicode characters. + * + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. *
* * string display_name = 2; @@ -17811,6 +24480,12 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { * notifications, and incidents. To avoid confusion, don't use the same * display name for multiple policies in the same project. The name is * limited to 512 Unicode characters. + * + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. *
* * string display_name = 2; @@ -17835,6 +24510,12 @@ public Builder setDisplayName(java.lang.String value) { * notifications, and incidents. To avoid confusion, don't use the same * display name for multiple policies in the same project. The name is * limited to 512 Unicode characters. + * + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. *
* * string display_name = 2; @@ -17855,6 +24536,12 @@ public Builder clearDisplayName() { * notifications, and incidents. To avoid confusion, don't use the same * display name for multiple policies in the same project. The name is * limited to 512 Unicode characters. + * + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. *
* * string display_name = 2; @@ -18133,6 +24820,13 @@ public int getUserLabelsCount() { * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. *
* * map<string, string> user_labels = 16; @@ -18161,6 +24855,13 @@ public java.util.Map getUserLabels() { * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. *
* * map<string, string> user_labels = 16; @@ -18180,6 +24881,13 @@ public java.util.Map getUserLabelsMap() { * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. *
* * map<string, string> user_labels = 16; @@ -18206,6 +24914,13 @@ public java.util.Map getUserLabelsMap() { * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. *
* * map<string, string> user_labels = 16; @@ -18238,6 +24953,13 @@ public Builder clearUserLabels() { * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. * * * map<string, string> user_labels = 16; @@ -18266,6 +24988,13 @@ public java.util.Map getMutableUserLabels() * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. * * * map<string, string> user_labels = 16; @@ -18292,6 +25021,13 @@ public Builder putUserLabels(java.lang.String key, java.lang.String value) { * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. * * * map<string, string> user_labels = 16; @@ -18329,6 +25065,8 @@ private void ensureConditionsIsMutable() { * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18350,6 +25088,8 @@ public java.util.List getConditi * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18371,6 +25111,8 @@ public int getConditionsCount() { * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18392,6 +25134,8 @@ public com.google.monitoring.v3.AlertPolicy.Condition getConditions(int index) { * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18419,6 +25163,8 @@ public Builder setConditions(int index, com.google.monitoring.v3.AlertPolicy.Con * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18444,6 +25190,8 @@ public Builder setConditions( * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18471,6 +25219,8 @@ public Builder addConditions(com.google.monitoring.v3.AlertPolicy.Condition valu * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18498,6 +25248,8 @@ public Builder addConditions(int index, com.google.monitoring.v3.AlertPolicy.Con * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18523,6 +25275,8 @@ public Builder addConditions( * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18548,6 +25302,8 @@ public Builder addConditions( * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18573,6 +25329,8 @@ public Builder addAllConditions( * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18597,6 +25355,8 @@ public Builder clearConditions() { * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18621,6 +25381,8 @@ public Builder removeConditions(int index) { * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18638,6 +25400,8 @@ public com.google.monitoring.v3.AlertPolicy.Condition.Builder getConditionsBuild * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18660,6 +25424,8 @@ public com.google.monitoring.v3.AlertPolicy.ConditionOrBuilder getConditionsOrBu * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18682,6 +25448,8 @@ public com.google.monitoring.v3.AlertPolicy.ConditionOrBuilder getConditionsOrBu * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18700,6 +25468,8 @@ public com.google.monitoring.v3.AlertPolicy.Condition.Builder addConditionsBuild * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -18718,6 +25488,8 @@ public com.google.monitoring.v3.AlertPolicy.Condition.Builder addConditionsBuild * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -19074,8 +25846,9 @@ public com.google.protobuf.BoolValueOrBuilder getEnabledOrBuilder() { * * *
-     * Read-only description of how the alert policy is invalid. OK if the alert
-     * policy is valid. If not OK, the alert policy will not generate incidents.
+     * Read-only description of how the alert policy is invalid. This field is
+     * only set when the alert policy is invalid. An invalid alert policy will not
+     * generate incidents.
      * 
* * .google.rpc.Status validity = 18; @@ -19089,8 +25862,9 @@ public boolean hasValidity() { * * *
-     * Read-only description of how the alert policy is invalid. OK if the alert
-     * policy is valid. If not OK, the alert policy will not generate incidents.
+     * Read-only description of how the alert policy is invalid. This field is
+     * only set when the alert policy is invalid. An invalid alert policy will not
+     * generate incidents.
      * 
* * .google.rpc.Status validity = 18; @@ -19108,8 +25882,9 @@ public com.google.rpc.Status getValidity() { * * *
-     * Read-only description of how the alert policy is invalid. OK if the alert
-     * policy is valid. If not OK, the alert policy will not generate incidents.
+     * Read-only description of how the alert policy is invalid. This field is
+     * only set when the alert policy is invalid. An invalid alert policy will not
+     * generate incidents.
      * 
* * .google.rpc.Status validity = 18; @@ -19131,8 +25906,9 @@ public Builder setValidity(com.google.rpc.Status value) { * * *
-     * Read-only description of how the alert policy is invalid. OK if the alert
-     * policy is valid. If not OK, the alert policy will not generate incidents.
+     * Read-only description of how the alert policy is invalid. This field is
+     * only set when the alert policy is invalid. An invalid alert policy will not
+     * generate incidents.
      * 
* * .google.rpc.Status validity = 18; @@ -19151,8 +25927,9 @@ public Builder setValidity(com.google.rpc.Status.Builder builderForValue) { * * *
-     * Read-only description of how the alert policy is invalid. OK if the alert
-     * policy is valid. If not OK, the alert policy will not generate incidents.
+     * Read-only description of how the alert policy is invalid. This field is
+     * only set when the alert policy is invalid. An invalid alert policy will not
+     * generate incidents.
      * 
* * .google.rpc.Status validity = 18; @@ -19177,8 +25954,9 @@ public Builder mergeValidity(com.google.rpc.Status value) { * * *
-     * Read-only description of how the alert policy is invalid. OK if the alert
-     * policy is valid. If not OK, the alert policy will not generate incidents.
+     * Read-only description of how the alert policy is invalid. This field is
+     * only set when the alert policy is invalid. An invalid alert policy will not
+     * generate incidents.
      * 
* * .google.rpc.Status validity = 18; @@ -19197,8 +25975,9 @@ public Builder clearValidity() { * * *
-     * Read-only description of how the alert policy is invalid. OK if the alert
-     * policy is valid. If not OK, the alert policy will not generate incidents.
+     * Read-only description of how the alert policy is invalid. This field is
+     * only set when the alert policy is invalid. An invalid alert policy will not
+     * generate incidents.
      * 
* * .google.rpc.Status validity = 18; @@ -19212,8 +25991,9 @@ public com.google.rpc.Status.Builder getValidityBuilder() { * * *
-     * Read-only description of how the alert policy is invalid. OK if the alert
-     * policy is valid. If not OK, the alert policy will not generate incidents.
+     * Read-only description of how the alert policy is invalid. This field is
+     * only set when the alert policy is invalid. An invalid alert policy will not
+     * generate incidents.
      * 
* * .google.rpc.Status validity = 18; @@ -19229,8 +26009,9 @@ public com.google.rpc.StatusOrBuilder getValidityOrBuilder() { * * *
-     * Read-only description of how the alert policy is invalid. OK if the alert
-     * policy is valid. If not OK, the alert policy will not generate incidents.
+     * Read-only description of how the alert policy is invalid. This field is
+     * only set when the alert policy is invalid. An invalid alert policy will not
+     * generate incidents.
      * 
* * .google.rpc.Status validity = 18; diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyOrBuilder.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyOrBuilder.java index de3b2ce2b183..5e8a65b28b4f 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyOrBuilder.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyOrBuilder.java @@ -74,6 +74,12 @@ public interface AlertPolicyOrBuilder * notifications, and incidents. To avoid confusion, don't use the same * display name for multiple policies in the same project. The name is * limited to 512 Unicode characters. + * + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. * * * string display_name = 2; @@ -89,6 +95,12 @@ public interface AlertPolicyOrBuilder * notifications, and incidents. To avoid confusion, don't use the same * display name for multiple policies in the same project. The name is * limited to 512 Unicode characters. + * + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. * * * string display_name = 2; @@ -155,6 +167,13 @@ public interface AlertPolicyOrBuilder * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. * * * map<string, string> user_labels = 16; @@ -171,6 +190,13 @@ public interface AlertPolicyOrBuilder * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. * * * map<string, string> user_labels = 16; @@ -190,6 +216,13 @@ public interface AlertPolicyOrBuilder * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. * * * map<string, string> user_labels = 16; @@ -206,6 +239,13 @@ public interface AlertPolicyOrBuilder * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. * * * map<string, string> user_labels = 16; @@ -226,6 +266,13 @@ java.lang.String getUserLabelsOrDefault( * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. + * + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. * * * map<string, string> user_labels = 16; @@ -242,6 +289,8 @@ java.lang.String getUserLabelsOrDefault( * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -257,6 +306,8 @@ java.lang.String getUserLabelsOrDefault( * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -272,6 +323,8 @@ java.lang.String getUserLabelsOrDefault( * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -287,6 +340,8 @@ java.lang.String getUserLabelsOrDefault( * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -303,6 +358,8 @@ java.lang.String getUserLabelsOrDefault( * conditions. * If `condition_time_series_query_language` is present, it must be the only * `condition`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. * * * repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; @@ -391,8 +448,9 @@ java.lang.String getUserLabelsOrDefault( * * *
-   * Read-only description of how the alert policy is invalid. OK if the alert
-   * policy is valid. If not OK, the alert policy will not generate incidents.
+   * Read-only description of how the alert policy is invalid. This field is
+   * only set when the alert policy is invalid. An invalid alert policy will not
+   * generate incidents.
    * 
* * .google.rpc.Status validity = 18; @@ -404,8 +462,9 @@ java.lang.String getUserLabelsOrDefault( * * *
-   * Read-only description of how the alert policy is invalid. OK if the alert
-   * policy is valid. If not OK, the alert policy will not generate incidents.
+   * Read-only description of how the alert policy is invalid. This field is
+   * only set when the alert policy is invalid. An invalid alert policy will not
+   * generate incidents.
    * 
* * .google.rpc.Status validity = 18; @@ -417,8 +476,9 @@ java.lang.String getUserLabelsOrDefault( * * *
-   * Read-only description of how the alert policy is invalid. OK if the alert
-   * policy is valid. If not OK, the alert policy will not generate incidents.
+   * Read-only description of how the alert policy is invalid. This field is
+   * only set when the alert policy is invalid. An invalid alert policy will not
+   * generate incidents.
    * 
* * .google.rpc.Status validity = 18; diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java index 57c6826a14f7..c0579be51495 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java @@ -47,6 +47,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_ForecastOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_ForecastOptions_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -63,6 +67,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_LabelsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -71,6 +83,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationChannelStrategy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationChannelStrategy_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_monitoring_v3_AlertPolicy_UserLabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -91,7 +107,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "monitoring/v3/mutation_record.proto\032\036goo" + "gle/protobuf/duration.proto\032\036google/prot" + "obuf/wrappers.proto\032\027google/rpc/status.p" - + "roto\"\336\032\n\013AlertPolicy\022\014\n\004name\030\001 \001(\t\022\024\n\014di" + + "roto\"\222\"\n\013AlertPolicy\022\014\n\004name\030\001 \001(\t\022\024\n\014di" + "splay_name\030\002 \001(\t\022F\n\rdocumentation\030\r \001(\0132" + "/.google.monitoring.v3.AlertPolicy.Docum" + "entation\022F\n\013user_labels\030\020 \003(\01321.google.m" @@ -107,81 +123,105 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\017mutation_record\030\013 \001(\0132$.google.monitori" + "ng.v3.MutationRecord\022G\n\016alert_strategy\030\025" + " \001(\0132/.google.monitoring.v3.AlertPolicy." - + "AlertStrategy\0323\n\rDocumentation\022\017\n\007conten" - + "t\030\001 \001(\t\022\021\n\tmime_type\030\002 \001(\t\032\321\020\n\tCondition" - + "\022\014\n\004name\030\014 \001(\t\022\024\n\014display_name\030\006 \001(\t\022Z\n\023" - + "condition_threshold\030\001 \001(\0132;.google.monit" - + "oring.v3.AlertPolicy.Condition.MetricThr" - + "esholdH\000\022U\n\020condition_absent\030\002 \001(\01329.goo" + + "AlertStrategy\032J\n\rDocumentation\022\017\n\007conten" + + "t\030\001 \001(\t\022\021\n\tmime_type\030\002 \001(\t\022\025\n\007subject\030\003 " + + "\001(\tB\004\342A\001\001\032\201\026\n\tCondition\022\014\n\004name\030\014 \001(\t\022\024\n" + + "\014display_name\030\006 \001(\t\022Z\n\023condition_thresho" + + "ld\030\001 \001(\0132;.google.monitoring.v3.AlertPol" + + "icy.Condition.MetricThresholdH\000\022U\n\020condi" + + "tion_absent\030\002 \001(\01329.google.monitoring.v3" + + ".AlertPolicy.Condition.MetricAbsenceH\000\022U" + + "\n\025condition_matched_log\030\024 \001(\01324.google.m" + + "onitoring.v3.AlertPolicy.Condition.LogMa" + + "tchH\000\022{\n#condition_monitoring_query_lang" + + "uage\030\023 \001(\0132L.google.monitoring.v3.AlertP" + + "olicy.Condition.MonitoringQueryLanguageC" + + "onditionH\000\022{\n#condition_prometheus_query" + + "_language\030\025 \001(\0132L.google.monitoring.v3.A" + + "lertPolicy.Condition.PrometheusQueryLang" + + "uageConditionH\000\0325\n\007Trigger\022\017\n\005count\030\001 \001(" + + "\005H\000\022\021\n\007percent\030\002 \001(\001H\000B\006\n\004type\032\240\005\n\017Metri" + + "cThreshold\022\024\n\006filter\030\002 \001(\tB\004\342A\001\002\0227\n\014aggr" + + "egations\030\010 \003(\0132!.google.monitoring.v3.Ag" + + "gregation\022\032\n\022denominator_filter\030\t \001(\t\022C\n" + + "\030denominator_aggregations\030\n \003(\0132!.google" + + ".monitoring.v3.Aggregation\022e\n\020forecast_o" + + "ptions\030\014 \001(\0132K.google.monitoring.v3.Aler" + + "tPolicy.Condition.MetricThreshold.Foreca" + + "stOptions\0228\n\ncomparison\030\004 \001(\0162$.google.m" + + "onitoring.v3.ComparisonType\022\027\n\017threshold" + + "_value\030\005 \001(\001\022+\n\010duration\030\006 \001(\0132\031.google." + + "protobuf.Duration\022D\n\007trigger\030\007 \001(\01323.goo" + "gle.monitoring.v3.AlertPolicy.Condition." - + "MetricAbsenceH\000\022U\n\025condition_matched_log" - + "\030\024 \001(\01324.google.monitoring.v3.AlertPolic" - + "y.Condition.LogMatchH\000\022{\n#condition_moni" - + "toring_query_language\030\023 \001(\0132L.google.mon" - + "itoring.v3.AlertPolicy.Condition.Monitor" - + "ingQueryLanguageConditionH\000\0325\n\007Trigger\022\017" - + "\n\005count\030\001 \001(\005H\000\022\021\n\007percent\030\002 \001(\001H\000B\006\n\004ty" - + "pe\032\353\003\n\017MetricThreshold\022\024\n\006filter\030\002 \001(\tB\004" - + "\342A\001\002\0227\n\014aggregations\030\010 \003(\0132!.google.moni" - + "toring.v3.Aggregation\022\032\n\022denominator_fil" - + "ter\030\t \001(\t\022C\n\030denominator_aggregations\030\n " - + "\003(\0132!.google.monitoring.v3.Aggregation\0228" - + "\n\ncomparison\030\004 \001(\0162$.google.monitoring.v" - + "3.ComparisonType\022\027\n\017threshold_value\030\005 \001(" - + "\001\022+\n\010duration\030\006 \001(\0132\031.google.protobuf.Du" - + "ration\022D\n\007trigger\030\007 \001(\01323.google.monitor" + + "Trigger\022b\n\027evaluation_missing_data\030\013 \001(\016" + + "2A.google.monitoring.v3.AlertPolicy.Cond" + + "ition.EvaluationMissingData\032L\n\017ForecastO" + + "ptions\0229\n\020forecast_horizon\030\001 \001(\0132\031.googl" + + "e.protobuf.DurationB\004\342A\001\002\032\321\001\n\rMetricAbse" + + "nce\022\024\n\006filter\030\001 \001(\tB\004\342A\001\002\0227\n\014aggregation" + + "s\030\005 \003(\0132!.google.monitoring.v3.Aggregati" + + "on\022+\n\010duration\030\002 \001(\0132\031.google.protobuf.D" + + "uration\022D\n\007trigger\030\003 \001(\01323.google.monito" + + "ring.v3.AlertPolicy.Condition.Trigger\032\275\001" + + "\n\010LogMatch\022\024\n\006filter\030\001 \001(\tB\004\342A\001\002\022c\n\020labe" + + "l_extractors\030\002 \003(\0132I.google.monitoring.v" + + "3.AlertPolicy.Condition.LogMatch.LabelEx" + + "tractorsEntry\0326\n\024LabelExtractorsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032\210\002\n Monito" + + "ringQueryLanguageCondition\022\r\n\005query\030\001 \001(" + + "\t\022+\n\010duration\030\002 \001(\0132\031.google.protobuf.Du" + + "ration\022D\n\007trigger\030\003 \001(\01323.google.monitor" + "ing.v3.AlertPolicy.Condition.Trigger\022b\n\027" - + "evaluation_missing_data\030\013 \001(\0162A.google.m" + + "evaluation_missing_data\030\004 \001(\0162A.google.m" + "onitoring.v3.AlertPolicy.Condition.Evalu" - + "ationMissingData\032\321\001\n\rMetricAbsence\022\024\n\006fi" - + "lter\030\001 \001(\tB\004\342A\001\002\0227\n\014aggregations\030\005 \003(\0132!" - + ".google.monitoring.v3.Aggregation\022+\n\010dur" - + "ation\030\002 \001(\0132\031.google.protobuf.Duration\022D" - + "\n\007trigger\030\003 \001(\01323.google.monitoring.v3.A" - + "lertPolicy.Condition.Trigger\032\275\001\n\010LogMatc" - + "h\022\024\n\006filter\030\001 \001(\tB\004\342A\001\002\022c\n\020label_extract" - + "ors\030\002 \003(\0132I.google.monitoring.v3.AlertPo" - + "licy.Condition.LogMatch.LabelExtractorsE" - + "ntry\0326\n\024LabelExtractorsEntry\022\013\n\003key\030\001 \001(" - + "\t\022\r\n\005value\030\002 \001(\t:\0028\001\032\210\002\n MonitoringQuery" - + "LanguageCondition\022\r\n\005query\030\001 \001(\t\022+\n\010dura" - + "tion\030\002 \001(\0132\031.google.protobuf.Duration\022D\n" - + "\007trigger\030\003 \001(\01323.google.monitoring.v3.Al" - + "ertPolicy.Condition.Trigger\022b\n\027evaluatio" - + "n_missing_data\030\004 \001(\0162A.google.monitoring" - + ".v3.AlertPolicy.Condition.EvaluationMiss" - + "ingData\"\255\001\n\025EvaluationMissingData\022\'\n#EVA" - + "LUATION_MISSING_DATA_UNSPECIFIED\020\000\022$\n EV" - + "ALUATION_MISSING_DATA_INACTIVE\020\001\022\"\n\036EVAL" - + "UATION_MISSING_DATA_ACTIVE\020\002\022!\n\035EVALUATI" - + "ON_MISSING_DATA_NO_OP\020\003:\227\002\352A\223\002\n.monitori" - + "ng.googleapis.com/AlertPolicyCondition\022F" - + "projects/{project}/alertPolicies/{alert_" - + "policy}/conditions/{condition}\022Porganiza" - + "tions/{organization}/alertPolicies/{aler" - + "t_policy}/conditions/{condition}\022Dfolder" - + "s/{folder}/alertPolicies/{alert_policy}/" - + "conditions/{condition}\022\001*B\013\n\tcondition\032\352" - + "\001\n\rAlertStrategy\022f\n\027notification_rate_li" - + "mit\030\001 \001(\0132E.google.monitoring.v3.AlertPo" - + "licy.AlertStrategy.NotificationRateLimit" - + "\022-\n\nauto_close\030\003 \001(\0132\031.google.protobuf.D" - + "uration\032B\n\025NotificationRateLimit\022)\n\006peri" - + "od\030\001 \001(\0132\031.google.protobuf.Duration\0321\n\017U" - + "serLabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" - + "(\t:\0028\001\"a\n\025ConditionCombinerType\022\027\n\023COMBI" - + "NE_UNSPECIFIED\020\000\022\007\n\003AND\020\001\022\006\n\002OR\020\002\022\036\n\032AND" - + "_WITH_MATCHING_RESOURCE\020\003:\311\001\352A\305\001\n%monito" - + "ring.googleapis.com/AlertPolicy\022/project" - + "s/{project}/alertPolicies/{alert_policy}" - + "\0229organizations/{organization}/alertPoli" - + "cies/{alert_policy}\022-folders/{folder}/al" - + "ertPolicies/{alert_policy}\022\001*B\305\001\n\030com.go" - + "ogle.monitoring.v3B\nAlertProtoP\001ZAcloud." - + "google.com/go/monitoring/apiv3/v2/monito" - + "ringpb;monitoringpb\252\002\032Google.Cloud.Monit" - + "oring.V3\312\002\032Google\\Cloud\\Monitoring\\V3\352\002\035" - + "Google::Cloud::Monitoring::V3b\006proto3" + + "ationMissingData\032\373\002\n PrometheusQueryLang" + + "uageCondition\022\023\n\005query\030\001 \001(\tB\004\342A\001\002\0221\n\010du" + + "ration\030\002 \001(\0132\031.google.protobuf.DurationB" + + "\004\342A\001\001\022<\n\023evaluation_interval\030\003 \001(\0132\031.goo" + + "gle.protobuf.DurationB\004\342A\001\001\022n\n\006labels\030\004 " + + "\003(\0132X.google.monitoring.v3.AlertPolicy.C" + + "ondition.PrometheusQueryLanguageConditio" + + "n.LabelsEntryB\004\342A\001\001\022\030\n\nrule_group\030\005 \001(\tB" + + "\004\342A\001\001\022\030\n\nalert_rule\030\006 \001(\tB\004\342A\001\001\032-\n\013Label" + + "sEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\255" + + "\001\n\025EvaluationMissingData\022\'\n#EVALUATION_M" + + "ISSING_DATA_UNSPECIFIED\020\000\022$\n EVALUATION_" + + "MISSING_DATA_INACTIVE\020\001\022\"\n\036EVALUATION_MI" + + "SSING_DATA_ACTIVE\020\002\022!\n\035EVALUATION_MISSIN" + + "G_DATA_NO_OP\020\003:\227\002\352A\223\002\n.monitoring.google" + + "apis.com/AlertPolicyCondition\022Fprojects/" + + "{project}/alertPolicies/{alert_policy}/c" + + "onditions/{condition}\022Porganizations/{or" + + "ganization}/alertPolicies/{alert_policy}" + + "/conditions/{condition}\022Dfolders/{folder" + + "}/alertPolicies/{alert_policy}/condition" + + "s/{condition}\022\001*B\013\n\tcondition\032\327\003\n\rAlertS" + + "trategy\022f\n\027notification_rate_limit\030\001 \001(\013" + + "2E.google.monitoring.v3.AlertPolicy.Aler" + + "tStrategy.NotificationRateLimit\022-\n\nauto_" + + "close\030\003 \001(\0132\031.google.protobuf.Duration\022r" + + "\n\035notification_channel_strategy\030\004 \003(\0132K." + + "google.monitoring.v3.AlertPolicy.AlertSt" + + "rategy.NotificationChannelStrategy\032B\n\025No" + + "tificationRateLimit\022)\n\006period\030\001 \001(\0132\031.go" + + "ogle.protobuf.Duration\032w\n\033NotificationCh" + + "annelStrategy\022\"\n\032notification_channel_na" + + "mes\030\001 \003(\t\0224\n\021renotify_interval\030\002 \001(\0132\031.g" + + "oogle.protobuf.Duration\0321\n\017UserLabelsEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"a\n\025Co" + + "nditionCombinerType\022\027\n\023COMBINE_UNSPECIFI" + + "ED\020\000\022\007\n\003AND\020\001\022\006\n\002OR\020\002\022\036\n\032AND_WITH_MATCHI" + + "NG_RESOURCE\020\003:\311\001\352A\305\001\n%monitoring.googlea" + + "pis.com/AlertPolicy\022/projects/{project}/" + + "alertPolicies/{alert_policy}\0229organizati" + + "ons/{organization}/alertPolicies/{alert_" + + "policy}\022-folders/{folder}/alertPolicies/" + + "{alert_policy}\022\001*B\305\001\n\030com.google.monitor" + + "ing.v3B\nAlertProtoP\001ZAcloud.google.com/g" + + "o/monitoring/apiv3/v2/monitoringpb;monit" + + "oringpb\252\002\032Google.Cloud.Monitoring.V3\312\002\032G" + + "oogle\\Cloud\\Monitoring\\V3\352\002\035Google::Clou" + + "d::Monitoring::V3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -220,7 +260,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_AlertPolicy_Documentation_descriptor, new java.lang.String[] { - "Content", "MimeType", + "Content", "MimeType", "Subject", }); internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor = internal_static_google_monitoring_v3_AlertPolicy_descriptor.getNestedTypes().get(1); @@ -234,6 +274,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ConditionAbsent", "ConditionMatchedLog", "ConditionMonitoringQueryLanguage", + "ConditionPrometheusQueryLanguage", "Condition", }); internal_static_google_monitoring_v3_AlertPolicy_Condition_Trigger_descriptor = @@ -258,12 +299,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Aggregations", "DenominatorFilter", "DenominatorAggregations", + "ForecastOptions", "Comparison", "ThresholdValue", "Duration", "Trigger", "EvaluationMissingData", }); + internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_ForecastOptions_descriptor = + internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_descriptor + .getNestedTypes() + .get(0); + internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_ForecastOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricThreshold_ForecastOptions_descriptor, + new java.lang.String[] { + "ForecastHorizon", + }); internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_descriptor = internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor .getNestedTypes() @@ -304,13 +356,33 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Query", "Duration", "Trigger", "EvaluationMissingData", }); + internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_descriptor = + internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor + .getNestedTypes() + .get(5); + internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_descriptor, + new java.lang.String[] { + "Query", "Duration", "EvaluationInterval", "Labels", "RuleGroup", "AlertRule", + }); + internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_LabelsEntry_descriptor = + internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_descriptor + .getNestedTypes() + .get(0); + internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_AlertPolicy_Condition_PrometheusQueryLanguageCondition_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor = internal_static_google_monitoring_v3_AlertPolicy_descriptor.getNestedTypes().get(2); internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor, new java.lang.String[] { - "NotificationRateLimit", "AutoClose", + "NotificationRateLimit", "AutoClose", "NotificationChannelStrategy", }); internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_descriptor = internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor @@ -322,6 +394,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Period", }); + internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationChannelStrategy_descriptor = + internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor + .getNestedTypes() + .get(1); + internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationChannelStrategy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationChannelStrategy_descriptor, + new java.lang.String[] { + "NotificationChannelNames", "RenotifyInterval", + }); internal_static_google_monitoring_v3_AlertPolicy_UserLabelsEntry_descriptor = internal_static_google_monitoring_v3_AlertPolicy_descriptor.getNestedTypes().get(3); internal_static_google_monitoring_v3_AlertPolicy_UserLabelsEntry_fieldAccessorTable = diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequest.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequest.java index 3709956e2ae2..a2b754a8029e 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequest.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequest.java @@ -70,8 +70,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in
-   * which to create the alerting policy. The format is:
+   * 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]
    *
@@ -106,8 +107,9 @@ public java.lang.String getName() {
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in
-   * which to create the alerting policy. The format is:
+   * 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]
    *
@@ -145,9 +147,9 @@ public com.google.protobuf.ByteString getNameBytes() {
    *
    *
    * 
-   * 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.
+   * 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.
    * 
* * @@ -164,9 +166,9 @@ public boolean hasAlertPolicy() { * * *
-   * 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.
+   * 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.
    * 
* * @@ -185,9 +187,9 @@ public com.google.monitoring.v3.AlertPolicy getAlertPolicy() { * * *
-   * 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.
+   * 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.
    * 
* * @@ -580,8 +582,9 @@ public Builder mergeFrom( * * *
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in
-     * which to create the alerting policy. The format is:
+     * 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]
      *
@@ -615,8 +618,9 @@ public java.lang.String getName() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in
-     * which to create the alerting policy. The format is:
+     * 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]
      *
@@ -650,8 +654,9 @@ public com.google.protobuf.ByteString getNameBytes() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in
-     * which to create the alerting policy. The format is:
+     * 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]
      *
@@ -684,8 +689,9 @@ public Builder setName(java.lang.String value) {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in
-     * which to create the alerting policy. The format is:
+     * 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]
      *
@@ -714,8 +720,9 @@ public Builder clearName() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in
-     * which to create the alerting policy. The format is:
+     * 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]
      *
@@ -756,9 +763,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
      *
      *
      * 
-     * 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.
+     * 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.
      * 
* * @@ -774,9 +781,9 @@ public boolean hasAlertPolicy() { * * *
-     * 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.
+     * 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.
      * 
* * @@ -798,9 +805,9 @@ public com.google.monitoring.v3.AlertPolicy getAlertPolicy() { * * *
-     * 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.
+     * 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.
      * 
* * @@ -824,9 +831,9 @@ public Builder setAlertPolicy(com.google.monitoring.v3.AlertPolicy value) { * * *
-     * 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.
+     * 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.
      * 
* * @@ -847,9 +854,9 @@ public Builder setAlertPolicy(com.google.monitoring.v3.AlertPolicy.Builder build * * *
-     * 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.
+     * 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.
      * 
* * @@ -876,9 +883,9 @@ public Builder mergeAlertPolicy(com.google.monitoring.v3.AlertPolicy value) { * * *
-     * 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.
+     * 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.
      * 
* * @@ -899,9 +906,9 @@ public Builder clearAlertPolicy() { * * *
-     * 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.
+     * 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.
      * 
* * @@ -917,9 +924,9 @@ public com.google.monitoring.v3.AlertPolicy.Builder getAlertPolicyBuilder() { * * *
-     * 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.
+     * 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.
      * 
* * @@ -939,9 +946,9 @@ public com.google.monitoring.v3.AlertPolicyOrBuilder getAlertPolicyOrBuilder() { * * *
-     * 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.
+     * 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.
      * 
* * diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequestOrBuilder.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequestOrBuilder.java index b7287b6dcc01..1447a58ce5d3 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequestOrBuilder.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequestOrBuilder.java @@ -27,8 +27,9 @@ public interface CreateAlertPolicyRequestOrBuilder * * *
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in
-   * which to create the alerting policy. The format is:
+   * 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]
    *
@@ -52,8 +53,9 @@ public interface CreateAlertPolicyRequestOrBuilder
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in
-   * which to create the alerting policy. The format is:
+   * 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]
    *
@@ -78,9 +80,9 @@ public interface CreateAlertPolicyRequestOrBuilder
    *
    *
    * 
-   * 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.
+   * 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.
    * 
* * @@ -94,9 +96,9 @@ public interface CreateAlertPolicyRequestOrBuilder * * *
-   * 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.
+   * 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.
    * 
* * @@ -110,9 +112,9 @@ public interface CreateAlertPolicyRequestOrBuilder * * *
-   * 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.
+   * 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.
    * 
* * diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateNotificationChannelRequest.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateNotificationChannelRequest.java index 7feea07dc235..20adb1ed301f 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateNotificationChannelRequest.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateNotificationChannelRequest.java @@ -71,8 +71,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-   * which to execute the request. The format is:
+   * Required. The
+   * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+   * to execute the request. The format is:
    *
    *     projects/[PROJECT_ID_OR_NUMBER]
    *
@@ -104,8 +105,9 @@ public java.lang.String getName() {
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-   * which to execute the request. The format is:
+   * Required. The
+   * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+   * to execute the request. The format is:
    *
    *     projects/[PROJECT_ID_OR_NUMBER]
    *
@@ -573,8 +575,9 @@ public Builder mergeFrom(
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-     * which to execute the request. The format is:
+     * Required. The
+     * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+     * to execute the request. The format is:
      *
      *     projects/[PROJECT_ID_OR_NUMBER]
      *
@@ -605,8 +608,9 @@ public java.lang.String getName() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-     * which to execute the request. The format is:
+     * Required. The
+     * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+     * to execute the request. The format is:
      *
      *     projects/[PROJECT_ID_OR_NUMBER]
      *
@@ -637,8 +641,9 @@ public com.google.protobuf.ByteString getNameBytes() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-     * which to execute the request. The format is:
+     * Required. The
+     * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+     * to execute the request. The format is:
      *
      *     projects/[PROJECT_ID_OR_NUMBER]
      *
@@ -668,8 +673,9 @@ public Builder setName(java.lang.String value) {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-     * which to execute the request. The format is:
+     * Required. The
+     * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+     * to execute the request. The format is:
      *
      *     projects/[PROJECT_ID_OR_NUMBER]
      *
@@ -695,8 +701,9 @@ public Builder clearName() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-     * which to execute the request. The format is:
+     * Required. The
+     * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+     * to execute the request. The format is:
      *
      *     projects/[PROJECT_ID_OR_NUMBER]
      *
diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateNotificationChannelRequestOrBuilder.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateNotificationChannelRequestOrBuilder.java
index 0855819151f3..7312e5a6455c 100644
--- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateNotificationChannelRequestOrBuilder.java
+++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateNotificationChannelRequestOrBuilder.java
@@ -27,8 +27,9 @@ public interface CreateNotificationChannelRequestOrBuilder
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-   * which to execute the request. The format is:
+   * Required. The
+   * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+   * to execute the request. The format is:
    *
    *     projects/[PROJECT_ID_OR_NUMBER]
    *
@@ -49,8 +50,9 @@ public interface CreateNotificationChannelRequestOrBuilder
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-   * which to execute the request. The format is:
+   * Required. The
+   * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+   * to execute the request. The format is:
    *
    *     projects/[PROJECT_ID_OR_NUMBER]
    *
diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetNotificationChannelVerificationCodeRequest.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetNotificationChannelVerificationCodeRequest.java
index 0ac5cea3429c..2d624a9eab2a 100644
--- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetNotificationChannelVerificationCodeRequest.java
+++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetNotificationChannelVerificationCodeRequest.java
@@ -72,9 +72,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    *
    *
    * 
-   * Required. The notification channel for which a verification code is to be generated
-   * and retrieved. This must name a channel that is already verified; if
-   * the specified channel is not verified, the request will fail.
+   * Required. The notification channel for which a verification code is to be
+   * generated and retrieved. This must name a channel that is already verified;
+   * if the specified channel is not verified, the request will fail.
    * 
* * @@ -99,9 +99,9 @@ public java.lang.String getName() { * * *
-   * Required. The notification channel for which a verification code is to be generated
-   * and retrieved. This must name a channel that is already verified; if
-   * the specified channel is not verified, the request will fail.
+   * Required. The notification channel for which a verification code is to be
+   * generated and retrieved. This must name a channel that is already verified;
+   * if the specified channel is not verified, the request will fail.
    * 
* * @@ -581,9 +581,9 @@ public Builder mergeFrom( * * *
-     * Required. The notification channel for which a verification code is to be generated
-     * and retrieved. This must name a channel that is already verified; if
-     * the specified channel is not verified, the request will fail.
+     * Required. The notification channel for which a verification code is to be
+     * generated and retrieved. This must name a channel that is already verified;
+     * if the specified channel is not verified, the request will fail.
      * 
* * @@ -607,9 +607,9 @@ public java.lang.String getName() { * * *
-     * Required. The notification channel for which a verification code is to be generated
-     * and retrieved. This must name a channel that is already verified; if
-     * the specified channel is not verified, the request will fail.
+     * Required. The notification channel for which a verification code is to be
+     * generated and retrieved. This must name a channel that is already verified;
+     * if the specified channel is not verified, the request will fail.
      * 
* * @@ -633,9 +633,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The notification channel for which a verification code is to be generated
-     * and retrieved. This must name a channel that is already verified; if
-     * the specified channel is not verified, the request will fail.
+     * Required. The notification channel for which a verification code is to be
+     * generated and retrieved. This must name a channel that is already verified;
+     * if the specified channel is not verified, the request will fail.
      * 
* * @@ -658,9 +658,9 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The notification channel for which a verification code is to be generated
-     * and retrieved. This must name a channel that is already verified; if
-     * the specified channel is not verified, the request will fail.
+     * Required. The notification channel for which a verification code is to be
+     * generated and retrieved. This must name a channel that is already verified;
+     * if the specified channel is not verified, the request will fail.
      * 
* * @@ -679,9 +679,9 @@ public Builder clearName() { * * *
-     * Required. The notification channel for which a verification code is to be generated
-     * and retrieved. This must name a channel that is already verified; if
-     * the specified channel is not verified, the request will fail.
+     * Required. The notification channel for which a verification code is to be
+     * generated and retrieved. This must name a channel that is already verified;
+     * if the specified channel is not verified, the request will fail.
      * 
* * diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetNotificationChannelVerificationCodeRequestOrBuilder.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetNotificationChannelVerificationCodeRequestOrBuilder.java index 3c5973052a9c..be449b5aeca0 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetNotificationChannelVerificationCodeRequestOrBuilder.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetNotificationChannelVerificationCodeRequestOrBuilder.java @@ -27,9 +27,9 @@ public interface GetNotificationChannelVerificationCodeRequestOrBuilder * * *
-   * Required. The notification channel for which a verification code is to be generated
-   * and retrieved. This must name a channel that is already verified; if
-   * the specified channel is not verified, the request will fail.
+   * Required. The notification channel for which a verification code is to be
+   * generated and retrieved. This must name a channel that is already verified;
+   * if the specified channel is not verified, the request will fail.
    * 
* * @@ -43,9 +43,9 @@ public interface GetNotificationChannelVerificationCodeRequestOrBuilder * * *
-   * Required. The notification channel for which a verification code is to be generated
-   * and retrieved. This must name a channel that is already verified; if
-   * the specified channel is not verified, the request will fail.
+   * Required. The notification channel for which a verification code is to be
+   * generated and retrieved. This must name a channel that is already verified;
+   * if the specified channel is not verified, the request will fail.
    * 
* * diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesRequest.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesRequest.java index 66072d0cb72a..0011f103a54e 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesRequest.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesRequest.java @@ -73,8 +73,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name)
-   * whose alert policies are to be listed. The format is:
+   * 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]
    *
@@ -107,8 +108,9 @@ public java.lang.String getName() {
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name)
-   * whose alert policies are to be listed. The format is:
+   * 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]
    *
@@ -772,8 +774,9 @@ public Builder mergeFrom(
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name)
-     * whose alert policies are to be listed. The format is:
+     * 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]
      *
@@ -805,8 +808,9 @@ public java.lang.String getName() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name)
-     * whose alert policies are to be listed. The format is:
+     * 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]
      *
@@ -838,8 +842,9 @@ public com.google.protobuf.ByteString getNameBytes() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name)
-     * whose alert policies are to be listed. The format is:
+     * 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]
      *
@@ -870,8 +875,9 @@ public Builder setName(java.lang.String value) {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name)
-     * whose alert policies are to be listed. The format is:
+     * 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]
      *
@@ -898,8 +904,9 @@ public Builder clearName() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name)
-     * whose alert policies are to be listed. The format is:
+     * 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]
      *
diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesRequestOrBuilder.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesRequestOrBuilder.java
index d0028ffdfe2b..0496aa25b831 100644
--- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesRequestOrBuilder.java
+++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesRequestOrBuilder.java
@@ -27,8 +27,9 @@ public interface ListAlertPoliciesRequestOrBuilder
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name)
-   * whose alert policies are to be listed. The format is:
+   * 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]
    *
@@ -50,8 +51,9 @@ public interface ListAlertPoliciesRequestOrBuilder
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name)
-   * whose alert policies are to be listed. The format is:
+   * 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]
    *
diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsRequest.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsRequest.java
index a9e946bff224..7076933bc734 100644
--- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsRequest.java
+++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsRequest.java
@@ -74,8 +74,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-   * which to execute the request. The format is:
+   * Required. The
+   * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+   * to execute the request. The format is:
    *
    *     projects/[PROJECT_ID_OR_NUMBER]
    *
@@ -109,8 +110,9 @@ public java.lang.String getName() {
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-   * which to execute the request. The format is:
+   * Required. The
+   * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+   * to execute the request. The format is:
    *
    *     projects/[PROJECT_ID_OR_NUMBER]
    *
@@ -778,8 +780,9 @@ public Builder mergeFrom(
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-     * which to execute the request. The format is:
+     * Required. The
+     * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+     * to execute the request. The format is:
      *
      *     projects/[PROJECT_ID_OR_NUMBER]
      *
@@ -812,8 +815,9 @@ public java.lang.String getName() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-     * which to execute the request. The format is:
+     * Required. The
+     * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+     * to execute the request. The format is:
      *
      *     projects/[PROJECT_ID_OR_NUMBER]
      *
@@ -846,8 +850,9 @@ public com.google.protobuf.ByteString getNameBytes() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-     * which to execute the request. The format is:
+     * Required. The
+     * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+     * to execute the request. The format is:
      *
      *     projects/[PROJECT_ID_OR_NUMBER]
      *
@@ -879,8 +884,9 @@ public Builder setName(java.lang.String value) {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-     * which to execute the request. The format is:
+     * Required. The
+     * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+     * to execute the request. The format is:
      *
      *     projects/[PROJECT_ID_OR_NUMBER]
      *
@@ -908,8 +914,9 @@ public Builder clearName() {
      *
      *
      * 
-     * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-     * which to execute the request. The format is:
+     * Required. The
+     * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+     * to execute the request. The format is:
      *
      *     projects/[PROJECT_ID_OR_NUMBER]
      *
diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsRequestOrBuilder.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsRequestOrBuilder.java
index 7d631f45ec8e..ad10255a7695 100644
--- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsRequestOrBuilder.java
+++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsRequestOrBuilder.java
@@ -27,8 +27,9 @@ public interface ListNotificationChannelsRequestOrBuilder
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-   * which to execute the request. The format is:
+   * Required. The
+   * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+   * to execute the request. The format is:
    *
    *     projects/[PROJECT_ID_OR_NUMBER]
    *
@@ -51,8 +52,9 @@ public interface ListNotificationChannelsRequestOrBuilder
    *
    *
    * 
-   * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
-   * which to execute the request. The format is:
+   * Required. The
+   * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
+   * to execute the request. The format is:
    *
    *     projects/[PROJECT_ID_OR_NUMBER]
    *
diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannel.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannel.java
index 8f06f09adf94..78d138bcf6e1 100644
--- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannel.java
+++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannel.java
@@ -272,7 +272,9 @@ private VerificationStatus(int value) {
    *
    * 
    * The type of the notification channel. This field matches the
-   * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field.
+   * value of the
+   * [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type]
+   * field.
    * 
* * string type = 1; @@ -296,7 +298,9 @@ public java.lang.String getType() { * *
    * The type of the notification channel. This field matches the
-   * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field.
+   * value of the
+   * [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type]
+   * field.
    * 
* * string type = 1; @@ -519,8 +523,8 @@ public int getLabelsCount() { *
    * Configuration fields that define the channel and its behavior. The
    * permissible and required labels are specified in the
-   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-   * `NotificationChannelDescriptor` corresponding to the `type` field.
+   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+   * of the `NotificationChannelDescriptor` corresponding to the `type` field.
    * 
* * map<string, string> labels = 5; @@ -544,8 +548,8 @@ public java.util.Map getLabels() { *
    * Configuration fields that define the channel and its behavior. The
    * permissible and required labels are specified in the
-   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-   * `NotificationChannelDescriptor` corresponding to the `type` field.
+   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+   * of the `NotificationChannelDescriptor` corresponding to the `type` field.
    * 
* * map<string, string> labels = 5; @@ -560,8 +564,8 @@ public java.util.Map getLabelsMap() { *
    * Configuration fields that define the channel and its behavior. The
    * permissible and required labels are specified in the
-   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-   * `NotificationChannelDescriptor` corresponding to the `type` field.
+   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+   * of the `NotificationChannelDescriptor` corresponding to the `type` field.
    * 
* * map<string, string> labels = 5; @@ -583,8 +587,8 @@ public java.util.Map getLabelsMap() { *
    * Configuration fields that define the channel and its behavior. The
    * permissible and required labels are specified in the
-   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-   * `NotificationChannelDescriptor` corresponding to the `type` field.
+   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+   * of the `NotificationChannelDescriptor` corresponding to the `type` field.
    * 
* * map<string, string> labels = 5; @@ -1674,7 +1678,9 @@ public Builder mergeFrom( * *
      * The type of the notification channel. This field matches the
-     * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field.
+     * value of the
+     * [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type]
+     * field.
      * 
* * string type = 1; @@ -1697,7 +1703,9 @@ public java.lang.String getType() { * *
      * The type of the notification channel. This field matches the
-     * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field.
+     * value of the
+     * [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type]
+     * field.
      * 
* * string type = 1; @@ -1720,7 +1728,9 @@ public com.google.protobuf.ByteString getTypeBytes() { * *
      * The type of the notification channel. This field matches the
-     * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field.
+     * value of the
+     * [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type]
+     * field.
      * 
* * string type = 1; @@ -1742,7 +1752,9 @@ public Builder setType(java.lang.String value) { * *
      * The type of the notification channel. This field matches the
-     * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field.
+     * value of the
+     * [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type]
+     * field.
      * 
* * string type = 1; @@ -1760,7 +1772,9 @@ public Builder clearType() { * *
      * The type of the notification channel. This field matches the
-     * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field.
+     * value of the
+     * [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type]
+     * field.
      * 
* * string type = 1; @@ -2173,8 +2187,8 @@ public int getLabelsCount() { *
      * Configuration fields that define the channel and its behavior. The
      * permissible and required labels are specified in the
-     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-     * `NotificationChannelDescriptor` corresponding to the `type` field.
+     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+     * of the `NotificationChannelDescriptor` corresponding to the `type` field.
      * 
* * map<string, string> labels = 5; @@ -2198,8 +2212,8 @@ public java.util.Map getLabels() { *
      * Configuration fields that define the channel and its behavior. The
      * permissible and required labels are specified in the
-     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-     * `NotificationChannelDescriptor` corresponding to the `type` field.
+     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+     * of the `NotificationChannelDescriptor` corresponding to the `type` field.
      * 
* * map<string, string> labels = 5; @@ -2214,8 +2228,8 @@ public java.util.Map getLabelsMap() { *
      * Configuration fields that define the channel and its behavior. The
      * permissible and required labels are specified in the
-     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-     * `NotificationChannelDescriptor` corresponding to the `type` field.
+     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+     * of the `NotificationChannelDescriptor` corresponding to the `type` field.
      * 
* * map<string, string> labels = 5; @@ -2237,8 +2251,8 @@ public java.util.Map getLabelsMap() { *
      * Configuration fields that define the channel and its behavior. The
      * permissible and required labels are specified in the
-     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-     * `NotificationChannelDescriptor` corresponding to the `type` field.
+     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+     * of the `NotificationChannelDescriptor` corresponding to the `type` field.
      * 
* * map<string, string> labels = 5; @@ -2266,8 +2280,8 @@ public Builder clearLabels() { *
      * Configuration fields that define the channel and its behavior. The
      * permissible and required labels are specified in the
-     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-     * `NotificationChannelDescriptor` corresponding to the `type` field.
+     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+     * of the `NotificationChannelDescriptor` corresponding to the `type` field.
      * 
* * map<string, string> labels = 5; @@ -2291,8 +2305,8 @@ public java.util.Map getMutableLabels() { *
      * Configuration fields that define the channel and its behavior. The
      * permissible and required labels are specified in the
-     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-     * `NotificationChannelDescriptor` corresponding to the `type` field.
+     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+     * of the `NotificationChannelDescriptor` corresponding to the `type` field.
      * 
* * map<string, string> labels = 5; @@ -2314,8 +2328,8 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { *
      * Configuration fields that define the channel and its behavior. The
      * permissible and required labels are specified in the
-     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-     * `NotificationChannelDescriptor` corresponding to the `type` field.
+     * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+     * of the `NotificationChannelDescriptor` corresponding to the `type` field.
      * 
* * map<string, string> labels = 5; diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelOrBuilder.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelOrBuilder.java index 4190e8dfff15..8cf3c972e4c1 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelOrBuilder.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelOrBuilder.java @@ -28,7 +28,9 @@ public interface NotificationChannelOrBuilder * *
    * The type of the notification channel. This field matches the
-   * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field.
+   * value of the
+   * [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type]
+   * field.
    * 
* * string type = 1; @@ -41,7 +43,9 @@ public interface NotificationChannelOrBuilder * *
    * The type of the notification channel. This field matches the
-   * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field.
+   * value of the
+   * [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type]
+   * field.
    * 
* * string type = 1; @@ -149,8 +153,8 @@ public interface NotificationChannelOrBuilder *
    * Configuration fields that define the channel and its behavior. The
    * permissible and required labels are specified in the
-   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-   * `NotificationChannelDescriptor` corresponding to the `type` field.
+   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+   * of the `NotificationChannelDescriptor` corresponding to the `type` field.
    * 
* * map<string, string> labels = 5; @@ -162,8 +166,8 @@ public interface NotificationChannelOrBuilder *
    * Configuration fields that define the channel and its behavior. The
    * permissible and required labels are specified in the
-   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-   * `NotificationChannelDescriptor` corresponding to the `type` field.
+   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+   * of the `NotificationChannelDescriptor` corresponding to the `type` field.
    * 
* * map<string, string> labels = 5; @@ -178,8 +182,8 @@ public interface NotificationChannelOrBuilder *
    * Configuration fields that define the channel and its behavior. The
    * permissible and required labels are specified in the
-   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-   * `NotificationChannelDescriptor` corresponding to the `type` field.
+   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+   * of the `NotificationChannelDescriptor` corresponding to the `type` field.
    * 
* * map<string, string> labels = 5; @@ -191,8 +195,8 @@ public interface NotificationChannelOrBuilder *
    * Configuration fields that define the channel and its behavior. The
    * permissible and required labels are specified in the
-   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-   * `NotificationChannelDescriptor` corresponding to the `type` field.
+   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+   * of the `NotificationChannelDescriptor` corresponding to the `type` field.
    * 
* * map<string, string> labels = 5; @@ -208,8 +212,8 @@ java.lang.String getLabelsOrDefault( *
    * Configuration fields that define the channel and its behavior. The
    * permissible and required labels are specified in the
-   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the
-   * `NotificationChannelDescriptor` corresponding to the `type` field.
+   * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels]
+   * of the `NotificationChannelDescriptor` corresponding to the `type` field.
    * 
* * map<string, string> labels = 5; diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Snooze.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Snooze.java index 871e709565a3..dccf5d1c32ae 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Snooze.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Snooze.java @@ -79,7 +79,7 @@ public interface CriteriaOrBuilder * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -97,7 +97,7 @@ public interface CriteriaOrBuilder * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -115,7 +115,7 @@ public interface CriteriaOrBuilder * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -134,7 +134,7 @@ public interface CriteriaOrBuilder * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -205,7 +205,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -225,7 +225,7 @@ public com.google.protobuf.ProtocolStringList getPoliciesList() { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -245,7 +245,7 @@ public int getPoliciesCount() { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -266,7 +266,7 @@ public java.lang.String getPolicies(int index) { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -658,7 +658,7 @@ private void ensurePoliciesIsMutable() { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -679,7 +679,7 @@ public com.google.protobuf.ProtocolStringList getPoliciesList() { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -699,7 +699,7 @@ public int getPoliciesCount() { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -720,7 +720,7 @@ public java.lang.String getPolicies(int index) { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -741,7 +741,7 @@ public com.google.protobuf.ByteString getPoliciesBytes(int index) { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -770,7 +770,7 @@ public Builder setPolicies(int index, java.lang.String value) { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -798,7 +798,7 @@ public Builder addPolicies(java.lang.String value) { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -823,7 +823,7 @@ public Builder addAllPolicies(java.lang.Iterable values) { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* @@ -847,7 +847,7 @@ public Builder clearPolicies() { * * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] * - * There is a limit of 10 policies per snooze. This limit is checked during + * There is a limit of 16 policies per snooze. This limit is checked during * snooze creation. *
* diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto index f0a54b9cc314..b746a5e47d52 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ option ruby_package = "Google::Cloud::Monitoring::V3"; // considered to be "unhealthy" and the ways to notify people or services about // this state. For an overview of alert policies, see // [Introduction to Alerting](https://cloud.google.com/monitoring/alerts/). +// message AlertPolicy { option (google.api.resource) = { type: "monitoring.googleapis.com/AlertPolicy" @@ -48,7 +49,7 @@ message AlertPolicy { // A content string and a MIME type that describes the content string's // format. message Documentation { - // The text of the documentation, interpreted according to `mime_type`. + // The body of the documentation, interpreted according to `mime_type`. // The content may not exceed 8,192 Unicode characters and may not exceed // more than 10,240 bytes when encoded in UTF-8 format, whichever is // smaller. This text can be [templatized by using @@ -59,6 +60,21 @@ message AlertPolicy { // `"text/markdown"` is supported. See // [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. string mime_type = 2; + + // Optional. The subject line of the notification. The subject line may not + // exceed 10,240 bytes. In notifications generated by this policy, the + // contents of the subject line after variable expansion will be truncated + // to 255 bytes or shorter at the latest UTF-8 character boundary. The + // 255-byte limit is recommended by [this + // thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). + // It is both the limit imposed by some third-party ticketing products and + // it is common to define textual fields in databases as VARCHAR(255). + // + // The contents of the subject line can be [templatized by using + // variables](https://cloud.google.com/monitoring/alerts/doc-variables). + // If this field is missing or empty, a default subject line will be + // generated. + string subject = 3 [(google.api.field_behavior) = OPTIONAL]; } // A condition is a true/false test that determines when an alerting policy @@ -111,7 +127,20 @@ message AlertPolicy { // A condition type that compares a collection of time series // against a threshold. message MetricThreshold { - // Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + // Options used when forecasting the time series and testing + // the predicted value against the threshold. + message ForecastOptions { + // Required. The length of time into the future to forecast whether a + // time series will violate the threshold. If the predicted value is + // found to violate the threshold, and the violation is observed in all + // forecasts made for the configured `duration`, then the time series is + // considered to be failing. + google.protobuf.Duration forecast_horizon = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // Required. A + // [filter](https://cloud.google.com/monitoring/api/v3/filters) that // identifies which time series should be compared with the threshold. // // The filter is similar to the one that is specified in the @@ -159,6 +188,13 @@ message AlertPolicy { // and produce time series that have the same periodicity and labels. repeated Aggregation denominator_aggregations = 10; + // When this field is present, the `MetricThreshold` condition forecasts + // whether the time series is predicted to violate the threshold within + // the `forecast_horizon`. When this field is not set, the + // `MetricThreshold` tests the current value of the timeseries against the + // threshold. + ForecastOptions forecast_options = 12; + // The comparison to apply between the time series (indicated by `filter` // and `aggregation`) and the threshold (indicated by `threshold_value`). // The comparison is applied on each time series, with the time series @@ -201,7 +237,8 @@ message AlertPolicy { // when a time series for the specified metric of a monitored // resource does not include any data in the specified `duration`. message MetricAbsence { - // Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + // Required. A + // [filter](https://cloud.google.com/monitoring/api/v3/filters) that // identifies which time series should be compared with the threshold. // // The filter is similar to the one that is specified in the @@ -298,6 +335,100 @@ message AlertPolicy { EvaluationMissingData evaluation_missing_data = 4; } + // A condition type that allows alert policies to be defined using + // [Prometheus Query Language + // (PromQL)](https://prometheus.io/docs/prometheus/latest/querying/basics/). + // + // The PrometheusQueryLanguageCondition message contains information + // from a Prometheus alerting rule and its associated rule group. + // + // A Prometheus alerting rule is described + // [here](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/). + // The semantics of a Prometheus alerting rule is described + // [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule). + // + // A Prometheus rule group is described + // [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/). + // The semantics of a Prometheus rule group is described + // [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule_group). + // + // Because Cloud Alerting has no representation of a Prometheus rule + // group resource, we must embed the information of the parent rule + // group inside each of the conditions that refer to it. We must also + // update the contents of all Prometheus alerts in case the information + // of their rule group changes. + // + // The PrometheusQueryLanguageCondition protocol buffer combines the + // information of the corresponding rule group and alerting rule. + // The structure of the PrometheusQueryLanguageCondition protocol buffer + // does NOT mimic the structure of the Prometheus rule group and alerting + // rule YAML declarations. The PrometheusQueryLanguageCondition protocol + // buffer may change in the future to support future rule group and/or + // alerting rule features. There are no new such features at the present + // time (2023-06-26). + message PrometheusQueryLanguageCondition { + // Required. The PromQL expression to evaluate. Every evaluation cycle + // this expression is evaluated at the current time, and all resultant + // time series become pending/firing alerts. This field must not be empty. + string query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Alerts are considered firing once their PromQL expression was + // evaluated to be "true" for this long. + // Alerts whose PromQL expression was not evaluated to be "true" for + // long enough are considered pending. + // Must be a non-negative duration or missing. + // This field is optional. Its default value is zero. + google.protobuf.Duration duration = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. How often this rule should be evaluated. + // Must be a positive multiple of 30 seconds or missing. + // This field is optional. Its default value is 30 seconds. + // If this PrometheusQueryLanguageCondition was generated from a + // Prometheus alerting rule, then this value should be taken from the + // enclosing rule group. + google.protobuf.Duration evaluation_interval = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Labels to add to or overwrite in the PromQL query result. + // Label names [must be + // valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + // Label values can be [templatized by using + // variables](https://cloud.google.com/monitoring/alerts/doc-variables). + // The only available variable names are the names of the labels in the + // PromQL result, including "__name__" and "value". "labels" may be empty. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The rule group name of this alert in the corresponding + // Prometheus configuration file. + // + // Some external tools may require this field to be populated correctly + // in order to refer to the original Prometheus configuration file. + // The rule group name and the alert name are necessary to update the + // relevant AlertPolicies in case the definition of the rule group changes + // in the future. + // + // This field is optional. If this field is not empty, then it must + // contain a valid UTF-8 string. + // This field may not exceed 2048 Unicode characters in length. + string rule_group = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The alerting rule name of this alert in the corresponding + // Prometheus configuration file. + // + // Some external tools may require this field to be populated correctly + // in order to refer to the original Prometheus configuration file. + // The rule group name and the alert name are necessary to update the + // relevant AlertPolicies in case the definition of the rule group changes + // in the future. + // + // This field is optional. If this field is not empty, then it must be a + // [valid Prometheus label + // name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + // This field may not exceed 2048 Unicode characters in length. + string alert_rule = 6 [(google.api.field_behavior) = OPTIONAL]; + } + // Required if the condition exists. The unique resource name for this // condition. Its format is: // @@ -346,6 +477,9 @@ message AlertPolicy { // A condition that uses the Monitoring Query Language to define // alerts. MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + + // A condition that uses the Prometheus query language to define alerts. + PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; } } @@ -380,6 +514,23 @@ message AlertPolicy { google.protobuf.Duration period = 1; } + // Control over how the notification channels in `notification_channels` + // are notified when this alert fires, on a per-channel basis. + message NotificationChannelStrategy { + // The full REST resource name for the notification channels that these + // settings apply to. Each of these correspond to the name field in one + // of the NotificationChannel objects referenced in the + // notification_channels field of this AlertPolicy. + // The format is: + // + // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + repeated string notification_channel_names = 1; + + // The frequency at which to send reminder notifications for open + // incidents. + google.protobuf.Duration renotify_interval = 2; + } + // Required for alert policies with a `LogMatch` condition. // // This limit is not implemented for alert policies that are not log-based. @@ -388,6 +539,9 @@ message AlertPolicy { // If an alert policy that was active has no data for this long, any open // incidents will close google.protobuf.Duration auto_close = 3; + + // Control how notifications will be sent out, on a per-channel basis. + repeated NotificationChannelStrategy notification_channel_strategy = 4; } // Required if the policy exists. The resource name for this policy. The @@ -406,6 +560,12 @@ message AlertPolicy { // notifications, and incidents. To avoid confusion, don't use the same // display name for multiple policies in the same project. The name is // limited to 512 Unicode characters. + // + // The convention for the display_name of a PrometheusQueryLanguageCondition + // is "{rule group name}/{alert name}", where the {rule group name} and + // {alert name} should be taken from the corresponding Prometheus + // configuration file. This convention is not enforced. + // In any case the display_name is not a unique key of the AlertPolicy. string display_name = 2; // Documentation that is included with notifications and incidents related to @@ -422,6 +582,13 @@ message AlertPolicy { // 63 Unicode characters or 128 bytes, whichever is smaller. Labels and // values can contain only lowercase letters, numerals, underscores, and // dashes. Keys must begin with a letter. + // + // Note that Prometheus {alert name} is a + // [valid Prometheus label + // names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + // whereas Prometheus {rule group} is an unrestricted UTF-8 string. + // This means that they cannot be stored as-is in user labels, because + // they may contain characters that are not allowed in user-label values. map user_labels = 16; // A list of conditions for the policy. The conditions are combined by AND or @@ -430,6 +597,8 @@ message AlertPolicy { // conditions. // If `condition_time_series_query_language` is present, it must be the only // `condition`. + // If `condition_monitoring_query_language` is present, it must be the only + // `condition`. repeated Condition conditions = 12; // How to combine the results of multiple conditions to determine if an @@ -445,8 +614,9 @@ message AlertPolicy { // a field projection has been specified that strips it out. google.protobuf.BoolValue enabled = 17; - // Read-only description of how the alert policy is invalid. OK if the alert - // policy is valid. If not OK, the alert policy will not generate incidents. + // Read-only description of how the alert policy is invalid. This field is + // only set when the alert policy is invalid. An invalid alert policy will not + // generate incidents. google.rpc.Status validity = 18; // Identifies the notification channels to which notifications should be sent diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert_service.proto b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert_service.proto index 5d8d81854cf3..d93ad0bada41 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert_service.proto +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert_service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -49,7 +49,8 @@ service AlertPolicyService { "https://www.googleapis.com/auth/monitoring.read"; // Lists the existing alerting policies for the workspace. - rpc ListAlertPolicies(ListAlertPoliciesRequest) returns (ListAlertPoliciesResponse) { + rpc ListAlertPolicies(ListAlertPoliciesRequest) + returns (ListAlertPoliciesResponse) { option (google.api.http) = { get: "/v3/{name=projects/*}/alertPolicies" }; @@ -65,6 +66,10 @@ service AlertPolicyService { } // Creates a new alerting policy. + // + // 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. rpc CreateAlertPolicy(CreateAlertPolicyRequest) returns (AlertPolicy) { option (google.api.http) = { post: "/v3/{name=projects/*}/alertPolicies" @@ -74,7 +79,12 @@ service AlertPolicyService { } // Deletes an alerting policy. - rpc DeleteAlertPolicy(DeleteAlertPolicyRequest) returns (google.protobuf.Empty) { + // + // 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. + rpc DeleteAlertPolicy(DeleteAlertPolicyRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v3/{name=projects/*/alertPolicies/*}" }; @@ -85,6 +95,10 @@ service AlertPolicyService { // 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. + // + // 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. rpc UpdateAlertPolicy(UpdateAlertPolicyRequest) returns (AlertPolicy) { option (google.api.http) = { patch: "/v3/{alert_policy.name=projects/*/alertPolicies/*}" @@ -96,8 +110,9 @@ service AlertPolicyService { // The protocol for the `CreateAlertPolicy` request. message CreateAlertPolicyRequest { - // Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - // which to create the alerting policy. The format is: + // 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] // @@ -115,9 +130,9 @@ message CreateAlertPolicyRequest { } ]; - // 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. + // 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. AlertPolicy alert_policy = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -136,8 +151,9 @@ message GetAlertPolicyRequest { // The protocol for the `ListAlertPolicies` request. message ListAlertPoliciesRequest { - // Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) - // whose alert policies are to be listed. The format is: + // 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] // diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification.proto b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification.proto index cbd287527efe..67df55bada2a 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification.proto +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -118,7 +118,9 @@ message NotificationChannel { } // The type of the notification channel. This field matches the - // value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field. + // value of the + // [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] + // field. string type = 1; // The full REST resource name for this channel. The format is: @@ -141,8 +143,8 @@ message NotificationChannel { // Configuration fields that define the channel and its behavior. The // permissible and required labels are specified in the - // [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the - // `NotificationChannelDescriptor` corresponding to the `type` field. + // [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] + // of the `NotificationChannelDescriptor` corresponding to the `type` field. map labels = 5; // User-supplied key/value data that does not need to conform to diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification_service.proto b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification_service.proto index a27404321dfd..8b14dcf41bb6 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification_service.proto +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification_service.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -44,7 +44,9 @@ service NotificationChannelService { // Lists the descriptors for supported channel types. The use of descriptors // makes it possible for new channel types to be dynamically added. - rpc ListNotificationChannelDescriptors(ListNotificationChannelDescriptorsRequest) returns (ListNotificationChannelDescriptorsResponse) { + rpc ListNotificationChannelDescriptors( + ListNotificationChannelDescriptorsRequest) + returns (ListNotificationChannelDescriptorsResponse) { option (google.api.http) = { get: "/v3/{name=projects/*}/notificationChannelDescriptors" }; @@ -53,7 +55,8 @@ service NotificationChannelService { // Gets a single channel descriptor. The descriptor indicates which fields // are expected / permitted for a notification channel of the given type. - rpc GetNotificationChannelDescriptor(GetNotificationChannelDescriptorRequest) returns (NotificationChannelDescriptor) { + rpc GetNotificationChannelDescriptor(GetNotificationChannelDescriptorRequest) + returns (NotificationChannelDescriptor) { option (google.api.http) = { get: "/v3/{name=projects/*/notificationChannelDescriptors/*}" }; @@ -61,7 +64,10 @@ service NotificationChannelService { } // Lists the notification channels that have been created for the project. - rpc ListNotificationChannels(ListNotificationChannelsRequest) returns (ListNotificationChannelsResponse) { + // To list the types of notification channels that are supported, use + // the `ListNotificationChannelDescriptors` method. + rpc ListNotificationChannels(ListNotificationChannelsRequest) + returns (ListNotificationChannelsResponse) { option (google.api.http) = { get: "/v3/{name=projects/*}/notificationChannels" }; @@ -73,7 +79,8 @@ service NotificationChannelService { // response may truncate or omit passwords, API keys, or other private key // matter and thus the response may not be 100% identical to the information // that was supplied in the call to the create method. - rpc GetNotificationChannel(GetNotificationChannelRequest) returns (NotificationChannel) { + rpc GetNotificationChannel(GetNotificationChannelRequest) + returns (NotificationChannel) { option (google.api.http) = { get: "/v3/{name=projects/*/notificationChannels/*}" }; @@ -82,7 +89,13 @@ service NotificationChannelService { // Creates a new notification channel, representing a single notification // endpoint such as an email address, SMS number, or PagerDuty service. - rpc CreateNotificationChannel(CreateNotificationChannelRequest) returns (NotificationChannel) { + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + rpc CreateNotificationChannel(CreateNotificationChannelRequest) + returns (NotificationChannel) { option (google.api.http) = { post: "/v3/{name=projects/*}/notificationChannels" body: "notification_channel" @@ -92,7 +105,13 @@ service NotificationChannelService { // Updates a notification channel. Fields not specified in the field mask // remain unchanged. - rpc UpdateNotificationChannel(UpdateNotificationChannelRequest) returns (NotificationChannel) { + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + rpc UpdateNotificationChannel(UpdateNotificationChannelRequest) + returns (NotificationChannel) { option (google.api.http) = { patch: "/v3/{notification_channel.name=projects/*/notificationChannels/*}" body: "notification_channel" @@ -101,7 +120,13 @@ service NotificationChannelService { } // Deletes a notification channel. - rpc DeleteNotificationChannel(DeleteNotificationChannelRequest) returns (google.protobuf.Empty) { + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + rpc DeleteNotificationChannel(DeleteNotificationChannelRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v3/{name=projects/*/notificationChannels/*}" }; @@ -110,7 +135,9 @@ service NotificationChannelService { // Causes a verification code to be delivered to the channel. The code // can then be supplied in `VerifyNotificationChannel` to verify the channel. - rpc SendNotificationChannelVerificationCode(SendNotificationChannelVerificationCodeRequest) returns (google.protobuf.Empty) { + rpc SendNotificationChannelVerificationCode( + SendNotificationChannelVerificationCodeRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { post: "/v3/{name=projects/*/notificationChannels/*}:sendVerificationCode" body: "*" @@ -139,7 +166,9 @@ service NotificationChannelService { // have a shorter expiration (e.g. codes such as "G-123456") whereas // GetVerificationCode() will typically return a much longer, websafe base // 64 encoded string that has a longer expiration time. - rpc GetNotificationChannelVerificationCode(GetNotificationChannelVerificationCodeRequest) returns (GetNotificationChannelVerificationCodeResponse) { + rpc GetNotificationChannelVerificationCode( + GetNotificationChannelVerificationCodeRequest) + returns (GetNotificationChannelVerificationCodeResponse) { option (google.api.http) = { post: "/v3/{name=projects/*/notificationChannels/*}:getVerificationCode" body: "*" @@ -150,7 +179,8 @@ service NotificationChannelService { // Verifies a `NotificationChannel` by proving receipt of the code // delivered to the channel as a result of calling // `SendNotificationChannelVerificationCode`. - rpc VerifyNotificationChannel(VerifyNotificationChannelRequest) returns (NotificationChannel) { + rpc VerifyNotificationChannel(VerifyNotificationChannelRequest) + returns (NotificationChannel) { option (google.api.http) = { post: "/v3/{name=projects/*/notificationChannels/*}:verify" body: "*" @@ -218,8 +248,9 @@ message GetNotificationChannelDescriptorRequest { // The `CreateNotificationChannel` request. message CreateNotificationChannelRequest { - // Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - // which to execute the request. The format is: + // Required. The + // [project](https://cloud.google.com/monitoring/api/v3#project_name) on which + // to execute the request. The format is: // // projects/[PROJECT_ID_OR_NUMBER] // @@ -235,13 +266,15 @@ message CreateNotificationChannelRequest { ]; // Required. The definition of the `NotificationChannel` to create. - NotificationChannel notification_channel = 2 [(google.api.field_behavior) = REQUIRED]; + NotificationChannel notification_channel = 2 + [(google.api.field_behavior) = REQUIRED]; } // The `ListNotificationChannels` request. message ListNotificationChannelsRequest { - // Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - // which to execute the request. The format is: + // Required. The + // [project](https://cloud.google.com/monitoring/api/v3#project_name) on which + // to execute the request. The format is: // // projects/[PROJECT_ID_OR_NUMBER] // @@ -322,7 +355,8 @@ message UpdateNotificationChannelRequest { // notification channel. The description must provide a definition for // fields to be updated; the names of these fields should also be // included in the `update_mask`. - NotificationChannel notification_channel = 3 [(google.api.field_behavior) = REQUIRED]; + NotificationChannel notification_channel = 3 + [(google.api.field_behavior) = REQUIRED]; } // The `DeleteNotificationChannel` request. @@ -357,9 +391,9 @@ message SendNotificationChannelVerificationCodeRequest { // The `GetNotificationChannelVerificationCode` request. message GetNotificationChannelVerificationCodeRequest { - // Required. The notification channel for which a verification code is to be generated - // and retrieved. This must name a channel that is already verified; if - // the specified channel is not verified, the request will fail. + // Required. The notification channel for which a verification code is to be + // generated and retrieved. This must name a channel that is already verified; + // if the specified channel is not verified, the request will fail. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/snooze.proto b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/snooze.proto index cbaa49bb4f62..f20e1a0bd84f 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/snooze.proto +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/snooze.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ message Snooze { // // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] // - // There is a limit of 10 policies per snooze. This limit is checked during + // There is a limit of 16 policies per snooze. This limit is checked during // snooze creation. repeated string policies = 1 [(google.api.resource_reference) = { type: "monitoring.googleapis.com/AlertPolicy" diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/snooze_service.proto b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/snooze_service.proto index 622f7cd1491b..286551a5a611 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/snooze_service.proto +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/snooze_service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.