From 8a42810e2f0786de716b123e1091b6a1dd7d1e45 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 29 Mar 2021 13:00:03 -0700 Subject: [PATCH] feat: Added support for secondary aggregation when querying metrics (#471) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b9dd8574-10ed-4799-8623-fde41a50803e/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) PiperOrigin-RevId: 364422694 Source-Link: https://github.com/googleapis/googleapis/commit/2124b6251e56e2ec8dd5c47e7d3815d7d5841880 feat: Added support for Monitoring Query Language: https://cloud.google.com/monitoring/mql feat: Added support for units in the MetricService feat: Added total_size to the response of ListAlertPolicies fix: Un-deprecated cluster_istio for service monitoring feat: Added IstioCanonicalService for service monitoring feat: Added creation and mutation records to notification channels feat: Added support for querying metrics for folders and organizations fix: Extended the default deadline for UpdateGroup to 180s --- .../v3/AlertPolicyServiceClient.java | 46 +- .../monitoring/v3/MetricServiceClient.java | 120 +- .../monitoring/v3/QueryServiceClient.java | 366 +++ .../monitoring/v3/QueryServiceSettings.java | 190 ++ .../cloud/monitoring/v3/gapic_metadata.json | 14 +- .../cloud/monitoring/v3/package-info.java | 23 + .../stub/GrpcQueryServiceCallableFactory.java | 113 + .../v3/stub/GrpcQueryServiceStub.java | 175 ++ .../monitoring/v3/stub/QueryServiceStub.java | 47 + .../v3/stub/QueryServiceStubSettings.java | 335 +++ .../v3/MetricServiceClientTest.java | 114 +- .../cloud/monitoring/v3/MockQueryService.java | 59 + .../monitoring/v3/MockQueryServiceImpl.java | 83 + .../NotificationChannelServiceClientTest.java | 19 + .../monitoring/v3/QueryServiceClientTest.java | 142 + .../monitoring/v3/AlertPolicyServiceGrpc.java | 8 +- .../monitoring/v3/QueryServiceGrpc.java | 371 +++ .../com/google/monitoring/v3/Aggregation.java | 120 +- .../monitoring/v3/AggregationOrBuilder.java | 30 +- .../com/google/monitoring/v3/AlertPolicy.java | 2400 +++++++++++++++-- .../com/google/monitoring/v3/AlertProto.java | 162 +- .../monitoring/v3/AlertServiceProto.java | 86 +- .../v3/CreateAlertPolicyRequest.java | 63 +- .../v3/CreateAlertPolicyRequestOrBuilder.java | 18 +- .../google/monitoring/v3/DroppedLabels.java | 38 +- .../v3/ListAlertPoliciesResponse.java | 94 + .../ListAlertPoliciesResponseOrBuilder.java | 14 + .../v3/ListNotificationChannelsResponse.java | 94 + ...NotificationChannelsResponseOrBuilder.java | 14 + .../monitoring/v3/ListServicesRequest.java | 112 +- .../v3/ListServicesRequestOrBuilder.java | 32 +- .../monitoring/v3/ListTimeSeriesRequest.java | 326 ++- .../v3/ListTimeSeriesRequestOrBuilder.java | 48 +- .../monitoring/v3/ListTimeSeriesResponse.java | 214 ++ .../v3/ListTimeSeriesResponseOrBuilder.java | 35 + .../com/google/monitoring/v3/MetricProto.java | 73 +- .../monitoring/v3/MetricServiceProto.java | 212 +- .../monitoring/v3/NotificationChannel.java | 774 +++++- .../v3/NotificationChannelDescriptor.java | 35 +- ...otificationChannelDescriptorOrBuilder.java | 10 +- .../v3/NotificationChannelOrBuilder.java | 87 + .../monitoring/v3/NotificationProto.java | 92 +- .../v3/NotificationServiceProto.java | 183 +- .../monitoring/v3/QueryServiceProto.java | 84 + .../monitoring/v3/QueryTimeSeriesRequest.java | 35 +- .../v3/QueryTimeSeriesRequestOrBuilder.java | 10 +- .../com/google/monitoring/v3/Service.java | 1731 +++++++++++- .../monitoring/v3/ServiceMonitoringProto.java | 199 +- .../monitoring/v3/ServiceOrBuilder.java | 51 +- .../google/monitoring/v3/TimeInterval.java | 70 +- .../com/google/monitoring/v3/TimeSeries.java | 241 +- .../monitoring/v3/TimeSeriesDescriptor.java | 235 +- .../google/monitoring/v3/TimeSeriesName.java | 378 +++ .../monitoring/v3/TimeSeriesOrBuilder.java | 41 +- .../monitoring/v3/UptimeCheckConfig.java | 207 +- .../v3/UptimeCheckConfigOrBuilder.java | 4 + .../proto/google/monitoring/v3/alert.proto | 62 +- .../google/monitoring/v3/alert_service.proto | 17 +- .../proto/google/monitoring/v3/common.proto | 49 +- .../google/monitoring/v3/dropped_labels.proto | 21 +- .../proto/google/monitoring/v3/group.proto | 2 +- .../google/monitoring/v3/group_service.proto | 2 +- .../proto/google/monitoring/v3/metric.proto | 19 +- .../google/monitoring/v3/metric_service.proto | 43 +- .../monitoring/v3/mutation_record.proto | 2 +- .../google/monitoring/v3/notification.proto | 14 +- .../monitoring/v3/notification_service.proto | 6 +- .../google/monitoring/v3/query_service.proto | 50 + .../proto/google/monitoring/v3/service.proto | 39 +- .../monitoring/v3/service_service.proto | 18 +- .../google/monitoring/v3/span_context.proto | 2 +- .../proto/google/monitoring/v3/uptime.proto | 81 +- .../google/monitoring/v3/uptime_service.proto | 2 +- synth.metadata | 17 +- 74 files changed, 10035 insertions(+), 1288 deletions(-) create mode 100644 google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/QueryServiceClient.java create mode 100644 google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/QueryServiceSettings.java create mode 100644 google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcQueryServiceCallableFactory.java create mode 100644 google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcQueryServiceStub.java create mode 100644 google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/QueryServiceStub.java create mode 100644 google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/QueryServiceStubSettings.java create mode 100644 google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockQueryService.java create mode 100644 google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockQueryServiceImpl.java create mode 100644 google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/QueryServiceClientTest.java create mode 100644 grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryServiceGrpc.java create mode 100644 proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryServiceProto.java create mode 100644 proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesName.java create mode 100644 proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/query_service.proto diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java index 76447c33..b0d9217d 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java @@ -171,7 +171,7 @@ public AlertPolicyServiceStub getStub() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the existing alerting policies for the project. + * Lists the existing alerting policies for the workspace. * *

Sample code: * @@ -202,7 +202,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ResourceName name) // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the existing alerting policies for the project. + * Lists the existing alerting policies for the workspace. * *

Sample code: * @@ -233,7 +233,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(OrganizationName n // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the existing alerting policies for the project. + * Lists the existing alerting policies for the workspace. * *

Sample code: * @@ -264,7 +264,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ProjectName name) // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the existing alerting policies for the project. + * Lists the existing alerting policies for the workspace. * *

Sample code: * @@ -293,7 +293,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(String name) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the existing alerting policies for the project. + * Lists the existing alerting policies for the workspace. * *

Sample code: * @@ -324,7 +324,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ListAlertPoliciesR // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the existing alerting policies for the project. + * Lists the existing alerting policies for the workspace. * *

Sample code: * @@ -356,7 +356,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ListAlertPoliciesR // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the existing alerting policies for the project. + * Lists the existing alerting policies for the workspace. * *

Sample code: * @@ -507,9 +507,11 @@ public final UnaryCallable getAlertPolicyCal * @param name Required. The project in which to create the alerting policy. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policy will be - * written, not the name of the created policy. The alerting policy that is returned will have - * a name that contains a normalized representation of this name as a prefix but adds a suffix - * of the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the container. + * written, not the name of the created policy. |name| must be a host project of a workspace, + * otherwise INVALID_ARGUMENT error will return. The alerting policy that is returned will + * have a name that contains a normalized representation of this name as a prefix but adds a + * suffix of the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * container. * @param alertPolicy 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. @@ -541,9 +543,11 @@ public final AlertPolicy createAlertPolicy(ResourceName name, AlertPolicy alertP * @param name Required. The project in which to create the alerting policy. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policy will be - * written, not the name of the created policy. The alerting policy that is returned will have - * a name that contains a normalized representation of this name as a prefix but adds a suffix - * of the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the container. + * written, not the name of the created policy. |name| must be a host project of a workspace, + * otherwise INVALID_ARGUMENT error will return. The alerting policy that is returned will + * have a name that contains a normalized representation of this name as a prefix but adds a + * suffix of the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * container. * @param alertPolicy 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. @@ -575,9 +579,11 @@ public final AlertPolicy createAlertPolicy(OrganizationName name, AlertPolicy al * @param name Required. The project in which to create the alerting policy. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policy will be - * written, not the name of the created policy. The alerting policy that is returned will have - * a name that contains a normalized representation of this name as a prefix but adds a suffix - * of the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the container. + * written, not the name of the created policy. |name| must be a host project of a workspace, + * otherwise INVALID_ARGUMENT error will return. The alerting policy that is returned will + * have a name that contains a normalized representation of this name as a prefix but adds a + * suffix of the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * container. * @param alertPolicy 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. @@ -610,9 +616,11 @@ public final AlertPolicy createAlertPolicy(ProjectName name, AlertPolicy alertPo * @param name Required. The project in which to create the alerting policy. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policy will be - * written, not the name of the created policy. The alerting policy that is returned will have - * a name that contains a normalized representation of this name as a prefix but adds a suffix - * of the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the container. + * written, not the name of the created policy. |name| must be a host project of a workspace, + * otherwise INVALID_ARGUMENT error will return. The alerting policy that is returned will + * have a name that contains a normalized representation of this name as a prefix but adds a + * suffix of the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * container. * @param alertPolicy 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/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java index 1969a974..e01a0052 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java @@ -1136,6 +1136,102 @@ public final void deleteMetricDescriptor(DeleteMetricDescriptorRequest request) return stub.deleteMetricDescriptorCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists time series that match a filter. This method does not require a Workspace. + * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ResourceName name = ResourceName.of("[FOLDER]");
+   *   String filter = "filter-1274492040";
+   *   TimeInterval interval = TimeInterval.newBuilder().build();
+   *   ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0);
+   *   for (TimeSeries element :
+   *       metricServiceClient.listTimeSeries(name, filter, interval, view).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param name Required. The project, organization or folder on which to execute the request. The + * format is: + *

projects/[PROJECT_ID_OR_NUMBER] organizations/[ORGANIZATION_ID] folders/[FOLDER_ID] + * @param filter Required. A [monitoring + * filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time + * series should be returned. The filter must specify a single metric type, and can + * additionally specify metric labels and other information. For example: + *

metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + * metric.labels.instance_name = "my-instance-name" + * @param interval Required. The time interval for which results should be returned. Only time + * series that contain data points in the specified interval are included in the response. + * @param view Required. Specifies which information is returned about the time series. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTimeSeriesPagedResponse listTimeSeries( + ResourceName name, + String filter, + TimeInterval interval, + ListTimeSeriesRequest.TimeSeriesView view) { + ListTimeSeriesRequest request = + ListTimeSeriesRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setFilter(filter) + .setInterval(interval) + .setView(view) + .build(); + return listTimeSeries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists time series that match a filter. This method does not require a Workspace. + * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   String filter = "filter-1274492040";
+   *   TimeInterval interval = TimeInterval.newBuilder().build();
+   *   ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0);
+   *   for (TimeSeries element :
+   *       metricServiceClient.listTimeSeries(name, filter, interval, view).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param name Required. The project, organization or folder on which to execute the request. The + * format is: + *

projects/[PROJECT_ID_OR_NUMBER] organizations/[ORGANIZATION_ID] folders/[FOLDER_ID] + * @param filter Required. A [monitoring + * filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time + * series should be returned. The filter must specify a single metric type, and can + * additionally specify metric labels and other information. For example: + *

metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + * metric.labels.instance_name = "my-instance-name" + * @param interval Required. The time interval for which results should be returned. Only time + * series that contain data points in the specified interval are included in the response. + * @param view Required. Specifies which information is returned about the time series. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTimeSeriesPagedResponse listTimeSeries( + OrganizationName name, + String filter, + TimeInterval interval, + ListTimeSeriesRequest.TimeSeriesView view) { + ListTimeSeriesRequest request = + ListTimeSeriesRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setFilter(filter) + .setInterval(interval) + .setView(view) + .build(); + return listTimeSeries(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists time series that match a filter. This method does not require a Workspace. @@ -1155,8 +1251,9 @@ public final void deleteMetricDescriptor(DeleteMetricDescriptorRequest request) * } * } * - * @param name Required. The project on which to execute the request. The format is: - *

projects/[PROJECT_ID_OR_NUMBER] + * @param name Required. The project, organization or folder on which to execute the request. The + * format is: + *

projects/[PROJECT_ID_OR_NUMBER] organizations/[ORGANIZATION_ID] folders/[FOLDER_ID] * @param filter Required. A [monitoring * filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time * series should be returned. The filter must specify a single metric type, and can @@ -1191,7 +1288,7 @@ public final ListTimeSeriesPagedResponse listTimeSeries( * *

{@code
    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   String name = ProjectName.of("[PROJECT]").toString();
+   *   String name = TimeSeriesName.ofProjectTimeSeriesName("[PROJECT]", "[TIME_SERIES]").toString();
    *   String filter = "filter-1274492040";
    *   TimeInterval interval = TimeInterval.newBuilder().build();
    *   ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0);
@@ -1202,8 +1299,9 @@ public final ListTimeSeriesPagedResponse listTimeSeries(
    * }
    * }
* - * @param name Required. The project on which to execute the request. The format is: - *

projects/[PROJECT_ID_OR_NUMBER] + * @param name Required. The project, organization or folder on which to execute the request. The + * format is: + *

projects/[PROJECT_ID_OR_NUMBER] organizations/[ORGANIZATION_ID] folders/[FOLDER_ID] * @param filter Required. A [monitoring * filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time * series should be returned. The filter must specify a single metric type, and can @@ -1240,10 +1338,12 @@ public final ListTimeSeriesPagedResponse listTimeSeries( * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * ListTimeSeriesRequest request = * ListTimeSeriesRequest.newBuilder() - * .setName(ProjectName.of("[PROJECT]").toString()) + * .setName( + * TimeSeriesName.ofProjectTimeSeriesName("[PROJECT]", "[TIME_SERIES]").toString()) * .setFilter("filter-1274492040") * .setInterval(TimeInterval.newBuilder().build()) * .setAggregation(Aggregation.newBuilder().build()) + * .setSecondaryAggregation(Aggregation.newBuilder().build()) * .setOrderBy("orderBy-1207110587") * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -1271,10 +1371,12 @@ public final ListTimeSeriesPagedResponse listTimeSeries(ListTimeSeriesRequest re * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * ListTimeSeriesRequest request = * ListTimeSeriesRequest.newBuilder() - * .setName(ProjectName.of("[PROJECT]").toString()) + * .setName( + * TimeSeriesName.ofProjectTimeSeriesName("[PROJECT]", "[TIME_SERIES]").toString()) * .setFilter("filter-1274492040") * .setInterval(TimeInterval.newBuilder().build()) * .setAggregation(Aggregation.newBuilder().build()) + * .setSecondaryAggregation(Aggregation.newBuilder().build()) * .setOrderBy("orderBy-1207110587") * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -1303,10 +1405,12 @@ public final ListTimeSeriesPagedResponse listTimeSeries(ListTimeSeriesRequest re * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * ListTimeSeriesRequest request = * ListTimeSeriesRequest.newBuilder() - * .setName(ProjectName.of("[PROJECT]").toString()) + * .setName( + * TimeSeriesName.ofProjectTimeSeriesName("[PROJECT]", "[TIME_SERIES]").toString()) * .setFilter("filter-1274492040") * .setInterval(TimeInterval.newBuilder().build()) * .setAggregation(Aggregation.newBuilder().build()) + * .setSecondaryAggregation(Aggregation.newBuilder().build()) * .setOrderBy("orderBy-1207110587") * .setPageSize(883849137) * .setPageToken("pageToken873572522") diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/QueryServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/QueryServiceClient.java new file mode 100644 index 00000000..1c2d9877 --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/QueryServiceClient.java @@ -0,0 +1,366 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.monitoring.v3; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.monitoring.v3.stub.QueryServiceStub; +import com.google.cloud.monitoring.v3.stub.QueryServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.monitoring.v3.QueryTimeSeriesRequest; +import com.google.monitoring.v3.QueryTimeSeriesResponse; +import com.google.monitoring.v3.TimeSeriesData; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: The QueryService API is used to manage time series data in Stackdriver + * Monitoring. Time series data is a collection of data points that describes the time-varying + * values of a metric. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (QueryServiceClient queryServiceClient = QueryServiceClient.create()) {
+ *   QueryTimeSeriesRequest request =
+ *       QueryTimeSeriesRequest.newBuilder()
+ *           .setName("name3373707")
+ *           .setQuery("query107944136")
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .build();
+ *   for (TimeSeriesData element : queryServiceClient.queryTimeSeries(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

Note: close() needs to be called on the QueryServiceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of QueryServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * QueryServiceSettings queryServiceSettings =
+ *     QueryServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * QueryServiceClient queryServiceClient = QueryServiceClient.create(queryServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * QueryServiceSettings queryServiceSettings =
+ *     QueryServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * QueryServiceClient queryServiceClient = QueryServiceClient.create(queryServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class QueryServiceClient implements BackgroundResource { + private final QueryServiceSettings settings; + private final QueryServiceStub stub; + + /** Constructs an instance of QueryServiceClient with default settings. */ + public static final QueryServiceClient create() throws IOException { + return create(QueryServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of QueryServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final QueryServiceClient create(QueryServiceSettings settings) throws IOException { + return new QueryServiceClient(settings); + } + + /** + * Constructs an instance of QueryServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(QueryServiceSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final QueryServiceClient create(QueryServiceStub stub) { + return new QueryServiceClient(stub); + } + + /** + * Constructs an instance of QueryServiceClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected QueryServiceClient(QueryServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((QueryServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected QueryServiceClient(QueryServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final QueryServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public QueryServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Queries time series using Monitoring Query Language. This method does not require a Workspace. + * + *

Sample code: + * + *

{@code
+   * try (QueryServiceClient queryServiceClient = QueryServiceClient.create()) {
+   *   QueryTimeSeriesRequest request =
+   *       QueryTimeSeriesRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (TimeSeriesData element : queryServiceClient.queryTimeSeries(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QueryTimeSeriesPagedResponse queryTimeSeries(QueryTimeSeriesRequest request) { + return queryTimeSeriesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Queries time series using Monitoring Query Language. This method does not require a Workspace. + * + *

Sample code: + * + *

{@code
+   * try (QueryServiceClient queryServiceClient = QueryServiceClient.create()) {
+   *   QueryTimeSeriesRequest request =
+   *       QueryTimeSeriesRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       queryServiceClient.queryTimeSeriesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (TimeSeriesData element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + queryTimeSeriesPagedCallable() { + return stub.queryTimeSeriesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Queries time series using Monitoring Query Language. This method does not require a Workspace. + * + *

Sample code: + * + *

{@code
+   * try (QueryServiceClient queryServiceClient = QueryServiceClient.create()) {
+   *   QueryTimeSeriesRequest request =
+   *       QueryTimeSeriesRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     QueryTimeSeriesResponse response =
+   *         queryServiceClient.queryTimeSeriesCallable().call(request);
+   *     for (TimeSeriesData element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + queryTimeSeriesCallable() { + return stub.queryTimeSeriesCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class QueryTimeSeriesPagedResponse + extends AbstractPagedListResponse< + QueryTimeSeriesRequest, + QueryTimeSeriesResponse, + TimeSeriesData, + QueryTimeSeriesPage, + QueryTimeSeriesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + QueryTimeSeriesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public QueryTimeSeriesPagedResponse apply(QueryTimeSeriesPage input) { + return new QueryTimeSeriesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private QueryTimeSeriesPagedResponse(QueryTimeSeriesPage page) { + super(page, QueryTimeSeriesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class QueryTimeSeriesPage + extends AbstractPage< + QueryTimeSeriesRequest, QueryTimeSeriesResponse, TimeSeriesData, QueryTimeSeriesPage> { + + private QueryTimeSeriesPage( + PageContext context, + QueryTimeSeriesResponse response) { + super(context, response); + } + + private static QueryTimeSeriesPage createEmptyPage() { + return new QueryTimeSeriesPage(null, null); + } + + @Override + protected QueryTimeSeriesPage createPage( + PageContext context, + QueryTimeSeriesResponse response) { + return new QueryTimeSeriesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class QueryTimeSeriesFixedSizeCollection + extends AbstractFixedSizeCollection< + QueryTimeSeriesRequest, + QueryTimeSeriesResponse, + TimeSeriesData, + QueryTimeSeriesPage, + QueryTimeSeriesFixedSizeCollection> { + + private QueryTimeSeriesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static QueryTimeSeriesFixedSizeCollection createEmptyCollection() { + return new QueryTimeSeriesFixedSizeCollection(null, 0); + } + + @Override + protected QueryTimeSeriesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new QueryTimeSeriesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/QueryServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/QueryServiceSettings.java new file mode 100644 index 00000000..82403a3a --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/QueryServiceSettings.java @@ -0,0 +1,190 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.monitoring.v3; + +import static com.google.cloud.monitoring.v3.QueryServiceClient.QueryTimeSeriesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.monitoring.v3.stub.QueryServiceStubSettings; +import com.google.monitoring.v3.QueryTimeSeriesRequest; +import com.google.monitoring.v3.QueryTimeSeriesResponse; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link QueryServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (monitoring.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of queryTimeSeries to 30 seconds: + * + *

{@code
+ * QueryServiceSettings.Builder queryServiceSettingsBuilder = QueryServiceSettings.newBuilder();
+ * queryServiceSettingsBuilder
+ *     .queryTimeSeriesSettings()
+ *     .setRetrySettings(
+ *         queryServiceSettingsBuilder
+ *             .queryTimeSeriesSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * QueryServiceSettings queryServiceSettings = queryServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class QueryServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to queryTimeSeries. */ + public PagedCallSettings< + QueryTimeSeriesRequest, QueryTimeSeriesResponse, QueryTimeSeriesPagedResponse> + queryTimeSeriesSettings() { + return ((QueryServiceStubSettings) getStubSettings()).queryTimeSeriesSettings(); + } + + public static final QueryServiceSettings create(QueryServiceStubSettings stub) + throws IOException { + return new QueryServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return QueryServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return QueryServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return QueryServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return QueryServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return QueryServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return QueryServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return QueryServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected QueryServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for QueryServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(QueryServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(QueryServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(QueryServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(QueryServiceStubSettings.newBuilder()); + } + + public QueryServiceStubSettings.Builder getStubSettingsBuilder() { + return ((QueryServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to queryTimeSeries. */ + public PagedCallSettings.Builder< + QueryTimeSeriesRequest, QueryTimeSeriesResponse, QueryTimeSeriesPagedResponse> + queryTimeSeriesSettings() { + return getStubSettingsBuilder().queryTimeSeriesSettings(); + } + + @Override + public QueryServiceSettings build() throws IOException { + return new QueryServiceSettings(this); + } + } +} diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/gapic_metadata.json b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/gapic_metadata.json index 24345c60..592d5a25 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/gapic_metadata.json +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/gapic_metadata.json @@ -83,7 +83,7 @@ "methods": ["listMonitoredResourceDescriptors", "listMonitoredResourceDescriptors", "listMonitoredResourceDescriptors", "listMonitoredResourceDescriptors", "listMonitoredResourceDescriptors", "listMonitoredResourceDescriptorsPagedCallable", "listMonitoredResourceDescriptorsCallable"] }, "ListTimeSeries": { - "methods": ["listTimeSeries", "listTimeSeries", "listTimeSeries", "listTimeSeriesPagedCallable", "listTimeSeriesCallable"] + "methods": ["listTimeSeries", "listTimeSeries", "listTimeSeries", "listTimeSeries", "listTimeSeries", "listTimeSeriesPagedCallable", "listTimeSeriesCallable"] } } } @@ -128,6 +128,18 @@ } } }, + "QueryService": { + "clients": { + "grpc": { + "libraryClient": "QueryServiceClient", + "rpcs": { + "QueryTimeSeries": { + "methods": ["queryTimeSeries", "queryTimeSeriesPagedCallable", "queryTimeSeriesCallable"] + } + } + } + } + }, "ServiceMonitoringService": { "clients": { "grpc": { diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java index 15b957b1..45a13ef8 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java @@ -92,6 +92,29 @@ * } * } * + *

======================= QueryServiceClient ======================= + * + *

Service Description: The QueryService API is used to manage time series data in Stackdriver + * Monitoring. Time series data is a collection of data points that describes the time-varying + * values of a metric. + * + *

Sample for QueryServiceClient: + * + *

{@code
+ * try (QueryServiceClient queryServiceClient = QueryServiceClient.create()) {
+ *   QueryTimeSeriesRequest request =
+ *       QueryTimeSeriesRequest.newBuilder()
+ *           .setName("name3373707")
+ *           .setQuery("query107944136")
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .build();
+ *   for (TimeSeriesData element : queryServiceClient.queryTimeSeries(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * *

======================= ServiceMonitoringServiceClient ======================= * *

Service Description: The Cloud Monitoring Service-Oriented Monitoring API has endpoints for diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcQueryServiceCallableFactory.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcQueryServiceCallableFactory.java new file mode 100644 index 00000000..af960abd --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcQueryServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.monitoring.v3.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the QueryService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcQueryServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcQueryServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcQueryServiceStub.java new file mode 100644 index 00000000..3e340358 --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcQueryServiceStub.java @@ -0,0 +1,175 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.monitoring.v3.stub; + +import static com.google.cloud.monitoring.v3.QueryServiceClient.QueryTimeSeriesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.monitoring.v3.QueryTimeSeriesRequest; +import com.google.monitoring.v3.QueryTimeSeriesResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the QueryService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcQueryServiceStub extends QueryServiceStub { + private static final MethodDescriptor + queryTimeSeriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.monitoring.v3.QueryService/QueryTimeSeries") + .setRequestMarshaller( + ProtoUtils.marshaller(QueryTimeSeriesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(QueryTimeSeriesResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable + queryTimeSeriesCallable; + private final UnaryCallable + queryTimeSeriesPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcQueryServiceStub create(QueryServiceStubSettings settings) + throws IOException { + return new GrpcQueryServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcQueryServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcQueryServiceStub(QueryServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcQueryServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcQueryServiceStub( + QueryServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcQueryServiceStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcQueryServiceStub(QueryServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcQueryServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcQueryServiceStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcQueryServiceStub( + QueryServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + queryTimeSeriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(queryTimeSeriesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(QueryTimeSeriesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.queryTimeSeriesCallable = + callableFactory.createUnaryCallable( + queryTimeSeriesTransportSettings, settings.queryTimeSeriesSettings(), clientContext); + this.queryTimeSeriesPagedCallable = + callableFactory.createPagedCallable( + queryTimeSeriesTransportSettings, settings.queryTimeSeriesSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable queryTimeSeriesCallable() { + return queryTimeSeriesCallable; + } + + @Override + public UnaryCallable + queryTimeSeriesPagedCallable() { + return queryTimeSeriesPagedCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/QueryServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/QueryServiceStub.java new file mode 100644 index 00000000..8c6a7aad --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/QueryServiceStub.java @@ -0,0 +1,47 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.monitoring.v3.stub; + +import static com.google.cloud.monitoring.v3.QueryServiceClient.QueryTimeSeriesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.monitoring.v3.QueryTimeSeriesRequest; +import com.google.monitoring.v3.QueryTimeSeriesResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the QueryService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class QueryServiceStub implements BackgroundResource { + + public UnaryCallable + queryTimeSeriesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: queryTimeSeriesPagedCallable()"); + } + + public UnaryCallable queryTimeSeriesCallable() { + throw new UnsupportedOperationException("Not implemented: queryTimeSeriesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/QueryServiceStubSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/QueryServiceStubSettings.java new file mode 100644 index 00000000..82506450 --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/QueryServiceStubSettings.java @@ -0,0 +1,335 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.monitoring.v3.stub; + +import static com.google.cloud.monitoring.v3.QueryServiceClient.QueryTimeSeriesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.monitoring.v3.QueryTimeSeriesRequest; +import com.google.monitoring.v3.QueryTimeSeriesResponse; +import com.google.monitoring.v3.TimeSeriesData; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link QueryServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (monitoring.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of queryTimeSeries to 30 seconds: + * + *

{@code
+ * QueryServiceStubSettings.Builder queryServiceSettingsBuilder =
+ *     QueryServiceStubSettings.newBuilder();
+ * queryServiceSettingsBuilder
+ *     .queryTimeSeriesSettings()
+ *     .setRetrySettings(
+ *         queryServiceSettingsBuilder
+ *             .queryTimeSeriesSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * QueryServiceStubSettings queryServiceSettings = queryServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class QueryServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/monitoring") + .add("https://www.googleapis.com/auth/monitoring.read") + .build(); + + private final PagedCallSettings< + QueryTimeSeriesRequest, QueryTimeSeriesResponse, QueryTimeSeriesPagedResponse> + queryTimeSeriesSettings; + + private static final PagedListDescriptor< + QueryTimeSeriesRequest, QueryTimeSeriesResponse, TimeSeriesData> + QUERY_TIME_SERIES_PAGE_STR_DESC = + new PagedListDescriptor< + QueryTimeSeriesRequest, QueryTimeSeriesResponse, TimeSeriesData>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public QueryTimeSeriesRequest injectToken( + QueryTimeSeriesRequest payload, String token) { + return QueryTimeSeriesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public QueryTimeSeriesRequest injectPageSize( + QueryTimeSeriesRequest payload, int pageSize) { + return QueryTimeSeriesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(QueryTimeSeriesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(QueryTimeSeriesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(QueryTimeSeriesResponse payload) { + return payload.getTimeSeriesDataList() == null + ? ImmutableList.of() + : payload.getTimeSeriesDataList(); + } + }; + + private static final PagedListResponseFactory< + QueryTimeSeriesRequest, QueryTimeSeriesResponse, QueryTimeSeriesPagedResponse> + QUERY_TIME_SERIES_PAGE_STR_FACT = + new PagedListResponseFactory< + QueryTimeSeriesRequest, QueryTimeSeriesResponse, QueryTimeSeriesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + QueryTimeSeriesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, QUERY_TIME_SERIES_PAGE_STR_DESC, request, context); + return QueryTimeSeriesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to queryTimeSeries. */ + public PagedCallSettings< + QueryTimeSeriesRequest, QueryTimeSeriesResponse, QueryTimeSeriesPagedResponse> + queryTimeSeriesSettings() { + return queryTimeSeriesSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public QueryServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcQueryServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "monitoring.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(QueryServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected QueryServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + queryTimeSeriesSettings = settingsBuilder.queryTimeSeriesSettings().build(); + } + + /** Builder for QueryServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + QueryTimeSeriesRequest, QueryTimeSeriesResponse, QueryTimeSeriesPagedResponse> + queryTimeSeriesSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + queryTimeSeriesSettings = PagedCallSettings.newBuilder(QUERY_TIME_SERIES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of(queryTimeSeriesSettings); + initDefaults(this); + } + + protected Builder(QueryServiceStubSettings settings) { + super(settings); + + queryTimeSeriesSettings = settings.queryTimeSeriesSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(queryTimeSeriesSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .queryTimeSeriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to queryTimeSeries. */ + public PagedCallSettings.Builder< + QueryTimeSeriesRequest, QueryTimeSeriesResponse, QueryTimeSeriesPagedResponse> + queryTimeSeriesSettings() { + return queryTimeSeriesSettings; + } + + @Override + public QueryServiceStubSettings build() throws IOException { + return new QueryServiceStubSettings(this); + } + } +} diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceClientTest.java index db39abb3..9b427cd2 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceClientTest.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceClientTest.java @@ -940,7 +940,7 @@ public void listTimeSeriesTest() throws Exception { .build(); mockMetricService.addResponse(expectedResponse); - ProjectName name = ProjectName.of("[PROJECT]"); + FolderName name = FolderName.of("[FOLDER]"); String filter = "filter-1274492040"; TimeInterval interval = TimeInterval.newBuilder().build(); ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0); @@ -973,7 +973,7 @@ public void listTimeSeriesExceptionTest() throws Exception { mockMetricService.addException(exception); try { - ProjectName name = ProjectName.of("[PROJECT]"); + FolderName name = FolderName.of("[FOLDER]"); String filter = "filter-1274492040"; TimeInterval interval = TimeInterval.newBuilder().build(); ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0); @@ -994,6 +994,114 @@ public void listTimeSeriesTest2() throws Exception { .build(); mockMetricService.addResponse(expectedResponse); + OrganizationName name = OrganizationName.of("[ORGANIZATION]"); + String filter = "filter-1274492040"; + TimeInterval interval = TimeInterval.newBuilder().build(); + ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0); + + ListTimeSeriesPagedResponse pagedListResponse = + client.listTimeSeries(name, filter, interval, view); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTimeSeriesList().get(0), resources.get(0)); + + List actualRequests = mockMetricService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTimeSeriesRequest actualRequest = ((ListTimeSeriesRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(interval, actualRequest.getInterval()); + Assert.assertEquals(view, actualRequest.getView()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTimeSeriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricService.addException(exception); + + try { + OrganizationName name = OrganizationName.of("[ORGANIZATION]"); + String filter = "filter-1274492040"; + TimeInterval interval = TimeInterval.newBuilder().build(); + ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0); + client.listTimeSeries(name, filter, interval, view); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTimeSeriesTest3() throws Exception { + TimeSeries responsesElement = TimeSeries.newBuilder().build(); + ListTimeSeriesResponse expectedResponse = + ListTimeSeriesResponse.newBuilder() + .setNextPageToken("") + .addAllTimeSeries(Arrays.asList(responsesElement)) + .build(); + mockMetricService.addResponse(expectedResponse); + + ProjectName name = ProjectName.of("[PROJECT]"); + String filter = "filter-1274492040"; + TimeInterval interval = TimeInterval.newBuilder().build(); + ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0); + + ListTimeSeriesPagedResponse pagedListResponse = + client.listTimeSeries(name, filter, interval, view); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTimeSeriesList().get(0), resources.get(0)); + + List actualRequests = mockMetricService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTimeSeriesRequest actualRequest = ((ListTimeSeriesRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(interval, actualRequest.getInterval()); + Assert.assertEquals(view, actualRequest.getView()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTimeSeriesExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricService.addException(exception); + + try { + ProjectName name = ProjectName.of("[PROJECT]"); + String filter = "filter-1274492040"; + TimeInterval interval = TimeInterval.newBuilder().build(); + ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0); + client.listTimeSeries(name, filter, interval, view); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTimeSeriesTest4() throws Exception { + TimeSeries responsesElement = TimeSeries.newBuilder().build(); + ListTimeSeriesResponse expectedResponse = + ListTimeSeriesResponse.newBuilder() + .setNextPageToken("") + .addAllTimeSeries(Arrays.asList(responsesElement)) + .build(); + mockMetricService.addResponse(expectedResponse); + String name = "name3373707"; String filter = "filter-1274492040"; TimeInterval interval = TimeInterval.newBuilder().build(); @@ -1022,7 +1130,7 @@ public void listTimeSeriesTest2() throws Exception { } @Test - public void listTimeSeriesExceptionTest2() throws Exception { + public void listTimeSeriesExceptionTest4() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockMetricService.addException(exception); diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockQueryService.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockQueryService.java new file mode 100644 index 00000000..5c6cd25d --- /dev/null +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockQueryService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.monitoring.v3; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockQueryService implements MockGrpcService { + private final MockQueryServiceImpl serviceImpl; + + public MockQueryService() { + serviceImpl = new MockQueryServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockQueryServiceImpl.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockQueryServiceImpl.java new file mode 100644 index 00000000..2955ac3b --- /dev/null +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockQueryServiceImpl.java @@ -0,0 +1,83 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.monitoring.v3; + +import com.google.api.core.BetaApi; +import com.google.monitoring.v3.QueryServiceGrpc.QueryServiceImplBase; +import com.google.monitoring.v3.QueryTimeSeriesRequest; +import com.google.monitoring.v3.QueryTimeSeriesResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockQueryServiceImpl extends QueryServiceImplBase { + private List requests; + private Queue responses; + + public MockQueryServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void queryTimeSeries( + QueryTimeSeriesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QueryTimeSeriesResponse) { + requests.add(request); + responseObserver.onNext(((QueryTimeSeriesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method QueryTimeSeries, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QueryTimeSeriesResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClientTest.java index 8a07ff26..50614302 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClientTest.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClientTest.java @@ -40,6 +40,7 @@ import com.google.monitoring.v3.ListNotificationChannelDescriptorsResponse; import com.google.monitoring.v3.ListNotificationChannelsRequest; import com.google.monitoring.v3.ListNotificationChannelsResponse; +import com.google.monitoring.v3.MutationRecord; import com.google.monitoring.v3.NotificationChannel; import com.google.monitoring.v3.NotificationChannelDescriptor; import com.google.monitoring.v3.NotificationChannelDescriptorName; @@ -595,6 +596,8 @@ public void getNotificationChannelTest() throws Exception { .putAllLabels(new HashMap()) .putAllUserLabels(new HashMap()) .setEnabled(BoolValue.newBuilder().build()) + .setCreationRecord(MutationRecord.newBuilder().build()) + .addAllMutationRecords(new ArrayList()) .build(); mockNotificationChannelService.addResponse(expectedResponse); @@ -647,6 +650,8 @@ public void getNotificationChannelTest2() throws Exception { .putAllLabels(new HashMap()) .putAllUserLabels(new HashMap()) .setEnabled(BoolValue.newBuilder().build()) + .setCreationRecord(MutationRecord.newBuilder().build()) + .addAllMutationRecords(new ArrayList()) .build(); mockNotificationChannelService.addResponse(expectedResponse); @@ -695,6 +700,8 @@ public void createNotificationChannelTest() throws Exception { .putAllLabels(new HashMap()) .putAllUserLabels(new HashMap()) .setEnabled(BoolValue.newBuilder().build()) + .setCreationRecord(MutationRecord.newBuilder().build()) + .addAllMutationRecords(new ArrayList()) .build(); mockNotificationChannelService.addResponse(expectedResponse); @@ -747,6 +754,8 @@ public void createNotificationChannelTest2() throws Exception { .putAllLabels(new HashMap()) .putAllUserLabels(new HashMap()) .setEnabled(BoolValue.newBuilder().build()) + .setCreationRecord(MutationRecord.newBuilder().build()) + .addAllMutationRecords(new ArrayList()) .build(); mockNotificationChannelService.addResponse(expectedResponse); @@ -799,6 +808,8 @@ public void createNotificationChannelTest3() throws Exception { .putAllLabels(new HashMap()) .putAllUserLabels(new HashMap()) .setEnabled(BoolValue.newBuilder().build()) + .setCreationRecord(MutationRecord.newBuilder().build()) + .addAllMutationRecords(new ArrayList()) .build(); mockNotificationChannelService.addResponse(expectedResponse); @@ -851,6 +862,8 @@ public void createNotificationChannelTest4() throws Exception { .putAllLabels(new HashMap()) .putAllUserLabels(new HashMap()) .setEnabled(BoolValue.newBuilder().build()) + .setCreationRecord(MutationRecord.newBuilder().build()) + .addAllMutationRecords(new ArrayList()) .build(); mockNotificationChannelService.addResponse(expectedResponse); @@ -903,6 +916,8 @@ public void updateNotificationChannelTest() throws Exception { .putAllLabels(new HashMap()) .putAllUserLabels(new HashMap()) .setEnabled(BoolValue.newBuilder().build()) + .setCreationRecord(MutationRecord.newBuilder().build()) + .addAllMutationRecords(new ArrayList()) .build(); mockNotificationChannelService.addResponse(expectedResponse); @@ -1195,6 +1210,8 @@ public void verifyNotificationChannelTest() throws Exception { .putAllLabels(new HashMap()) .putAllUserLabels(new HashMap()) .setEnabled(BoolValue.newBuilder().build()) + .setCreationRecord(MutationRecord.newBuilder().build()) + .addAllMutationRecords(new ArrayList()) .build(); mockNotificationChannelService.addResponse(expectedResponse); @@ -1250,6 +1267,8 @@ public void verifyNotificationChannelTest2() throws Exception { .putAllLabels(new HashMap()) .putAllUserLabels(new HashMap()) .setEnabled(BoolValue.newBuilder().build()) + .setCreationRecord(MutationRecord.newBuilder().build()) + .addAllMutationRecords(new ArrayList()) .build(); mockNotificationChannelService.addResponse(expectedResponse); diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/QueryServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/QueryServiceClientTest.java new file mode 100644 index 00000000..c36864bc --- /dev/null +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/QueryServiceClientTest.java @@ -0,0 +1,142 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.monitoring.v3; + +import static com.google.cloud.monitoring.v3.QueryServiceClient.QueryTimeSeriesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.monitoring.v3.QueryTimeSeriesRequest; +import com.google.monitoring.v3.QueryTimeSeriesResponse; +import com.google.monitoring.v3.TimeSeriesData; +import com.google.protobuf.AbstractMessage; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class QueryServiceClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockQueryService mockQueryService; + private QueryServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockQueryService = new MockQueryService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockQueryService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + QueryServiceSettings settings = + QueryServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = QueryServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void queryTimeSeriesTest() throws Exception { + TimeSeriesData responsesElement = TimeSeriesData.newBuilder().build(); + QueryTimeSeriesResponse expectedResponse = + QueryTimeSeriesResponse.newBuilder() + .setNextPageToken("") + .addAllTimeSeriesData(Arrays.asList(responsesElement)) + .build(); + mockQueryService.addResponse(expectedResponse); + + QueryTimeSeriesRequest request = + QueryTimeSeriesRequest.newBuilder() + .setName("name3373707") + .setQuery("query107944136") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + QueryTimeSeriesPagedResponse pagedListResponse = client.queryTimeSeries(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTimeSeriesDataList().get(0), resources.get(0)); + + List actualRequests = mockQueryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + QueryTimeSeriesRequest actualRequest = ((QueryTimeSeriesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void queryTimeSeriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockQueryService.addException(exception); + + try { + QueryTimeSeriesRequest request = + QueryTimeSeriesRequest.newBuilder() + .setName("name3373707") + .setQuery("query107944136") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.queryTimeSeries(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyServiceGrpc.java b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyServiceGrpc.java index 8f898905..12a7fa59 100644 --- a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyServiceGrpc.java +++ b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyServiceGrpc.java @@ -326,7 +326,7 @@ public abstract static class AlertPolicyServiceImplBase implements io.grpc.Binda * * *
-     * Lists the existing alerting policies for the project.
+     * Lists the existing alerting policies for the workspace.
      * 
*/ public void listAlertPolicies( @@ -465,7 +465,7 @@ protected AlertPolicyServiceStub build( * * *
-     * Lists the existing alerting policies for the project.
+     * Lists the existing alerting policies for the workspace.
      * 
*/ public void listAlertPolicies( @@ -578,7 +578,7 @@ protected AlertPolicyServiceBlockingStub build( * * *
-     * Lists the existing alerting policies for the project.
+     * Lists the existing alerting policies for the workspace.
      * 
*/ public com.google.monitoring.v3.ListAlertPoliciesResponse listAlertPolicies( @@ -674,7 +674,7 @@ protected AlertPolicyServiceFutureStub build( * * *
-     * Lists the existing alerting policies for the project.
+     * Lists the existing alerting policies for the workspace.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< diff --git a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryServiceGrpc.java b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryServiceGrpc.java new file mode 100644 index 00000000..a510fc19 --- /dev/null +++ b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryServiceGrpc.java @@ -0,0 +1,371 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.monitoring.v3; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * The QueryService API is used to manage time series data in Stackdriver
+ * Monitoring. Time series data is a collection of data points that describes
+ * the time-varying values of a metric.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/monitoring/v3/query_service.proto") +public final class QueryServiceGrpc { + + private QueryServiceGrpc() {} + + public static final String SERVICE_NAME = "google.monitoring.v3.QueryService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.v3.QueryTimeSeriesRequest, + com.google.monitoring.v3.QueryTimeSeriesResponse> + getQueryTimeSeriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "QueryTimeSeries", + requestType = com.google.monitoring.v3.QueryTimeSeriesRequest.class, + responseType = com.google.monitoring.v3.QueryTimeSeriesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.monitoring.v3.QueryTimeSeriesRequest, + com.google.monitoring.v3.QueryTimeSeriesResponse> + getQueryTimeSeriesMethod() { + io.grpc.MethodDescriptor< + com.google.monitoring.v3.QueryTimeSeriesRequest, + com.google.monitoring.v3.QueryTimeSeriesResponse> + getQueryTimeSeriesMethod; + if ((getQueryTimeSeriesMethod = QueryServiceGrpc.getQueryTimeSeriesMethod) == null) { + synchronized (QueryServiceGrpc.class) { + if ((getQueryTimeSeriesMethod = QueryServiceGrpc.getQueryTimeSeriesMethod) == null) { + QueryServiceGrpc.getQueryTimeSeriesMethod = + getQueryTimeSeriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "QueryTimeSeries")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.QueryTimeSeriesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.QueryTimeSeriesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new QueryServiceMethodDescriptorSupplier("QueryTimeSeries")) + .build(); + } + } + } + return getQueryTimeSeriesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static QueryServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QueryServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QueryServiceStub(channel, callOptions); + } + }; + return QueryServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static QueryServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QueryServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QueryServiceBlockingStub(channel, callOptions); + } + }; + return QueryServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static QueryServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QueryServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QueryServiceFutureStub(channel, callOptions); + } + }; + return QueryServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * The QueryService API is used to manage time series data in Stackdriver
+   * Monitoring. Time series data is a collection of data points that describes
+   * the time-varying values of a metric.
+   * 
+ */ + public abstract static class QueryServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Queries time series using Monitoring Query Language. This method does not require a Workspace.
+     * 
+ */ + public void queryTimeSeries( + com.google.monitoring.v3.QueryTimeSeriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getQueryTimeSeriesMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getQueryTimeSeriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.v3.QueryTimeSeriesRequest, + com.google.monitoring.v3.QueryTimeSeriesResponse>( + this, METHODID_QUERY_TIME_SERIES))) + .build(); + } + } + + /** + * + * + *
+   * The QueryService API is used to manage time series data in Stackdriver
+   * Monitoring. Time series data is a collection of data points that describes
+   * the time-varying values of a metric.
+   * 
+ */ + public static final class QueryServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private QueryServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QueryServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QueryServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Queries time series using Monitoring Query Language. This method does not require a Workspace.
+     * 
+ */ + public void queryTimeSeries( + com.google.monitoring.v3.QueryTimeSeriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getQueryTimeSeriesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * The QueryService API is used to manage time series data in Stackdriver
+   * Monitoring. Time series data is a collection of data points that describes
+   * the time-varying values of a metric.
+   * 
+ */ + public static final class QueryServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private QueryServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QueryServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QueryServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Queries time series using Monitoring Query Language. This method does not require a Workspace.
+     * 
+ */ + public com.google.monitoring.v3.QueryTimeSeriesResponse queryTimeSeries( + com.google.monitoring.v3.QueryTimeSeriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getQueryTimeSeriesMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * The QueryService API is used to manage time series data in Stackdriver
+   * Monitoring. Time series data is a collection of data points that describes
+   * the time-varying values of a metric.
+   * 
+ */ + public static final class QueryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private QueryServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QueryServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QueryServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Queries time series using Monitoring Query Language. This method does not require a Workspace.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.monitoring.v3.QueryTimeSeriesResponse> + queryTimeSeries(com.google.monitoring.v3.QueryTimeSeriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getQueryTimeSeriesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_QUERY_TIME_SERIES = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final QueryServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(QueryServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_QUERY_TIME_SERIES: + serviceImpl.queryTimeSeries( + (com.google.monitoring.v3.QueryTimeSeriesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class QueryServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + QueryServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.monitoring.v3.QueryServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("QueryService"); + } + } + + private static final class QueryServiceFileDescriptorSupplier + extends QueryServiceBaseDescriptorSupplier { + QueryServiceFileDescriptorSupplier() {} + } + + private static final class QueryServiceMethodDescriptorSupplier + extends QueryServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + QueryServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (QueryServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new QueryServiceFileDescriptorSupplier()) + .addMethod(getQueryTimeSeriesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Aggregation.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Aggregation.java index cc15d675..35997e5c 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Aggregation.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Aggregation.java @@ -1363,10 +1363,12 @@ private Reducer(int value) { * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -1386,10 +1388,12 @@ public boolean hasAlignmentPeriod() { * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -1411,10 +1415,12 @@ public com.google.protobuf.Duration getAlignmentPeriod() { * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -2087,10 +2093,12 @@ public Builder mergeFrom( * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -2109,10 +2117,12 @@ public boolean hasAlignmentPeriod() { * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -2137,10 +2147,12 @@ public com.google.protobuf.Duration getAlignmentPeriod() { * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -2167,10 +2179,12 @@ public Builder setAlignmentPeriod(com.google.protobuf.Duration value) { * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -2194,10 +2208,12 @@ public Builder setAlignmentPeriod(com.google.protobuf.Duration.Builder builderFo * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -2228,10 +2244,12 @@ public Builder mergeAlignmentPeriod(com.google.protobuf.Duration value) { * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -2256,10 +2274,12 @@ public Builder clearAlignmentPeriod() { * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -2278,10 +2298,12 @@ public com.google.protobuf.Duration.Builder getAlignmentPeriodBuilder() { * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -2304,10 +2326,12 @@ public com.google.protobuf.DurationOrBuilder getAlignmentPeriodOrBuilder() { * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AggregationOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AggregationOrBuilder.java index 498fead9..bc43c732 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AggregationOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AggregationOrBuilder.java @@ -32,10 +32,12 @@ public interface AggregationOrBuilder * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -52,10 +54,12 @@ public interface AggregationOrBuilder * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; @@ -72,10 +76,12 @@ public interface AggregationOrBuilder * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of * time. This will be done before the per-series aligner can be applied to * the data. - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. * * * .google.protobuf.Duration alignment_period = 1; diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java index 98a23c86..b41915d3 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java @@ -1537,6 +1537,52 @@ public interface ConditionOrBuilder com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder getConditionAbsentOrBuilder(); + /** + * + * + *
+     * 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. + */ + boolean hasConditionMonitoringQueryLanguage(); + /** + * + * + *
+     * 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. + */ + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + getConditionMonitoringQueryLanguage(); + /** + * + * + *
+     * A condition that uses the Monitoring Query Language to define
+     * alerts.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * + */ + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageConditionOrBuilder + getConditionMonitoringQueryLanguageOrBuilder(); + public com.google.monitoring.v3.AlertPolicy.Condition.ConditionCase getConditionCase(); } /** @@ -1650,6 +1696,33 @@ private Condition( name_ = s; break; } + case 154: + { + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .Builder + subBuilder = null; + if (conditionCase_ == 19) { + subBuilder = + ((com.google.monitoring.v3.AlertPolicy.Condition + .MonitoringQueryLanguageCondition) + condition_) + .toBuilder(); + } + condition_ = + input.readMessage( + com.google.monitoring.v3.AlertPolicy.Condition + .MonitoringQueryLanguageCondition.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.v3.AlertPolicy.Condition + .MonitoringQueryLanguageCondition) + condition_); + condition_ = subBuilder.buildPartial(); + } + conditionCase_ = 19; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -2561,18 +2634,18 @@ public interface MetricThresholdOrBuilder * * *
-       * 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
        * [`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) and 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.
+       * 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; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -2581,18 +2654,18 @@ public interface MetricThresholdOrBuilder * * *
-       * 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
        * [`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) and 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.
+       * 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; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -3171,18 +3244,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * 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
        * [`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) and 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.
+       * 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; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -3202,18 +3275,18 @@ public java.lang.String getFilter() { * * *
-       * 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
        * [`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) and 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.
+       * 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; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -4277,18 +4350,18 @@ public Builder mergeFrom( * * *
-         * 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
          * [`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) and 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.
+         * 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; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -4307,18 +4380,18 @@ public java.lang.String getFilter() { * * *
-         * 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
          * [`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) and 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.
+         * 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; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -4337,18 +4410,18 @@ public com.google.protobuf.ByteString getFilterBytes() { * * *
-         * 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
          * [`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) and 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.
+         * 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; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; * * @param value The filter to set. * @return This builder for chaining. @@ -4366,18 +4439,18 @@ public Builder setFilter(java.lang.String value) { * * *
-         * 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
          * [`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) and 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.
+         * 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; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -4391,18 +4464,18 @@ public Builder clearFilter() { * * *
-         * 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
          * [`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) and 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.
+         * 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; + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for filter to set. * @return This builder for chaining. @@ -6306,18 +6379,18 @@ public interface MetricAbsenceOrBuilder * * *
-       * 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
        * [`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) and 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.
+       * 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; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -6326,18 +6399,18 @@ public interface MetricAbsenceOrBuilder * * *
-       * 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
        * [`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) and 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.
+       * 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; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -6445,9 +6518,10 @@ public interface MetricAbsenceOrBuilder * *
        * The amount of time that a time series must fail to report new
-       * data to be considered failing. Currently, only values that
-       * are a multiple of a minute--e.g.  60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
+       * 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.
        * 
@@ -6462,9 +6536,10 @@ public interface MetricAbsenceOrBuilder * *
        * The amount of time that a time series must fail to report new
-       * data to be considered failing. Currently, only values that
-       * are a multiple of a minute--e.g.  60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
+       * 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.
        * 
@@ -6479,9 +6554,10 @@ public interface MetricAbsenceOrBuilder * *
        * The amount of time that a time series must fail to report new
-       * data to be considered failing. Currently, only values that
-       * are a multiple of a minute--e.g.  60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
+       * 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.
        * 
@@ -6686,18 +6762,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * 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
        * [`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) and 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.
+       * 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; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -6717,18 +6793,18 @@ public java.lang.String getFilter() { * * *
-       * 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
        * [`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) and 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.
+       * 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; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -6866,9 +6942,10 @@ public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(in * *
        * The amount of time that a time series must fail to report new
-       * data to be considered failing. Currently, only values that
-       * are a multiple of a minute--e.g.  60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
+       * 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.
        * 
@@ -6886,9 +6963,10 @@ public boolean hasDuration() { * *
        * The amount of time that a time series must fail to report new
-       * data to be considered failing. Currently, only values that
-       * are a multiple of a minute--e.g.  60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
+       * 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.
        * 
@@ -6906,9 +6984,10 @@ public com.google.protobuf.Duration getDuration() { * *
        * The amount of time that a time series must fail to report new
-       * data to be considered failing. Currently, only values that
-       * are a multiple of a minute--e.g.  60, 120, or 300
-       * seconds--are supported. If an invalid value is given, an
+       * 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.
        * 
@@ -7427,18 +7506,18 @@ public Builder mergeFrom( * * *
-         * 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
          * [`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) and 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.
+         * 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; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -7457,18 +7536,18 @@ public java.lang.String getFilter() { * * *
-         * 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
          * [`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) and 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.
+         * 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; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -7487,18 +7566,18 @@ public com.google.protobuf.ByteString getFilterBytes() { * * *
-         * 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
          * [`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) and 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.
+         * 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; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The filter to set. * @return This builder for chaining. @@ -7516,18 +7595,18 @@ public Builder setFilter(java.lang.String value) { * * *
-         * 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
          * [`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) and 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.
+         * 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; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -7541,18 +7620,18 @@ public Builder clearFilter() { * * *
-         * 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
          * [`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) and 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.
+         * 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; + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for filter to set. * @return This builder for chaining. @@ -8095,9 +8174,10 @@ public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder(int i * *
          * The amount of time that a time series must fail to report new
-         * data to be considered failing. Currently, only values that
-         * are a multiple of a minute--e.g.  60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
+         * 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.
          * 
@@ -8114,9 +8194,10 @@ public boolean hasDuration() { * *
          * The amount of time that a time series must fail to report new
-         * data to be considered failing. Currently, only values that
-         * are a multiple of a minute--e.g.  60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
+         * 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.
          * 
@@ -8139,9 +8220,10 @@ public com.google.protobuf.Duration getDuration() { * *
          * The amount of time that a time series must fail to report new
-         * data to be considered failing. Currently, only values that
-         * are a multiple of a minute--e.g.  60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
+         * 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.
          * 
@@ -8166,9 +8248,10 @@ public Builder setDuration(com.google.protobuf.Duration value) { * *
          * The amount of time that a time series must fail to report new
-         * data to be considered failing. Currently, only values that
-         * are a multiple of a minute--e.g.  60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
+         * 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.
          * 
@@ -8190,9 +8273,10 @@ public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) * *
          * The amount of time that a time series must fail to report new
-         * data to be considered failing. Currently, only values that
-         * are a multiple of a minute--e.g.  60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
+         * 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.
          * 
@@ -8221,9 +8305,10 @@ public Builder mergeDuration(com.google.protobuf.Duration value) { * *
          * The amount of time that a time series must fail to report new
-         * data to be considered failing. Currently, only values that
-         * are a multiple of a minute--e.g.  60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
+         * 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.
          * 
@@ -8246,9 +8331,10 @@ public Builder clearDuration() { * *
          * The amount of time that a time series must fail to report new
-         * data to be considered failing. Currently, only values that
-         * are a multiple of a minute--e.g.  60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
+         * 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.
          * 
@@ -8265,9 +8351,10 @@ public com.google.protobuf.Duration.Builder getDurationBuilder() { * *
          * The amount of time that a time series must fail to report new
-         * data to be considered failing. Currently, only values that
-         * are a multiple of a minute--e.g.  60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
+         * 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.
          * 
@@ -8288,9 +8375,10 @@ public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { * *
          * The amount of time that a time series must fail to report new
-         * data to be considered failing. Currently, only values that
-         * are a multiple of a minute--e.g.  60, 120, or 300
-         * seconds--are supported. If an invalid value is given, an
+         * 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.
          * 
@@ -8583,81 +8671,1622 @@ public com.google.protobuf.Parser getParserForType() { } } - private int conditionCase_ = 0; - private java.lang.Object condition_; - - public enum ConditionCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - CONDITION_THRESHOLD(1), - CONDITION_ABSENT(2), - CONDITION_NOT_SET(0); - private final int value; + public interface MonitoringQueryLanguageConditionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + com.google.protobuf.MessageOrBuilder { - private ConditionCase(int value) { - this.value = value; - } /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. + * + * + *
+       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+       * query that outputs a boolean stream.
+       * 
+ * + * string query = 1; + * + * @return The query. */ - @java.lang.Deprecated - public static ConditionCase valueOf(int value) { - return forNumber(value); - } - - public static ConditionCase forNumber(int value) { - switch (value) { - case 1: - return CONDITION_THRESHOLD; - case 2: - return CONDITION_ABSENT; - case 0: - return CONDITION_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; + java.lang.String getQuery(); + /** + * + * + *
+       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+       * query that outputs a boolean stream.
+       * 
+ * + * string query = 1; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); - public ConditionCase getConditionCase() { - return ConditionCase.forNumber(conditionCase_); - } + /** + * + * + *
+       * 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. + */ + 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.
+       * 
+ * + * .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.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); - public static final int NAME_FIELD_NUMBER = 12; - private volatile 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 Stackdriver 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. Stackdriver 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.
-     * 
- * + /** + * + * + *
+       * 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. + */ + 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.
+       * 
+ * + * .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`,
+       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+       * are specified.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder(); + } + /** + * + * + *
+     * 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.MonitoringQueryLanguageCondition} + */ + public static final class MonitoringQueryLanguageCondition + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + MonitoringQueryLanguageConditionOrBuilder { + private static final long serialVersionUID = 0L; + // Use MonitoringQueryLanguageCondition.newBuilder() to construct. + private MonitoringQueryLanguageCondition( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MonitoringQueryLanguageCondition() { + query_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MonitoringQueryLanguageCondition(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MonitoringQueryLanguageCondition( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 18: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (duration_ != null) { + subBuilder = duration_.toBuilder(); + } + duration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(duration_); + duration_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder subBuilder = null; + if (trigger_ != null) { + subBuilder = trigger_.toBuilder(); + } + trigger_ = + input.readMessage( + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(trigger_); + trigger_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.AlertProto + .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_MonitoringQueryLanguageCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .class, + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + .Builder.class); + } + + public static final int QUERY_FIELD_NUMBER = 1; + private volatile 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. + */ + @java.lang.Override + 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(); + query_ = s; + return s; + } + } + /** + * + * + *
+       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+       * query that outputs a boolean stream.
+       * 
+ * + * string query = 1; + * + * @return The bytes for query. + */ + @java.lang.Override + 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); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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; + } + /** + * + * + *
+       * 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_; + } + /** + * + * + *
+       * 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 getDuration(); + } + + 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.
+       * 
+ * + * .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.
+       * 
+ * + * .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`,
+       * or by the ratio, if `denominator_filter` and `denominator_aggregations`
+       * are specified.
+       * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Condition.TriggerOrBuilder getTriggerOrBuilder() { + return getTrigger(); + } + + 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 (!getQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_); + } + if (duration_ != null) { + output.writeMessage(2, getDuration()); + } + if (trigger_ != null) { + output.writeMessage(3, getTrigger()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_); + } + if (duration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDuration()); + } + if (trigger_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTrigger()); + } + size += unknownFields.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.MonitoringQueryLanguageCondition)) { + return super.equals(obj); + } + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition other = + (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) 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 (!unknownFields.equals(other.unknownFields)) 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) + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + 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.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.MonitoringQueryLanguageCondition + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + 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.MonitoringQueryLanguageCondition + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + 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.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.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.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.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.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.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); + } + + @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.MonitoringQueryLanguageCondition + 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 allows alert policies to be defined using
+       * [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
+       * 
+ * + * 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.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_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_MonitoringQueryLanguageCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + 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.MonitoringQueryLanguageCondition.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + query_ = ""; + + if (durationBuilder_ == null) { + duration_ = null; + } else { + duration_ = null; + durationBuilder_ = null; + } + if (triggerBuilder_ == null) { + trigger_ = null; + } else { + trigger_ = null; + 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_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); + result.query_ = query_; + if (durationBuilder_ == null) { + result.duration_ = duration_; + } else { + result.duration_ = durationBuilder_.build(); + } + if (triggerBuilder_ == null) { + result.trigger_ = trigger_; + } else { + result.trigger_ = triggerBuilder_.build(); + } + onBuilt(); + return result; + } + + @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_; + onChanged(); + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + if (other.hasTrigger()) { + mergeTrigger(other.getTrigger()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + 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; + } + } + /** + * + * + *
+         * [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; + } + } + /** + * + * + *
+         * [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; + onChanged(); + return this; + } + /** + * + * + *
+         * [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(); + onChanged(); + return this; + } + /** + * + * + *
+         * [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; + onChanged(); + 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.
+         * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return durationBuilder_ != null || 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 = 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(); + } + } + /** + * + * + *
+         * 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; + onChanged(); + } else { + durationBuilder_.setMessage(value); + } + + 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(); + onChanged(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + + 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 mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (duration_ != null) { + duration_ = + com.google.protobuf.Duration.newBuilder(duration_) + .mergeFrom(value) + .buildPartial(); + } else { + duration_ = value; + } + onChanged(); + } else { + durationBuilder_.mergeFrom(value); + } + + 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 clearDuration() { + if (durationBuilder_ == null) { + duration_ = null; + onChanged(); + } else { + duration_ = null; + durationBuilder_ = null; + } + + 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() { + + 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 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 triggerBuilder_ != null || 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 = 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(); + } + } + /** + * + * + *
+         * 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 Builder setTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { + if (triggerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + trigger_ = value; + onChanged(); + } else { + triggerBuilder_.setMessage(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.
+         * 
+ * + * .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(); + onChanged(); + } else { + triggerBuilder_.setMessage(builderForValue.build()); + } + + 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 = 3; + */ + public Builder mergeTrigger(com.google.monitoring.v3.AlertPolicy.Condition.Trigger value) { + if (triggerBuilder_ == null) { + if (trigger_ != null) { + trigger_ = + com.google.monitoring.v3.AlertPolicy.Condition.Trigger.newBuilder(trigger_) + .mergeFrom(value) + .buildPartial(); + } else { + trigger_ = value; + } + onChanged(); + } else { + triggerBuilder_.mergeFrom(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.
+         * 
+ * + * .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + public Builder clearTrigger() { + if (triggerBuilder_ == null) { + trigger_ = null; + onChanged(); + } else { + trigger_ = null; + triggerBuilder_ = null; + } + + 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 = 3; + */ + public com.google.monitoring.v3.AlertPolicy.Condition.Trigger.Builder getTriggerBuilder() { + + 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 = 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_; + } + } + /** + * + * + *
+         * 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; + */ + 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_; + } + + @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.MonitoringQueryLanguageCondition) + } + + // @@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.MonitoringQueryLanguageCondition(); + } + + 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() { + @java.lang.Override + public MonitoringQueryLanguageCondition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MonitoringQueryLanguageCondition(input, extensionRegistry); + } + }; + + 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.MonitoringQueryLanguageCondition + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int conditionCase_ = 0; + private java.lang.Object condition_; + + public enum ConditionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CONDITION_THRESHOLD(1), + CONDITION_ABSENT(2), + CONDITION_MONITORING_QUERY_LANGUAGE(19), + CONDITION_NOT_SET(0); + private final int value; + + private ConditionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConditionCase valueOf(int value) { + return forNumber(value); + } + + public static ConditionCase forNumber(int value) { + switch (value) { + case 1: + return CONDITION_THRESHOLD; + case 2: + return CONDITION_ABSENT; + case 19: + return CONDITION_MONITORING_QUERY_LANGUAGE; + case 0: + return CONDITION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConditionCase getConditionCase() { + return ConditionCase.forNumber(conditionCase_); + } + + public static final int NAME_FIELD_NUMBER = 12; + private volatile 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 Stackdriver 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. Stackdriver 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. @@ -8880,6 +10509,72 @@ public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence getCondition return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.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(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -8908,6 +10603,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 12, name_); } + if (conditionCase_ == 19) { + output.writeMessage( + 19, + (com.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition) + condition_); + } unknownFields.writeTo(output); } @@ -8933,6 +10634,13 @@ public int getSerializedSize() { if (!getNameBytes().isEmpty()) { 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_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -8959,6 +10667,10 @@ public boolean equals(final java.lang.Object obj) { case 2: if (!getConditionAbsent().equals(other.getConditionAbsent())) return false; break; + case 19: + if (!getConditionMonitoringQueryLanguage() + .equals(other.getConditionMonitoringQueryLanguage())) return false; + break; case 0: default: } @@ -8986,6 +10698,10 @@ public int hashCode() { hash = (37 * hash) + CONDITION_ABSENT_FIELD_NUMBER; hash = (53 * hash) + getConditionAbsent().hashCode(); break; + case 19: + hash = (37 * hash) + CONDITION_MONITORING_QUERY_LANGUAGE_FIELD_NUMBER; + hash = (53 * hash) + getConditionMonitoringQueryLanguage().hashCode(); + break; case 0: default: } @@ -9187,6 +10903,13 @@ public com.google.monitoring.v3.AlertPolicy.Condition buildPartial() { result.condition_ = conditionAbsentBuilder_.build(); } } + if (conditionCase_ == 19) { + if (conditionMonitoringQueryLanguageBuilder_ == null) { + result.condition_ = condition_; + } else { + result.condition_ = conditionMonitoringQueryLanguageBuilder_.build(); + } + } result.conditionCase_ = conditionCase_; onBuilt(); return result; @@ -9259,6 +10982,11 @@ public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy.Condition other) { mergeConditionAbsent(other.getConditionAbsent()); break; } + case CONDITION_MONITORING_QUERY_LANGUAGE: + { + mergeConditionMonitoringQueryLanguage(other.getConditionMonitoringQueryLanguage()); + break; + } case CONDITION_NOT_SET: { break; @@ -10087,6 +11815,268 @@ public Builder clearConditionAbsent() { return conditionAbsentBuilder_; } + 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; + } + /** + * + * + *
+       * 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 (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(); + } + } + /** + * + * + *
+       * 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(); + } + condition_ = value; + onChanged(); + } else { + conditionMonitoringQueryLanguageBuilder_.setMessage(value); + } + 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()); + } + 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; + } + onChanged(); + } else { + if (conditionCase_ == 19) { + conditionMonitoringQueryLanguageBuilder_.mergeFrom(value); + } + conditionMonitoringQueryLanguageBuilder_.setMessage(value); + } + 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(); + } + } else { + if (conditionCase_ == 19) { + conditionCase_ = 0; + condition_ = null; + } + conditionMonitoringQueryLanguageBuilder_.clear(); + } + 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_; + } + 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; + * + */ + 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; + } + conditionCase_ = 19; + onChanged(); + ; + return conditionMonitoringQueryLanguageBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java index f307e7df..0f115b49 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java @@ -51,6 +51,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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_UserLabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -65,76 +69,85 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n google/monitoring/v3/alert.proto\022\024goog" - + "le.monitoring.v3\032\031google/api/resource.pr" - + "oto\032!google/monitoring/v3/common.proto\032*" - + "google/monitoring/v3/mutation_record.pro" - + "to\032\036google/protobuf/duration.proto\032\036goog" - + "le/protobuf/wrappers.proto\032\027google/rpc/s" - + "tatus.proto\"\351\020\n\013AlertPolicy\022\014\n\004name\030\001 \001(" - + "\t\022\024\n\014display_name\030\002 \001(\t\022F\n\rdocumentation" - + "\030\r \001(\0132/.google.monitoring.v3.AlertPolic" - + "y.Documentation\022F\n\013user_labels\030\020 \003(\01321.g" - + "oogle.monitoring.v3.AlertPolicy.UserLabe" - + "lsEntry\022?\n\nconditions\030\014 \003(\0132+.google.mon" - + "itoring.v3.AlertPolicy.Condition\022I\n\010comb" - + "iner\030\006 \001(\01627.google.monitoring.v3.AlertP" - + "olicy.ConditionCombinerType\022+\n\007enabled\030\021" - + " \001(\0132\032.google.protobuf.BoolValue\022$\n\010vali" - + "dity\030\022 \001(\0132\022.google.rpc.Status\022\035\n\025notifi" - + "cation_channels\030\016 \003(\t\022=\n\017creation_record" - + "\030\n \001(\0132$.google.monitoring.v3.MutationRe" - + "cord\022=\n\017mutation_record\030\013 \001(\0132$.google.m" - + "onitoring.v3.MutationRecord\0323\n\rDocumenta" - + "tion\022\017\n\007content\030\001 \001(\t\022\021\n\tmime_type\030\002 \001(\t" - + "\032\222\t\n\tCondition\022\014\n\004name\030\014 \001(\t\022\024\n\014display_" - + "name\030\006 \001(\t\022Z\n\023condition_threshold\030\001 \001(\0132" - + ";.google.monitoring.v3.AlertPolicy.Condi" - + "tion.MetricThresholdH\000\022U\n\020condition_abse" - + "nt\030\002 \001(\01329.google.monitoring.v3.AlertPol" - + "icy.Condition.MetricAbsenceH\000\0325\n\007Trigger" - + "\022\017\n\005count\030\001 \001(\005H\000\022\021\n\007percent\030\002 \001(\001H\000B\006\n\004" - + "type\032\201\003\n\017MetricThreshold\022\016\n\006filter\030\002 \001(\t" - + "\0227\n\014aggregations\030\010 \003(\0132!.google.monitori" - + "ng.v3.Aggregation\022\032\n\022denominator_filter\030" - + "\t \001(\t\022C\n\030denominator_aggregations\030\n \003(\0132" - + "!.google.monitoring.v3.Aggregation\0228\n\nco" - + "mparison\030\004 \001(\0162$.google.monitoring.v3.Co" - + "mparisonType\022\027\n\017threshold_value\030\005 \001(\001\022+\n" - + "\010duration\030\006 \001(\0132\031.google.protobuf.Durati" - + "on\022D\n\007trigger\030\007 \001(\01323.google.monitoring." - + "v3.AlertPolicy.Condition.Trigger\032\313\001\n\rMet" - + "ricAbsence\022\016\n\006filter\030\001 \001(\t\0227\n\014aggregatio" - + "ns\030\005 \003(\0132!.google.monitoring.v3.Aggregat" - + "ion\022+\n\010duration\030\002 \001(\0132\031.google.protobuf." - + "Duration\022D\n\007trigger\030\003 \001(\01323.google.monit" - + "oring.v3.AlertPolicy.Condition.Trigger:\227" - + "\002\352A\223\002\n.monitoring.googleapis.com/AlertPo" - + "licyCondition\022Fprojects/{project}/alertP" - + "olicies/{alert_policy}/conditions/{condi" - + "tion}\022Porganizations/{organization}/aler" - + "tPolicies/{alert_policy}/conditions/{con" - + "dition}\022Dfolders/{folder}/alertPolicies/" - + "{alert_policy}/conditions/{condition}\022\001*" - + "B\013\n\tcondition\0321\n\017UserLabelsEntry\022\013\n\003key\030" - + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"a\n\025ConditionCom" - + "binerType\022\027\n\023COMBINE_UNSPECIFIED\020\000\022\007\n\003AN" - + "D\020\001\022\006\n\002OR\020\002\022\036\n\032AND_WITH_MATCHING_RESOURC" - + "E\020\003:\311\001\352A\305\001\n%monitoring.googleapis.com/Al" - + "ertPolicy\022/projects/{project}/alertPolic" - + "ies/{alert_policy}\0229organizations/{organ" - + "ization}/alertPolicies/{alert_policy}\022-f" - + "olders/{folder}/alertPolicies/{alert_pol" - + "icy}\022\001*B\302\001\n\030com.google.monitoring.v3B\nAl" - + "ertProtoP\001Z>google.golang.org/genproto/g" - + "oogleapis/monitoring/v3;monitoring\252\002\032Goo" - + "gle.Cloud.Monitoring.V3\312\002\032Google\\Cloud\\M" - + "onitoring\\V3\352\002\035Google::Cloud::Monitoring" - + "::V3b\006proto3" + + "le.monitoring.v3\032\037google/api/field_behav" + + "ior.proto\032\031google/api/resource.proto\032!go" + + "ogle/monitoring/v3/common.proto\032*google/" + + "monitoring/v3/mutation_record.proto\032\036goo" + + "gle/protobuf/duration.proto\032\036google/prot" + + "obuf/wrappers.proto\032\027google/rpc/status.p" + + "roto\"\227\023\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" + + "onitoring.v3.AlertPolicy.UserLabelsEntry" + + "\022?\n\nconditions\030\014 \003(\0132+.google.monitoring" + + ".v3.AlertPolicy.Condition\022I\n\010combiner\030\006 " + + "\001(\01627.google.monitoring.v3.AlertPolicy.C" + + "onditionCombinerType\022+\n\007enabled\030\021 \001(\0132\032." + + "google.protobuf.BoolValue\022$\n\010validity\030\022 " + + "\001(\0132\022.google.rpc.Status\022\035\n\025notification_" + + "channels\030\016 \003(\t\022=\n\017creation_record\030\n \001(\0132" + + "$.google.monitoring.v3.MutationRecord\022=\n" + + "\017mutation_record\030\013 \001(\0132$.google.monitori" + + "ng.v3.MutationRecord\0323\n\rDocumentation\022\017\n" + + "\007content\030\001 \001(\t\022\021\n\tmime_type\030\002 \001(\t\032\300\013\n\tCo" + + "ndition\022\014\n\004name\030\014 \001(\t\022\024\n\014display_name\030\006 " + + "\001(\t\022Z\n\023condition_threshold\030\001 \001(\0132;.googl" + + "e.monitoring.v3.AlertPolicy.Condition.Me" + + "tricThresholdH\000\022U\n\020condition_absent\030\002 \001(" + + "\01329.google.monitoring.v3.AlertPolicy.Con" + + "dition.MetricAbsenceH\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\206\003\n\017MetricThreshold\022\023\n\006filter\030\002 \001(\tB\003" + + "\340A\002\0227\n\014aggregations\030\010 \003(\0132!.google.monit" + + "oring.v3.Aggregation\022\032\n\022denominator_filt" + + "er\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.v3" + + ".ComparisonType\022\027\n\017threshold_value\030\005 \001(\001" + + "\022+\n\010duration\030\006 \001(\0132\031.google.protobuf.Dur" + + "ation\022D\n\007trigger\030\007 \001(\01323.google.monitori" + + "ng.v3.AlertPolicy.Condition.Trigger\032\320\001\n\r" + + "MetricAbsence\022\023\n\006filter\030\001 \001(\tB\003\340A\002\0227\n\014ag" + + "gregations\030\005 \003(\0132!.google.monitoring.v3." + + "Aggregation\022+\n\010duration\030\002 \001(\0132\031.google.p" + + "rotobuf.Duration\022D\n\007trigger\030\003 \001(\01323.goog" + + "le.monitoring.v3.AlertPolicy.Condition.T" + + "rigger\032\244\001\n MonitoringQueryLanguageCondit" + + "ion\022\r\n\005query\030\001 \001(\t\022+\n\010duration\030\002 \001(\0132\031.g" + + "oogle.protobuf.Duration\022D\n\007trigger\030\003 \001(\013" + + "23.google.monitoring.v3.AlertPolicy.Cond" + + "ition.Trigger:\227\002\352A\223\002\n.monitoring.googlea" + + "pis.com/AlertPolicyCondition\022Fprojects/{" + + "project}/alertPolicies/{alert_policy}/co" + + "nditions/{condition}\022Porganizations/{org" + + "anization}/alertPolicies/{alert_policy}/" + + "conditions/{condition}\022Dfolders/{folder}" + + "/alertPolicies/{alert_policy}/conditions" + + "/{condition}\022\001*B\013\n\tcondition\0321\n\017UserLabe" + + "lsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"" + + "a\n\025ConditionCombinerType\022\027\n\023COMBINE_UNSP" + + "ECIFIED\020\000\022\007\n\003AND\020\001\022\006\n\002OR\020\002\022\036\n\032AND_WITH_M" + + "ATCHING_RESOURCE\020\003:\311\001\352A\305\001\n%monitoring.go" + + "ogleapis.com/AlertPolicy\022/projects/{proj" + + "ect}/alertPolicies/{alert_policy}\0229organ" + + "izations/{organization}/alertPolicies/{a" + + "lert_policy}\022-folders/{folder}/alertPoli" + + "cies/{alert_policy}\022\001*B\302\001\n\030com.google.mo" + + "nitoring.v3B\nAlertProtoP\001Z>google.golang" + + ".org/genproto/googleapis/monitoring/v3;m" + + "onitoring\252\002\032Google.Cloud.Monitoring.V3\312\002" + + "\032Google\\Cloud\\Monitoring\\V3\352\002\035Google::Cl" + + "oud::Monitoring::V3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), com.google.monitoring.v3.CommonProto.getDescriptor(), com.google.monitoring.v3.MutationRecordProto.getDescriptor(), @@ -174,7 +187,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor, new java.lang.String[] { - "Name", "DisplayName", "ConditionThreshold", "ConditionAbsent", "Condition", + "Name", + "DisplayName", + "ConditionThreshold", + "ConditionAbsent", + "ConditionMonitoringQueryLanguage", + "Condition", }); internal_static_google_monitoring_v3_AlertPolicy_Condition_Trigger_descriptor = internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor @@ -213,6 +231,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Filter", "Aggregations", "Duration", "Trigger", }); + internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_descriptor = + internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor + .getNestedTypes() + .get(3); + internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_AlertPolicy_Condition_MonitoringQueryLanguageCondition_descriptor, + new java.lang.String[] { + "Query", "Duration", "Trigger", + }); internal_static_google_monitoring_v3_AlertPolicy_UserLabelsEntry_descriptor = internal_static_google_monitoring_v3_AlertPolicy_descriptor.getNestedTypes().get(2); internal_static_google_monitoring_v3_AlertPolicy_UserLabelsEntry_fieldAccessorTable = @@ -223,9 +251,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); registry.add(com.google.api.ResourceProto.resource); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); com.google.monitoring.v3.CommonProto.getDescriptor(); com.google.monitoring.v3.MutationRecordProto.getDescriptor(); diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertServiceProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertServiceProto.java index 7a3a6eb7..a90b69db 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertServiceProto.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertServiceProto.java @@ -76,48 +76,48 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "istAlertPoliciesRequest\022;\n\004name\030\004 \001(\tB-\340" + "A\002\372A\'\022%monitoring.googleapis.com/AlertPo" + "licy\022\016\n\006filter\030\005 \001(\t\022\020\n\010order_by\030\006 \001(\t\022\021" - + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"o\n" - + "\031ListAlertPoliciesResponse\0229\n\016alert_poli" - + "cies\030\003 \003(\0132!.google.monitoring.v3.AlertP" - + "olicy\022\027\n\017next_page_token\030\002 \001(\t\"\211\001\n\030Updat" - + "eAlertPolicyRequest\022/\n\013update_mask\030\002 \001(\013" - + "2\032.google.protobuf.FieldMask\022<\n\014alert_po" - + "licy\030\003 \001(\0132!.google.monitoring.v3.AlertP" - + "olicyB\003\340A\002\"W\n\030DeleteAlertPolicyRequest\022;" - + "\n\004name\030\003 \001(\tB-\340A\002\372A\'\n%monitoring.googlea" - + "pis.com/AlertPolicy2\236\010\n\022AlertPolicyServi" - + "ce\022\250\001\n\021ListAlertPolicies\022..google.monito" - + "ring.v3.ListAlertPoliciesRequest\032/.googl" - + "e.monitoring.v3.ListAlertPoliciesRespons" - + "e\"2\202\323\344\223\002%\022#/v3/{name=projects/*}/alertPo" - + "licies\332A\004name\022\226\001\n\016GetAlertPolicy\022+.googl" - + "e.monitoring.v3.GetAlertPolicyRequest\032!." - + "google.monitoring.v3.AlertPolicy\"4\202\323\344\223\002\'" - + "\022%/v3/{name=projects/*/alertPolicies/*}\332" - + "A\004name\022\265\001\n\021CreateAlertPolicy\022..google.mo" - + "nitoring.v3.CreateAlertPolicyRequest\032!.g" - + "oogle.monitoring.v3.AlertPolicy\"M\202\323\344\223\0023\"" - + "#/v3/{name=projects/*}/alertPolicies:\014al" - + "ert_policy\332A\021name,alert_policy\022\221\001\n\021Delet" - + "eAlertPolicy\022..google.monitoring.v3.Dele" - + "teAlertPolicyRequest\032\026.google.protobuf.E" - + "mpty\"4\202\323\344\223\002\'*%/v3/{name=projects/*/alert" - + "Policies/*}\332A\004name\022\313\001\n\021UpdateAlertPolicy" - + "\022..google.monitoring.v3.UpdateAlertPolic" - + "yRequest\032!.google.monitoring.v3.AlertPol" - + "icy\"c\202\323\344\223\002B22/v3/{alert_policy.name=proj" - + "ects/*/alertPolicies/*}:\014alert_policy\332A\030" - + "update_mask,alert_policy\032\251\001\312A\031monitoring" - + ".googleapis.com\322A\211\001https://www.googleapi" - + "s.com/auth/cloud-platform,https://www.go" - + "ogleapis.com/auth/monitoring,https://www" - + ".googleapis.com/auth/monitoring.readB\311\001\n" - + "\030com.google.monitoring.v3B\021AlertServiceP" - + "rotoP\001Z>google.golang.org/genproto/googl" - + "eapis/monitoring/v3;monitoring\252\002\032Google." - + "Cloud.Monitoring.V3\312\002\032Google\\Cloud\\Monit" - + "oring\\V3\352\002\035Google::Cloud::Monitoring::V3" - + "b\006proto3" + + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\203\001" + + "\n\031ListAlertPoliciesResponse\0229\n\016alert_pol" + + "icies\030\003 \003(\0132!.google.monitoring.v3.Alert" + + "Policy\022\027\n\017next_page_token\030\002 \001(\t\022\022\n\ntotal" + + "_size\030\004 \001(\005\"\211\001\n\030UpdateAlertPolicyRequest" + + "\022/\n\013update_mask\030\002 \001(\0132\032.google.protobuf." + + "FieldMask\022<\n\014alert_policy\030\003 \001(\0132!.google" + + ".monitoring.v3.AlertPolicyB\003\340A\002\"W\n\030Delet" + + "eAlertPolicyRequest\022;\n\004name\030\003 \001(\tB-\340A\002\372A" + + "\'\n%monitoring.googleapis.com/AlertPolicy" + + "2\236\010\n\022AlertPolicyService\022\250\001\n\021ListAlertPol" + + "icies\022..google.monitoring.v3.ListAlertPo" + + "liciesRequest\032/.google.monitoring.v3.Lis" + + "tAlertPoliciesResponse\"2\202\323\344\223\002%\022#/v3/{nam" + + "e=projects/*}/alertPolicies\332A\004name\022\226\001\n\016G" + + "etAlertPolicy\022+.google.monitoring.v3.Get" + + "AlertPolicyRequest\032!.google.monitoring.v" + + "3.AlertPolicy\"4\202\323\344\223\002\'\022%/v3/{name=project" + + "s/*/alertPolicies/*}\332A\004name\022\265\001\n\021CreateAl" + + "ertPolicy\022..google.monitoring.v3.CreateA" + + "lertPolicyRequest\032!.google.monitoring.v3" + + ".AlertPolicy\"M\202\323\344\223\0023\"#/v3/{name=projects" + + "/*}/alertPolicies:\014alert_policy\332A\021name,a" + + "lert_policy\022\221\001\n\021DeleteAlertPolicy\022..goog" + + "le.monitoring.v3.DeleteAlertPolicyReques" + + "t\032\026.google.protobuf.Empty\"4\202\323\344\223\002\'*%/v3/{" + + "name=projects/*/alertPolicies/*}\332A\004name\022" + + "\313\001\n\021UpdateAlertPolicy\022..google.monitorin" + + "g.v3.UpdateAlertPolicyRequest\032!.google.m" + + "onitoring.v3.AlertPolicy\"c\202\323\344\223\002B22/v3/{a" + + "lert_policy.name=projects/*/alertPolicie" + + "s/*}:\014alert_policy\332A\030update_mask,alert_p" + + "olicy\032\251\001\312A\031monitoring.googleapis.com\322A\211\001" + + "https://www.googleapis.com/auth/cloud-pl" + + "atform,https://www.googleapis.com/auth/m" + + "onitoring,https://www.googleapis.com/aut" + + "h/monitoring.readB\311\001\n\030com.google.monitor" + + "ing.v3B\021AlertServiceProtoP\001Z>google.gola" + + "ng.org/genproto/googleapis/monitoring/v3" + + ";monitoring\252\002\032Google.Cloud.Monitoring.V3" + + "\312\002\032Google\\Cloud\\Monitoring\\V3\352\002\035Google::" + + "Cloud::Monitoring::V3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -161,7 +161,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_ListAlertPoliciesResponse_descriptor, new java.lang.String[] { - "AlertPolicies", "NextPageToken", + "AlertPolicies", "NextPageToken", "TotalSize", }); internal_static_google_monitoring_v3_UpdateAlertPolicyRequest_descriptor = getDescriptor().getMessageTypes().get(4); diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequest.java index 021ea54f..2ea5e5ad 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequest.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequest.java @@ -136,10 +136,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Required. The project in which to create the alerting policy. The format is: * projects/[PROJECT_ID_OR_NUMBER] * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. The alerting - * policy that is returned will have a name that contains a normalized - * representation of this name as a prefix but adds a suffix of the form - * `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * @@ -168,10 +169,11 @@ public java.lang.String getName() { * Required. The project in which to create the alerting policy. The format is: * projects/[PROJECT_ID_OR_NUMBER] * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. The alerting - * policy that is returned will have a name that contains a normalized - * representation of this name as a prefix but adds a suffix of the form - * `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * @@ -608,10 +610,11 @@ public Builder mergeFrom( * Required. The project in which to create the alerting policy. The format is: * projects/[PROJECT_ID_OR_NUMBER] * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. The alerting - * policy that is returned will have a name that contains a normalized - * representation of this name as a prefix but adds a suffix of the form - * `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * @@ -639,10 +642,11 @@ public java.lang.String getName() { * Required. The project in which to create the alerting policy. The format is: * projects/[PROJECT_ID_OR_NUMBER] * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. The alerting - * policy that is returned will have a name that contains a normalized - * representation of this name as a prefix but adds a suffix of the form - * `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * @@ -670,10 +674,11 @@ public com.google.protobuf.ByteString getNameBytes() { * Required. The project in which to create the alerting policy. The format is: * projects/[PROJECT_ID_OR_NUMBER] * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. The alerting - * policy that is returned will have a name that contains a normalized - * representation of this name as a prefix but adds a suffix of the form - * `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * @@ -700,10 +705,11 @@ public Builder setName(java.lang.String value) { * Required. The project in which to create the alerting policy. The format is: * projects/[PROJECT_ID_OR_NUMBER] * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. The alerting - * policy that is returned will have a name that contains a normalized - * representation of this name as a prefix but adds a suffix of the form - * `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * @@ -726,10 +732,11 @@ public Builder clearName() { * Required. The project in which to create the alerting policy. The format is: * projects/[PROJECT_ID_OR_NUMBER] * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. The alerting - * policy that is returned will have a name that contains a normalized - * representation of this name as a prefix but adds a suffix of the form - * `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequestOrBuilder.java index d80cf304..05758139 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequestOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateAlertPolicyRequestOrBuilder.java @@ -30,10 +30,11 @@ public interface CreateAlertPolicyRequestOrBuilder * Required. The project in which to create the alerting policy. The format is: * projects/[PROJECT_ID_OR_NUMBER] * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. The alerting - * policy that is returned will have a name that contains a normalized - * representation of this name as a prefix but adds a suffix of the form - * `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * @@ -51,10 +52,11 @@ public interface CreateAlertPolicyRequestOrBuilder * Required. The project in which to create the alerting policy. The format is: * projects/[PROJECT_ID_OR_NUMBER] * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. The alerting - * policy that is returned will have a name that contains a normalized - * representation of this name as a prefix but adds a suffix of the form - * `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabels.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabels.java index dd8d95ad..80c27efd 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabels.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabels.java @@ -22,15 +22,16 @@ * * *
- * A set of (label, value) pairs which were dropped during aggregation, attached
- * to google.api.Distribution.Exemplars in google.api.Distribution values during
- * aggregation.
- * These values are used in combination with the label values that remain on the
- * aggregated Distribution timeseries to construct the full label set for the
- * exemplar values.  The resulting full label set may be used to identify the
- * specific task/job/instance (for example) which may be contributing to a
- * long-tail, while allowing the storage savings of only storing aggregated
- * distribution values for a large group.
+ * A set of (label, value) pairs that were removed from a Distribution
+ * time series during aggregation and then added as an attachment to a
+ * Distribution.Exemplar.
+ * The full label set for the exemplars is constructed by using the dropped
+ * pairs in combination with the label values that remain on the aggregated
+ * Distribution time series. The constructed full label set can be used to
+ * identify the specific entity, such as the instance or job, which might be
+ * contributing to a long-tail. However, with dropped labels, the storage
+ * requirements are reduced because only the aggregated distribution values for
+ * a large group of time series are stored.
  * Note that there are no guarantees on ordering of the labels from
  * exemplar-to-exemplar and from distribution-to-distribution in the same
  * stream, and there may be duplicates.  It is up to clients to resolve any
@@ -407,15 +408,16 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
    *
    *
    * 
-   * A set of (label, value) pairs which were dropped during aggregation, attached
-   * to google.api.Distribution.Exemplars in google.api.Distribution values during
-   * aggregation.
-   * These values are used in combination with the label values that remain on the
-   * aggregated Distribution timeseries to construct the full label set for the
-   * exemplar values.  The resulting full label set may be used to identify the
-   * specific task/job/instance (for example) which may be contributing to a
-   * long-tail, while allowing the storage savings of only storing aggregated
-   * distribution values for a large group.
+   * A set of (label, value) pairs that were removed from a Distribution
+   * time series during aggregation and then added as an attachment to a
+   * Distribution.Exemplar.
+   * The full label set for the exemplars is constructed by using the dropped
+   * pairs in combination with the label values that remain on the aggregated
+   * Distribution time series. The constructed full label set can be used to
+   * identify the specific entity, such as the instance or job, which might be
+   * contributing to a long-tail. However, with dropped labels, the storage
+   * requirements are reduced because only the aggregated distribution values for
+   * a large group of time series are stored.
    * Note that there are no guarantees on ordering of the labels from
    * exemplar-to-exemplar and from distribution-to-distribution in the same
    * stream, and there may be duplicates.  It is up to clients to resolve any
diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesResponse.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesResponse.java
index 40e5bc03..d53d8d6c 100644
--- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesResponse.java
+++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesResponse.java
@@ -90,6 +90,11 @@ private ListAlertPoliciesResponse(
                       com.google.monitoring.v3.AlertPolicy.parser(), extensionRegistry));
               break;
             }
+          case 32:
+            {
+              totalSize_ = input.readInt32();
+              break;
+            }
           default:
             {
               if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
@@ -249,6 +254,25 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() {
     }
   }
 
+  public static final int TOTAL_SIZE_FIELD_NUMBER = 4;
+  private int totalSize_;
+  /**
+   *
+   *
+   * 
+   * The total number of alert policies in all pages. This number is only an
+   * estimate, and may change in subsequent pages. https://aip.dev/158
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -269,6 +293,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < alertPolicies_.size(); i++) { output.writeMessage(3, alertPolicies_.get(i)); } + if (totalSize_ != 0) { + output.writeInt32(4, totalSize_); + } unknownFields.writeTo(output); } @@ -284,6 +311,9 @@ public int getSerializedSize() { for (int i = 0; i < alertPolicies_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, alertPolicies_.get(i)); } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, totalSize_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -302,6 +332,7 @@ public boolean equals(final java.lang.Object obj) { if (!getAlertPoliciesList().equals(other.getAlertPoliciesList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (getTotalSize() != other.getTotalSize()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -319,6 +350,8 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -474,6 +507,8 @@ public Builder clear() { } nextPageToken_ = ""; + totalSize_ = 0; + return this; } @@ -512,6 +547,7 @@ public com.google.monitoring.v3.ListAlertPoliciesResponse buildPartial() { result.alertPolicies_ = alertPoliciesBuilder_.build(); } result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; onBuilt(); return result; } @@ -593,6 +629,9 @@ public Builder mergeFrom(com.google.monitoring.v3.ListAlertPoliciesResponse othe nextPageToken_ = other.nextPageToken_; onChanged(); } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1094,6 +1133,61 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { return this; } + private int totalSize_; + /** + * + * + *
+     * The total number of alert policies in all pages. This number is only an
+     * estimate, and may change in subsequent pages. https://aip.dev/158
+     * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total number of alert policies in all pages. This number is only an
+     * estimate, and may change in subsequent pages. https://aip.dev/158
+     * 
+ * + * int32 total_size = 4; + * + * @param value The totalSize to set. + * @return This builder for chaining. + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of alert policies in all pages. This number is only an
+     * estimate, and may change in subsequent pages. https://aip.dev/158
+     * 
+ * + * int32 total_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesResponseOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesResponseOrBuilder.java index 571336aa..73201de7 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesResponseOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListAlertPoliciesResponseOrBuilder.java @@ -103,4 +103,18 @@ public interface ListAlertPoliciesResponseOrBuilder * @return The bytes for nextPageToken. */ com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total number of alert policies in all pages. This number is only an
+   * estimate, and may change in subsequent pages. https://aip.dev/158
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + int getTotalSize(); } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsResponse.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsResponse.java index bddb85ef..61a30191 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsResponse.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsResponse.java @@ -92,6 +92,11 @@ private ListNotificationChannelsResponse( com.google.monitoring.v3.NotificationChannel.parser(), extensionRegistry)); break; } + case 32: + { + totalSize_ = input.readInt32(); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -255,6 +260,25 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { } } + public static final int TOTAL_SIZE_FIELD_NUMBER = 4; + private int totalSize_; + /** + * + * + *
+   * The total number of notification channels in all pages. This number is only
+   * an estimate, and may change in subsequent pages. https://aip.dev/158
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -275,6 +299,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < notificationChannels_.size(); i++) { output.writeMessage(3, notificationChannels_.get(i)); } + if (totalSize_ != 0) { + output.writeInt32(4, totalSize_); + } unknownFields.writeTo(output); } @@ -291,6 +318,9 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, notificationChannels_.get(i)); } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, totalSize_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -309,6 +339,7 @@ public boolean equals(final java.lang.Object obj) { if (!getNotificationChannelsList().equals(other.getNotificationChannelsList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (getTotalSize() != other.getTotalSize()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -326,6 +357,8 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -482,6 +515,8 @@ public Builder clear() { } nextPageToken_ = ""; + totalSize_ = 0; + return this; } @@ -520,6 +555,7 @@ public com.google.monitoring.v3.ListNotificationChannelsResponse buildPartial() result.notificationChannels_ = notificationChannelsBuilder_.build(); } result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; onBuilt(); return result; } @@ -601,6 +637,9 @@ public Builder mergeFrom(com.google.monitoring.v3.ListNotificationChannelsRespon nextPageToken_ = other.nextPageToken_; onChanged(); } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1115,6 +1154,61 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { return this; } + private int totalSize_; + /** + * + * + *
+     * The total number of notification channels in all pages. This number is only
+     * an estimate, and may change in subsequent pages. https://aip.dev/158
+     * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total number of notification channels in all pages. This number is only
+     * an estimate, and may change in subsequent pages. https://aip.dev/158
+     * 
+ * + * int32 total_size = 4; + * + * @param value The totalSize to set. + * @return This builder for chaining. + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of notification channels in all pages. This number is only
+     * an estimate, and may change in subsequent pages. https://aip.dev/158
+     * 
+ * + * int32 total_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsResponseOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsResponseOrBuilder.java index 10333ef1..8ad8b33f 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsResponseOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListNotificationChannelsResponseOrBuilder.java @@ -105,4 +105,18 @@ public interface ListNotificationChannelsResponseOrBuilder * @return The bytes for nextPageToken. */ com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total number of notification channels in all pages. This number is only
+   * an estimate, and may change in subsequent pages. https://aip.dev/158
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + int getTotalSize(); } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesRequest.java index 56aa3324..e9acead0 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesRequest.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesRequest.java @@ -201,15 +201,19 @@ public com.google.protobuf.ByteString getParentBytes() { * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) * `identifier_case` refers to which option in the identifier oneof is * populated. For example, the filter `identifier_case = "CUSTOM"` would match * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). *
* * string filter = 2; @@ -236,15 +240,19 @@ public java.lang.String getFilter() { * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) * `identifier_case` refers to which option in the identifier oneof is * populated. For example, the filter `identifier_case = "CUSTOM"` would match * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). *
* * string filter = 2; @@ -839,15 +847,19 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) * `identifier_case` refers to which option in the identifier oneof is * populated. For example, the filter `identifier_case = "CUSTOM"` would match * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * * * string filter = 2; @@ -873,15 +885,19 @@ public java.lang.String getFilter() { * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) * `identifier_case` refers to which option in the identifier oneof is * populated. For example, the filter `identifier_case = "CUSTOM"` would match * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * * * string filter = 2; @@ -907,15 +923,19 @@ public com.google.protobuf.ByteString getFilterBytes() { * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) * `identifier_case` refers to which option in the identifier oneof is * populated. For example, the filter `identifier_case = "CUSTOM"` would match * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * * * string filter = 2; @@ -940,15 +960,19 @@ public Builder setFilter(java.lang.String value) { * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) * `identifier_case` refers to which option in the identifier oneof is * populated. For example, the filter `identifier_case = "CUSTOM"` would match * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * * * string filter = 2; @@ -969,15 +993,19 @@ public Builder clearFilter() { * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) * `identifier_case` refers to which option in the identifier oneof is * populated. For example, the filter `identifier_case = "CUSTOM"` would match * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * * * string filter = 2; diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesRequestOrBuilder.java index 1eee23ef..5babc09f 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesRequestOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesRequestOrBuilder.java @@ -66,15 +66,19 @@ public interface ListServicesRequestOrBuilder * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) * `identifier_case` refers to which option in the identifier oneof is * populated. For example, the filter `identifier_case = "CUSTOM"` would match * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * * * string filter = 2; @@ -90,15 +94,19 @@ public interface ListServicesRequestOrBuilder * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) * `identifier_case` refers to which option in the identifier oneof is * populated. For example, the filter `identifier_case = "CUSTOM"` would match * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * * * string filter = 2; diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesRequest.java index ab09c886..2a84e8a8 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesRequest.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesRequest.java @@ -144,6 +144,22 @@ private ListTimeSeriesRequest( java.lang.String s = input.readStringRequireUtf8(); name_ = s; + break; + } + case 90: + { + com.google.monitoring.v3.Aggregation.Builder subBuilder = null; + if (secondaryAggregation_ != null) { + subBuilder = secondaryAggregation_.toBuilder(); + } + secondaryAggregation_ = + input.readMessage( + com.google.monitoring.v3.Aggregation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(secondaryAggregation_); + secondaryAggregation_ = subBuilder.buildPartial(); + } + break; } default: @@ -325,8 +341,11 @@ private TimeSeriesView(int value) { * * *
-   * Required. The project on which to execute the request. The format is:
+   * Required. The project, organization or folder on which to execute the request. The
+   * format is:
    *     projects/[PROJECT_ID_OR_NUMBER]
+   *     organizations/[ORGANIZATION_ID]
+   *     folders/[FOLDER_ID]
    * 
* * @@ -351,8 +370,11 @@ public java.lang.String getName() { * * *
-   * Required. The project on which to execute the request. The format is:
+   * Required. The project, organization or folder on which to execute the request. The
+   * format is:
    *     projects/[PROJECT_ID_OR_NUMBER]
+   *     organizations/[ORGANIZATION_ID]
+   *     folders/[FOLDER_ID]
    * 
* * @@ -550,6 +572,57 @@ public com.google.monitoring.v3.AggregationOrBuilder getAggregationOrBuilder() { return getAggregation(); } + public static final int SECONDARY_AGGREGATION_FIELD_NUMBER = 11; + private com.google.monitoring.v3.Aggregation secondaryAggregation_; + /** + * + * + *
+   * Apply a second aggregation after `aggregation` is applied. May only be
+   * specified if `aggregation` is specified.
+   * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + * + * @return Whether the secondaryAggregation field is set. + */ + @java.lang.Override + public boolean hasSecondaryAggregation() { + return secondaryAggregation_ != null; + } + /** + * + * + *
+   * Apply a second aggregation after `aggregation` is applied. May only be
+   * specified if `aggregation` is specified.
+   * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + * + * @return The secondaryAggregation. + */ + @java.lang.Override + public com.google.monitoring.v3.Aggregation getSecondaryAggregation() { + return secondaryAggregation_ == null + ? com.google.monitoring.v3.Aggregation.getDefaultInstance() + : secondaryAggregation_; + } + /** + * + * + *
+   * Apply a second aggregation after `aggregation` is applied. May only be
+   * specified if `aggregation` is specified.
+   * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + */ + @java.lang.Override + public com.google.monitoring.v3.AggregationOrBuilder getSecondaryAggregationOrBuilder() { + return getSecondaryAggregation(); + } + public static final int ORDER_BY_FIELD_NUMBER = 6; private volatile java.lang.Object orderBy_; /** @@ -756,6 +829,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 10, name_); } + if (secondaryAggregation_ != null) { + output.writeMessage(11, getSecondaryAggregation()); + } unknownFields.writeTo(output); } @@ -789,6 +865,10 @@ public int getSerializedSize() { if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, name_); } + if (secondaryAggregation_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(11, getSecondaryAggregation()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -815,6 +895,10 @@ public boolean equals(final java.lang.Object obj) { if (hasAggregation()) { if (!getAggregation().equals(other.getAggregation())) return false; } + if (hasSecondaryAggregation() != other.hasSecondaryAggregation()) return false; + if (hasSecondaryAggregation()) { + if (!getSecondaryAggregation().equals(other.getSecondaryAggregation())) return false; + } if (!getOrderBy().equals(other.getOrderBy())) return false; if (view_ != other.view_) return false; if (getPageSize() != other.getPageSize()) return false; @@ -842,6 +926,10 @@ public int hashCode() { hash = (37 * hash) + AGGREGATION_FIELD_NUMBER; hash = (53 * hash) + getAggregation().hashCode(); } + if (hasSecondaryAggregation()) { + hash = (37 * hash) + SECONDARY_AGGREGATION_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryAggregation().hashCode(); + } hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; hash = (53 * hash) + getOrderBy().hashCode(); hash = (37 * hash) + VIEW_FIELD_NUMBER; @@ -1011,6 +1099,12 @@ public Builder clear() { aggregation_ = null; aggregationBuilder_ = null; } + if (secondaryAggregationBuilder_ == null) { + secondaryAggregation_ = null; + } else { + secondaryAggregation_ = null; + secondaryAggregationBuilder_ = null; + } orderBy_ = ""; view_ = 0; @@ -1058,6 +1152,11 @@ public com.google.monitoring.v3.ListTimeSeriesRequest buildPartial() { } else { result.aggregation_ = aggregationBuilder_.build(); } + if (secondaryAggregationBuilder_ == null) { + result.secondaryAggregation_ = secondaryAggregation_; + } else { + result.secondaryAggregation_ = secondaryAggregationBuilder_.build(); + } result.orderBy_ = orderBy_; result.view_ = view_; result.pageSize_ = pageSize_; @@ -1125,6 +1224,9 @@ public Builder mergeFrom(com.google.monitoring.v3.ListTimeSeriesRequest other) { if (other.hasAggregation()) { mergeAggregation(other.getAggregation()); } + if (other.hasSecondaryAggregation()) { + mergeSecondaryAggregation(other.getSecondaryAggregation()); + } if (!other.getOrderBy().isEmpty()) { orderBy_ = other.orderBy_; onChanged(); @@ -1173,8 +1275,11 @@ public Builder mergeFrom( * * *
-     * Required. The project on which to execute the request. The format is:
+     * Required. The project, organization or folder on which to execute the request. The
+     * format is:
      *     projects/[PROJECT_ID_OR_NUMBER]
+     *     organizations/[ORGANIZATION_ID]
+     *     folders/[FOLDER_ID]
      * 
* * @@ -1198,8 +1303,11 @@ public java.lang.String getName() { * * *
-     * Required. The project on which to execute the request. The format is:
+     * Required. The project, organization or folder on which to execute the request. The
+     * format is:
      *     projects/[PROJECT_ID_OR_NUMBER]
+     *     organizations/[ORGANIZATION_ID]
+     *     folders/[FOLDER_ID]
      * 
* * @@ -1223,8 +1331,11 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The project on which to execute the request. The format is:
+     * Required. The project, organization or folder on which to execute the request. The
+     * format is:
      *     projects/[PROJECT_ID_OR_NUMBER]
+     *     organizations/[ORGANIZATION_ID]
+     *     folders/[FOLDER_ID]
      * 
* * @@ -1247,8 +1358,11 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The project on which to execute the request. The format is:
+     * Required. The project, organization or folder on which to execute the request. The
+     * format is:
      *     projects/[PROJECT_ID_OR_NUMBER]
+     *     organizations/[ORGANIZATION_ID]
+     *     folders/[FOLDER_ID]
      * 
* * @@ -1267,8 +1381,11 @@ public Builder clearName() { * * *
-     * Required. The project on which to execute the request. The format is:
+     * Required. The project, organization or folder on which to execute the request. The
+     * format is:
      *     projects/[PROJECT_ID_OR_NUMBER]
+     *     organizations/[ORGANIZATION_ID]
+     *     folders/[FOLDER_ID]
      * 
* * @@ -1853,6 +1970,201 @@ public com.google.monitoring.v3.AggregationOrBuilder getAggregationOrBuilder() { return aggregationBuilder_; } + private com.google.monitoring.v3.Aggregation secondaryAggregation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder> + secondaryAggregationBuilder_; + /** + * + * + *
+     * Apply a second aggregation after `aggregation` is applied. May only be
+     * specified if `aggregation` is specified.
+     * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + * + * @return Whether the secondaryAggregation field is set. + */ + public boolean hasSecondaryAggregation() { + return secondaryAggregationBuilder_ != null || secondaryAggregation_ != null; + } + /** + * + * + *
+     * Apply a second aggregation after `aggregation` is applied. May only be
+     * specified if `aggregation` is specified.
+     * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + * + * @return The secondaryAggregation. + */ + public com.google.monitoring.v3.Aggregation getSecondaryAggregation() { + if (secondaryAggregationBuilder_ == null) { + return secondaryAggregation_ == null + ? com.google.monitoring.v3.Aggregation.getDefaultInstance() + : secondaryAggregation_; + } else { + return secondaryAggregationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Apply a second aggregation after `aggregation` is applied. May only be
+     * specified if `aggregation` is specified.
+     * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + */ + public Builder setSecondaryAggregation(com.google.monitoring.v3.Aggregation value) { + if (secondaryAggregationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + secondaryAggregation_ = value; + onChanged(); + } else { + secondaryAggregationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Apply a second aggregation after `aggregation` is applied. May only be
+     * specified if `aggregation` is specified.
+     * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + */ + public Builder setSecondaryAggregation( + com.google.monitoring.v3.Aggregation.Builder builderForValue) { + if (secondaryAggregationBuilder_ == null) { + secondaryAggregation_ = builderForValue.build(); + onChanged(); + } else { + secondaryAggregationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Apply a second aggregation after `aggregation` is applied. May only be
+     * specified if `aggregation` is specified.
+     * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + */ + public Builder mergeSecondaryAggregation(com.google.monitoring.v3.Aggregation value) { + if (secondaryAggregationBuilder_ == null) { + if (secondaryAggregation_ != null) { + secondaryAggregation_ = + com.google.monitoring.v3.Aggregation.newBuilder(secondaryAggregation_) + .mergeFrom(value) + .buildPartial(); + } else { + secondaryAggregation_ = value; + } + onChanged(); + } else { + secondaryAggregationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Apply a second aggregation after `aggregation` is applied. May only be
+     * specified if `aggregation` is specified.
+     * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + */ + public Builder clearSecondaryAggregation() { + if (secondaryAggregationBuilder_ == null) { + secondaryAggregation_ = null; + onChanged(); + } else { + secondaryAggregation_ = null; + secondaryAggregationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Apply a second aggregation after `aggregation` is applied. May only be
+     * specified if `aggregation` is specified.
+     * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + */ + public com.google.monitoring.v3.Aggregation.Builder getSecondaryAggregationBuilder() { + + onChanged(); + return getSecondaryAggregationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Apply a second aggregation after `aggregation` is applied. May only be
+     * specified if `aggregation` is specified.
+     * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + */ + public com.google.monitoring.v3.AggregationOrBuilder getSecondaryAggregationOrBuilder() { + if (secondaryAggregationBuilder_ != null) { + return secondaryAggregationBuilder_.getMessageOrBuilder(); + } else { + return secondaryAggregation_ == null + ? com.google.monitoring.v3.Aggregation.getDefaultInstance() + : secondaryAggregation_; + } + } + /** + * + * + *
+     * Apply a second aggregation after `aggregation` is applied. May only be
+     * specified if `aggregation` is specified.
+     * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder> + getSecondaryAggregationFieldBuilder() { + if (secondaryAggregationBuilder_ == null) { + secondaryAggregationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Aggregation, + com.google.monitoring.v3.Aggregation.Builder, + com.google.monitoring.v3.AggregationOrBuilder>( + getSecondaryAggregation(), getParentForChildren(), isClean()); + secondaryAggregation_ = null; + } + return secondaryAggregationBuilder_; + } + private java.lang.Object orderBy_ = ""; /** * diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesRequestOrBuilder.java index 56639e43..904ddb52 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesRequestOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesRequestOrBuilder.java @@ -27,8 +27,11 @@ public interface ListTimeSeriesRequestOrBuilder * * *
-   * Required. The project on which to execute the request. The format is:
+   * Required. The project, organization or folder on which to execute the request. The
+   * format is:
    *     projects/[PROJECT_ID_OR_NUMBER]
+   *     organizations/[ORGANIZATION_ID]
+   *     folders/[FOLDER_ID]
    * 
* * @@ -42,8 +45,11 @@ public interface ListTimeSeriesRequestOrBuilder * * *
-   * Required. The project on which to execute the request. The format is:
+   * Required. The project, organization or folder on which to execute the request. The
+   * format is:
    *     projects/[PROJECT_ID_OR_NUMBER]
+   *     organizations/[ORGANIZATION_ID]
+   *     folders/[FOLDER_ID]
    * 
* * @@ -180,6 +186,44 @@ public interface ListTimeSeriesRequestOrBuilder */ com.google.monitoring.v3.AggregationOrBuilder getAggregationOrBuilder(); + /** + * + * + *
+   * Apply a second aggregation after `aggregation` is applied. May only be
+   * specified if `aggregation` is specified.
+   * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + * + * @return Whether the secondaryAggregation field is set. + */ + boolean hasSecondaryAggregation(); + /** + * + * + *
+   * Apply a second aggregation after `aggregation` is applied. May only be
+   * specified if `aggregation` is specified.
+   * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + * + * @return The secondaryAggregation. + */ + com.google.monitoring.v3.Aggregation getSecondaryAggregation(); + /** + * + * + *
+   * Apply a second aggregation after `aggregation` is applied. May only be
+   * specified if `aggregation` is specified.
+   * 
+ * + * .google.monitoring.v3.Aggregation secondary_aggregation = 11; + */ + com.google.monitoring.v3.AggregationOrBuilder getSecondaryAggregationOrBuilder(); + /** * * diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesResponse.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesResponse.java index 5ec4d7f3..3de9c35c 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesResponse.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesResponse.java @@ -41,6 +41,7 @@ private ListTimeSeriesResponse() { timeSeries_ = java.util.Collections.emptyList(); nextPageToken_ = ""; executionErrors_ = java.util.Collections.emptyList(); + unit_ = ""; } @java.lang.Override @@ -101,6 +102,13 @@ private ListTimeSeriesResponse( input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); break; } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + unit_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -337,6 +345,65 @@ public com.google.rpc.StatusOrBuilder getExecutionErrorsOrBuilder(int index) { return executionErrors_.get(index); } + public static final int UNIT_FIELD_NUMBER = 5; + private volatile java.lang.Object unit_; + /** + * + * + *
+   * The unit in which all `time_series` point values are reported. `unit`
+   * follows the UCUM format for units as seen in
+   * https://unitsofmeasure.org/ucum.html.
+   * If different `time_series` have different units (for example, because they
+   * come from different metric types, or a unit is absent), then `unit` will be
+   * "{not_a_unit}".
+   * 
+ * + * string unit = 5; + * + * @return The unit. + */ + @java.lang.Override + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + 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(); + unit_ = s; + return s; + } + } + /** + * + * + *
+   * The unit in which all `time_series` point values are reported. `unit`
+   * follows the UCUM format for units as seen in
+   * https://unitsofmeasure.org/ucum.html.
+   * If different `time_series` have different units (for example, because they
+   * come from different metric types, or a unit is absent), then `unit` will be
+   * "{not_a_unit}".
+   * 
+ * + * string unit = 5; + * + * @return The bytes for unit. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -360,6 +427,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < executionErrors_.size(); i++) { output.writeMessage(3, executionErrors_.get(i)); } + if (!getUnitBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, unit_); + } unknownFields.writeTo(output); } @@ -378,6 +448,9 @@ public int getSerializedSize() { for (int i = 0; i < executionErrors_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, executionErrors_.get(i)); } + if (!getUnitBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, unit_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -397,6 +470,7 @@ public boolean equals(final java.lang.Object obj) { if (!getTimeSeriesList().equals(other.getTimeSeriesList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; if (!getExecutionErrorsList().equals(other.getExecutionErrorsList())) return false; + if (!getUnit().equals(other.getUnit())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -418,6 +492,8 @@ public int hashCode() { hash = (37 * hash) + EXECUTION_ERRORS_FIELD_NUMBER; hash = (53 * hash) + getExecutionErrorsList().hashCode(); } + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -580,6 +656,8 @@ public Builder clear() { } else { executionErrorsBuilder_.clear(); } + unit_ = ""; + return this; } @@ -627,6 +705,7 @@ public com.google.monitoring.v3.ListTimeSeriesResponse buildPartial() { } else { result.executionErrors_ = executionErrorsBuilder_.build(); } + result.unit_ = unit_; onBuilt(); return result; } @@ -735,6 +814,10 @@ public Builder mergeFrom(com.google.monitoring.v3.ListTimeSeriesResponse other) } } } + if (!other.getUnit().isEmpty()) { + unit_ = other.unit_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1593,6 +1676,137 @@ public java.util.List getExecutionErrorsBuilderLi return executionErrorsBuilder_; } + private java.lang.Object unit_ = ""; + /** + * + * + *
+     * The unit in which all `time_series` point values are reported. `unit`
+     * follows the UCUM format for units as seen in
+     * https://unitsofmeasure.org/ucum.html.
+     * If different `time_series` have different units (for example, because they
+     * come from different metric types, or a unit is absent), then `unit` will be
+     * "{not_a_unit}".
+     * 
+ * + * string unit = 5; + * + * @return The unit. + */ + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + unit_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unit in which all `time_series` point values are reported. `unit`
+     * follows the UCUM format for units as seen in
+     * https://unitsofmeasure.org/ucum.html.
+     * If different `time_series` have different units (for example, because they
+     * come from different metric types, or a unit is absent), then `unit` will be
+     * "{not_a_unit}".
+     * 
+ * + * string unit = 5; + * + * @return The bytes for unit. + */ + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unit in which all `time_series` point values are reported. `unit`
+     * follows the UCUM format for units as seen in
+     * https://unitsofmeasure.org/ucum.html.
+     * If different `time_series` have different units (for example, because they
+     * come from different metric types, or a unit is absent), then `unit` will be
+     * "{not_a_unit}".
+     * 
+ * + * string unit = 5; + * + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + unit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unit in which all `time_series` point values are reported. `unit`
+     * follows the UCUM format for units as seen in
+     * https://unitsofmeasure.org/ucum.html.
+     * If different `time_series` have different units (for example, because they
+     * come from different metric types, or a unit is absent), then `unit` will be
+     * "{not_a_unit}".
+     * 
+ * + * string unit = 5; + * + * @return This builder for chaining. + */ + public Builder clearUnit() { + + unit_ = getDefaultInstance().getUnit(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unit in which all `time_series` point values are reported. `unit`
+     * follows the UCUM format for units as seen in
+     * https://unitsofmeasure.org/ucum.html.
+     * If different `time_series` have different units (for example, because they
+     * come from different metric types, or a unit is absent), then `unit` will be
+     * "{not_a_unit}".
+     * 
+ * + * string unit = 5; + * + * @param value The bytes for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + unit_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesResponseOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesResponseOrBuilder.java index 41cf19cc..b10a78bf 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesResponseOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListTimeSeriesResponseOrBuilder.java @@ -159,4 +159,39 @@ public interface ListTimeSeriesResponseOrBuilder * repeated .google.rpc.Status execution_errors = 3; */ com.google.rpc.StatusOrBuilder getExecutionErrorsOrBuilder(int index); + + /** + * + * + *
+   * The unit in which all `time_series` point values are reported. `unit`
+   * follows the UCUM format for units as seen in
+   * https://unitsofmeasure.org/ucum.html.
+   * If different `time_series` have different units (for example, because they
+   * come from different metric types, or a unit is absent), then `unit` will be
+   * "{not_a_unit}".
+   * 
+ * + * string unit = 5; + * + * @return The unit. + */ + java.lang.String getUnit(); + /** + * + * + *
+   * The unit in which all `time_series` point values are reported. `unit`
+   * follows the UCUM format for units as seen in
+   * https://unitsofmeasure.org/ucum.html.
+   * If different `time_series` have different units (for example, because they
+   * come from different metric types, or a unit is absent), then `unit` will be
+   * "{not_a_unit}".
+   * 
+ * + * string unit = 5; + * + * @return The bytes for unit. + */ + com.google.protobuf.ByteString getUnitBytes(); } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricProto.java index ad1ec2c8..a460ab83 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricProto.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricProto.java @@ -84,7 +84,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "mon.proto\032\036google/protobuf/duration.prot" + "o\"n\n\005Point\0224\n\010interval\030\001 \001(\0132\".google.mo" + "nitoring.v3.TimeInterval\022/\n\005value\030\002 \001(\0132" - + " .google.monitoring.v3.TypedValue\"\301\002\n\nTi" + + " .google.monitoring.v3.TypedValue\"\317\002\n\nTi" + "meSeries\022\"\n\006metric\030\001 \001(\0132\022.google.api.Me" + "tric\022/\n\010resource\030\002 \001(\0132\035.google.api.Moni" + "toredResource\0227\n\010metadata\030\007 \001(\0132%.google" @@ -92,39 +92,40 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "_kind\030\003 \001(\0162\'.google.api.MetricDescripto" + "r.MetricKind\022:\n\nvalue_type\030\004 \001(\0162&.googl" + "e.api.MetricDescriptor.ValueType\022+\n\006poin" - + "ts\030\005 \003(\0132\033.google.monitoring.v3.Point\"\300\002" - + "\n\024TimeSeriesDescriptor\0226\n\021label_descript" - + "ors\030\001 \003(\0132\033.google.api.LabelDescriptor\022U" - + "\n\021point_descriptors\030\005 \003(\0132:.google.monit" - + "oring.v3.TimeSeriesDescriptor.ValueDescr" - + "iptor\032\230\001\n\017ValueDescriptor\022\013\n\003key\030\001 \001(\t\022:" - + "\n\nvalue_type\030\002 \001(\0162&.google.api.MetricDe" - + "scriptor.ValueType\022<\n\013metric_kind\030\003 \001(\0162" - + "\'.google.api.MetricDescriptor.MetricKind" - + "\"\206\002\n\016TimeSeriesData\0226\n\014label_values\030\001 \003(" - + "\0132 .google.monitoring.v3.LabelValue\022B\n\np" - + "oint_data\030\002 \003(\0132..google.monitoring.v3.T" - + "imeSeriesData.PointData\032x\n\tPointData\0220\n\006" - + "values\030\001 \003(\0132 .google.monitoring.v3.Type" - + "dValue\0229\n\rtime_interval\030\002 \001(\0132\".google.m" - + "onitoring.v3.TimeInterval\"Z\n\nLabelValue\022" - + "\024\n\nbool_value\030\001 \001(\010H\000\022\025\n\013int64_value\030\002 \001" - + "(\003H\000\022\026\n\014string_value\030\003 \001(\tH\000B\007\n\005value\"Q\n" - + "\nQueryError\0222\n\007locator\030\001 \001(\0132!.google.mo" - + "nitoring.v3.TextLocator\022\017\n\007message\030\002 \001(\t" - + "\"\240\002\n\013TextLocator\022\016\n\006source\030\001 \001(\t\022B\n\016star" - + "t_position\030\002 \001(\0132*.google.monitoring.v3." - + "TextLocator.Position\022@\n\014end_position\030\003 \001" - + "(\0132*.google.monitoring.v3.TextLocator.Po" - + "sition\0229\n\016nested_locator\030\004 \001(\0132!.google." - + "monitoring.v3.TextLocator\022\026\n\016nesting_rea" - + "son\030\005 \001(\t\032(\n\010Position\022\014\n\004line\030\001 \001(\005\022\016\n\006c" - + "olumn\030\002 \001(\005B\303\001\n\030com.google.monitoring.v3" - + "B\013MetricProtoP\001Z>google.golang.org/genpr" - + "oto/googleapis/monitoring/v3;monitoring\252" - + "\002\032Google.Cloud.Monitoring.V3\312\002\032Google\\Cl" - + "oud\\Monitoring\\V3\352\002\035Google::Cloud::Monit" - + "oring::V3b\006proto3" + + "ts\030\005 \003(\0132\033.google.monitoring.v3.Point\022\014\n" + + "\004unit\030\010 \001(\t\"\316\002\n\024TimeSeriesDescriptor\0226\n\021" + + "label_descriptors\030\001 \003(\0132\033.google.api.Lab" + + "elDescriptor\022U\n\021point_descriptors\030\005 \003(\0132" + + ":.google.monitoring.v3.TimeSeriesDescrip" + + "tor.ValueDescriptor\032\246\001\n\017ValueDescriptor\022" + + "\013\n\003key\030\001 \001(\t\022:\n\nvalue_type\030\002 \001(\0162&.googl" + + "e.api.MetricDescriptor.ValueType\022<\n\013metr" + + "ic_kind\030\003 \001(\0162\'.google.api.MetricDescrip" + + "tor.MetricKind\022\014\n\004unit\030\004 \001(\t\"\206\002\n\016TimeSer" + + "iesData\0226\n\014label_values\030\001 \003(\0132 .google.m" + + "onitoring.v3.LabelValue\022B\n\npoint_data\030\002 " + + "\003(\0132..google.monitoring.v3.TimeSeriesDat" + + "a.PointData\032x\n\tPointData\0220\n\006values\030\001 \003(\013" + + "2 .google.monitoring.v3.TypedValue\0229\n\rti" + + "me_interval\030\002 \001(\0132\".google.monitoring.v3" + + ".TimeInterval\"Z\n\nLabelValue\022\024\n\nbool_valu" + + "e\030\001 \001(\010H\000\022\025\n\013int64_value\030\002 \001(\003H\000\022\026\n\014stri" + + "ng_value\030\003 \001(\tH\000B\007\n\005value\"Q\n\nQueryError\022" + + "2\n\007locator\030\001 \001(\0132!.google.monitoring.v3." + + "TextLocator\022\017\n\007message\030\002 \001(\t\"\240\002\n\013TextLoc" + + "ator\022\016\n\006source\030\001 \001(\t\022B\n\016start_position\030\002" + + " \001(\0132*.google.monitoring.v3.TextLocator." + + "Position\022@\n\014end_position\030\003 \001(\0132*.google." + + "monitoring.v3.TextLocator.Position\0229\n\016ne" + + "sted_locator\030\004 \001(\0132!.google.monitoring.v" + + "3.TextLocator\022\026\n\016nesting_reason\030\005 \001(\t\032(\n" + + "\010Position\022\014\n\004line\030\001 \001(\005\022\016\n\006column\030\002 \001(\005B" + + "\303\001\n\030com.google.monitoring.v3B\013MetricProt" + + "oP\001Z>google.golang.org/genproto/googleap" + + "is/monitoring/v3;monitoring\252\002\032Google.Clo" + + "ud.Monitoring.V3\312\002\032Google\\Cloud\\Monitori" + + "ng\\V3\352\002\035Google::Cloud::Monitoring::V3b\006p" + + "roto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -151,7 +152,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_TimeSeries_descriptor, new java.lang.String[] { - "Metric", "Resource", "Metadata", "MetricKind", "ValueType", "Points", + "Metric", "Resource", "Metadata", "MetricKind", "ValueType", "Points", "Unit", }); internal_static_google_monitoring_v3_TimeSeriesDescriptor_descriptor = getDescriptor().getMessageTypes().get(2); @@ -169,7 +170,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_TimeSeriesDescriptor_ValueDescriptor_descriptor, new java.lang.String[] { - "Key", "ValueType", "MetricKind", + "Key", "ValueType", "MetricKind", "Unit", }); internal_static_google_monitoring_v3_TimeSeriesData_descriptor = getDescriptor().getMessageTypes().get(3); diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricServiceProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricServiceProto.java index 9d5c3a10..a024d932 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricServiceProto.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricServiceProto.java @@ -141,106 +141,117 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "2\034.google.api.MetricDescriptorB\003\340A\002\"a\n\035D" + "eleteMetricDescriptorRequest\022@\n\004name\030\003 \001" + "(\tB2\340A\002\372A,\n*monitoring.googleapis.com/Me" - + "tricDescriptor\"\223\003\n\025ListTimeSeriesRequest" - + "\022A\n\004name\030\n \001(\tB3\340A\002\372A-\n+cloudresourceman" - + "ager.googleapis.com/Project\022\023\n\006filter\030\002 " - + "\001(\tB\003\340A\002\0229\n\010interval\030\004 \001(\0132\".google.moni" - + "toring.v3.TimeIntervalB\003\340A\002\0226\n\013aggregati" - + "on\030\005 \001(\0132!.google.monitoring.v3.Aggregat" - + "ion\022\020\n\010order_by\030\006 \001(\t\022M\n\004view\030\007 \001(\0162:.go" - + "ogle.monitoring.v3.ListTimeSeriesRequest" - + ".TimeSeriesViewB\003\340A\002\022\021\n\tpage_size\030\010 \001(\005\022" - + "\022\n\npage_token\030\t \001(\t\"\'\n\016TimeSeriesView\022\010\n" - + "\004FULL\020\000\022\013\n\007HEADERS\020\001\"\226\001\n\026ListTimeSeriesR" - + "esponse\0225\n\013time_series\030\001 \003(\0132 .google.mo" - + "nitoring.v3.TimeSeries\022\027\n\017next_page_toke" - + "n\030\002 \001(\t\022,\n\020execution_errors\030\003 \003(\0132\022.goog" - + "le.rpc.Status\"\230\001\n\027CreateTimeSeriesReques" - + "t\022A\n\004name\030\003 \001(\tB3\340A\002\372A-\n+cloudresourcema" - + "nager.googleapis.com/Project\022:\n\013time_ser" - + "ies\030\002 \003(\0132 .google.monitoring.v3.TimeSer" - + "iesB\003\340A\002\"z\n\025CreateTimeSeriesError\0229\n\013tim" - + "e_series\030\001 \001(\0132 .google.monitoring.v3.Ti" - + "meSeriesB\002\030\001\022&\n\006status\030\002 \001(\0132\022.google.rp" - + "c.StatusB\002\030\001\"\330\001\n\027CreateTimeSeriesSummary" - + "\022\031\n\021total_point_count\030\001 \001(\005\022\033\n\023success_p" - + "oint_count\030\002 \001(\005\022C\n\006errors\030\003 \003(\01323.googl" - + "e.monitoring.v3.CreateTimeSeriesSummary." - + "Error\032@\n\005Error\022\"\n\006status\030\001 \001(\0132\022.google." - + "rpc.Status\022\023\n\013point_count\030\002 \001(\005\"\\\n\026Query" - + "TimeSeriesRequest\022\014\n\004name\030\001 \001(\t\022\r\n\005query" - + "\030\007 \001(\t\022\021\n\tpage_size\030\t \001(\005\022\022\n\npage_token\030" - + "\n \001(\t\"\352\001\n\027QueryTimeSeriesResponse\022J\n\026tim" - + "e_series_descriptor\030\010 \001(\0132*.google.monit" - + "oring.v3.TimeSeriesDescriptor\022>\n\020time_se" - + "ries_data\030\t \003(\0132$.google.monitoring.v3.T" - + "imeSeriesData\022\027\n\017next_page_token\030\n \001(\t\022*" - + "\n\016partial_errors\030\013 \003(\0132\022.google.rpc.Stat" - + "us\"Y\n\016QueryErrorList\0220\n\006errors\030\001 \003(\0132 .g" - + "oogle.monitoring.v3.QueryError\022\025\n\rerror_" - + "summary\030\002 \001(\t2\276\r\n\rMetricService\022\344\001\n List" - + "MonitoredResourceDescriptors\022=.google.mo" - + "nitoring.v3.ListMonitoredResourceDescrip" - + "torsRequest\032>.google.monitoring.v3.ListM" - + "onitoredResourceDescriptorsResponse\"A\202\323\344" - + "\223\0024\0222/v3/{name=projects/*}/monitoredReso" - + "urceDescriptors\332A\004name\022\314\001\n\036GetMonitoredR" - + "esourceDescriptor\022;.google.monitoring.v3" - + ".GetMonitoredResourceDescriptorRequest\032\'" - + ".google.api.MonitoredResourceDescriptor\"" - + "D\202\323\344\223\0027\0225/v3/{name=projects/*/monitoredR" - + "esourceDescriptors/**}\332A\004name\022\270\001\n\025ListMe" - + "tricDescriptors\0222.google.monitoring.v3.L" - + "istMetricDescriptorsRequest\0323.google.mon" - + "itoring.v3.ListMetricDescriptorsResponse" - + "\"6\202\323\344\223\002)\022\'/v3/{name=projects/*}/metricDe" - + "scriptors\332A\004name\022\240\001\n\023GetMetricDescriptor" - + "\0220.google.monitoring.v3.GetMetricDescrip" - + "torRequest\032\034.google.api.MetricDescriptor" - + "\"9\202\323\344\223\002,\022*/v3/{name=projects/*/metricDes" - + "criptors/**}\332A\004name\022\310\001\n\026CreateMetricDesc" - + "riptor\0223.google.monitoring.v3.CreateMetr" - + "icDescriptorRequest\032\034.google.api.MetricD" - + "escriptor\"[\202\323\344\223\002<\"\'/v3/{name=projects/*}" - + "/metricDescriptors:\021metric_descriptor\332A\026" - + "name,metric_descriptor\022\240\001\n\026DeleteMetricD" - + "escriptor\0223.google.monitoring.v3.DeleteM" - + "etricDescriptorRequest\032\026.google.protobuf" - + ".Empty\"9\202\323\344\223\002,**/v3/{name=projects/*/met" - + "ricDescriptors/**}\332A\004name\022\261\001\n\016ListTimeSe" - + "ries\022+.google.monitoring.v3.ListTimeSeri" - + "esRequest\032,.google.monitoring.v3.ListTim" - + "eSeriesResponse\"D\202\323\344\223\002\"\022 /v3/{name=proje" - + "cts/*}/timeSeries\332A\031name,filter,interval" - + ",view\022\231\001\n\020CreateTimeSeries\022-.google.moni" - + "toring.v3.CreateTimeSeriesRequest\032\026.goog" - + "le.protobuf.Empty\">\202\323\344\223\002%\" /v3/{name=pro" - + "jects/*}/timeSeries:\001*\332A\020name,time_serie" - + "s\032\332\001\312A\031monitoring.googleapis.com\322A\272\001http" - + "s://www.googleapis.com/auth/cloud-platfo" - + "rm,https://www.googleapis.com/auth/monit" - + "oring,https://www.googleapis.com/auth/mo" - + "nitoring.read,https://www.googleapis.com" - + "/auth/monitoring.writeB\371\005\n\030com.google.mo" - + "nitoring.v3B\022MetricServiceProtoP\001Z>googl" - + "e.golang.org/genproto/googleapis/monitor" - + "ing/v3;monitoring\252\002\032Google.Cloud.Monitor" - + "ing.V3\312\002\032Google\\Cloud\\Monitoring\\V3\352\002\035Go" - + "ogle::Cloud::Monitoring::V3\352A\360\001\n*monitor" - + "ing.googleapis.com/MetricDescriptor\022;pro" - + "jects/{project}/metricDescriptors/{metri" - + "c_descriptor=**}\022Eorganizations/{organiz" - + "ation}/metricDescriptors/{metric_descrip" - + "tor=**}\0229folders/{folder}/metricDescript" - + "ors/{metric_descriptor=**}\022\001* \001\352A\267\002\n5mon" - + "itoring.googleapis.com/MonitoredResource" - + "Descriptor\022Oprojects/{project}/monitored" + + "tricDescriptor\"\316\003\n\025ListTimeSeriesRequest" + + "\022:\n\004name\030\n \001(\tB,\340A\002\372A&\022$monitoring.googl" + + "eapis.com/TimeSeries\022\023\n\006filter\030\002 \001(\tB\003\340A" + + "\002\0229\n\010interval\030\004 \001(\0132\".google.monitoring." + + "v3.TimeIntervalB\003\340A\002\0226\n\013aggregation\030\005 \001(" + + "\0132!.google.monitoring.v3.Aggregation\022@\n\025" + + "secondary_aggregation\030\013 \001(\0132!.google.mon" + + "itoring.v3.Aggregation\022\020\n\010order_by\030\006 \001(\t" + + "\022M\n\004view\030\007 \001(\0162:.google.monitoring.v3.Li" + + "stTimeSeriesRequest.TimeSeriesViewB\003\340A\002\022" + + "\021\n\tpage_size\030\010 \001(\005\022\022\n\npage_token\030\t \001(\t\"\'" + + "\n\016TimeSeriesView\022\010\n\004FULL\020\000\022\013\n\007HEADERS\020\001\"" + + "\244\001\n\026ListTimeSeriesResponse\0225\n\013time_serie" + + "s\030\001 \003(\0132 .google.monitoring.v3.TimeSerie" + + "s\022\027\n\017next_page_token\030\002 \001(\t\022,\n\020execution_" + + "errors\030\003 \003(\0132\022.google.rpc.Status\022\014\n\004unit" + + "\030\005 \001(\t\"\230\001\n\027CreateTimeSeriesRequest\022A\n\004na" + + "me\030\003 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.g" + + "oogleapis.com/Project\022:\n\013time_series\030\002 \003" + + "(\0132 .google.monitoring.v3.TimeSeriesB\003\340A" + + "\002\"z\n\025CreateTimeSeriesError\0229\n\013time_serie" + + "s\030\001 \001(\0132 .google.monitoring.v3.TimeSerie" + + "sB\002\030\001\022&\n\006status\030\002 \001(\0132\022.google.rpc.Statu" + + "sB\002\030\001\"\330\001\n\027CreateTimeSeriesSummary\022\031\n\021tot" + + "al_point_count\030\001 \001(\005\022\033\n\023success_point_co" + + "unt\030\002 \001(\005\022C\n\006errors\030\003 \003(\01323.google.monit" + + "oring.v3.CreateTimeSeriesSummary.Error\032@" + + "\n\005Error\022\"\n\006status\030\001 \001(\0132\022.google.rpc.Sta" + + "tus\022\023\n\013point_count\030\002 \001(\005\"\\\n\026QueryTimeSer" + + "iesRequest\022\014\n\004name\030\001 \001(\t\022\r\n\005query\030\007 \001(\t\022" + + "\021\n\tpage_size\030\t \001(\005\022\022\n\npage_token\030\n \001(\t\"\352" + + "\001\n\027QueryTimeSeriesResponse\022J\n\026time_serie" + + "s_descriptor\030\010 \001(\0132*.google.monitoring.v" + + "3.TimeSeriesDescriptor\022>\n\020time_series_da" + + "ta\030\t \003(\0132$.google.monitoring.v3.TimeSeri" + + "esData\022\027\n\017next_page_token\030\n \001(\t\022*\n\016parti" + + "al_errors\030\013 \003(\0132\022.google.rpc.Status\"Y\n\016Q" + + "ueryErrorList\0220\n\006errors\030\001 \003(\0132 .google.m" + + "onitoring.v3.QueryError\022\025\n\rerror_summary" + + "\030\002 \001(\t2\213\016\n\rMetricService\022\344\001\n ListMonitor" + + "edResourceDescriptors\022=.google.monitorin" + + "g.v3.ListMonitoredResourceDescriptorsReq" + + "uest\032>.google.monitoring.v3.ListMonitore" + + "dResourceDescriptorsResponse\"A\202\323\344\223\0024\0222/v" + + "3/{name=projects/*}/monitoredResourceDes" + + "criptors\332A\004name\022\314\001\n\036GetMonitoredResource" + + "Descriptor\022;.google.monitoring.v3.GetMon" + + "itoredResourceDescriptorRequest\032\'.google" + + ".api.MonitoredResourceDescriptor\"D\202\323\344\223\0027" + + "\0225/v3/{name=projects/*/monitoredResource" + + "Descriptors/**}\332A\004name\022\270\001\n\025ListMetricDes" + + "criptors\0222.google.monitoring.v3.ListMetr" + + "icDescriptorsRequest\0323.google.monitoring" + + ".v3.ListMetricDescriptorsResponse\"6\202\323\344\223\002" + + ")\022\'/v3/{name=projects/*}/metricDescripto" + + "rs\332A\004name\022\240\001\n\023GetMetricDescriptor\0220.goog" + + "le.monitoring.v3.GetMetricDescriptorRequ" + + "est\032\034.google.api.MetricDescriptor\"9\202\323\344\223\002" + + ",\022*/v3/{name=projects/*/metricDescriptor" + + "s/**}\332A\004name\022\310\001\n\026CreateMetricDescriptor\022" + + "3.google.monitoring.v3.CreateMetricDescr" + + "iptorRequest\032\034.google.api.MetricDescript" + + "or\"[\202\323\344\223\002<\"\'/v3/{name=projects/*}/metric" + + "Descriptors:\021metric_descriptor\332A\026name,me" + + "tric_descriptor\022\240\001\n\026DeleteMetricDescript" + + "or\0223.google.monitoring.v3.DeleteMetricDe" + + "scriptorRequest\032\026.google.protobuf.Empty\"" + + "9\202\323\344\223\002,**/v3/{name=projects/*/metricDesc" + + "riptors/**}\332A\004name\022\376\001\n\016ListTimeSeries\022+." + + "google.monitoring.v3.ListTimeSeriesReque" + + "st\032,.google.monitoring.v3.ListTimeSeries" + + "Response\"\220\001\202\323\344\223\002n\022 /v3/{name=projects/*}" + + "/timeSeriesZ\'\022%/v3/{name=organizations/*" + + "}/timeSeriesZ!\022\037/v3/{name=folders/*}/tim" + + "eSeries\332A\031name,filter,interval,view\022\231\001\n\020" + + "CreateTimeSeries\022-.google.monitoring.v3." + + "CreateTimeSeriesRequest\032\026.google.protobu" + + "f.Empty\">\202\323\344\223\002%\" /v3/{name=projects/*}/t" + + "imeSeries:\001*\332A\020name,time_series\032\332\001\312A\031mon" + + "itoring.googleapis.com\322A\272\001https://www.go" + + "ogleapis.com/auth/cloud-platform,https:/" + + "/www.googleapis.com/auth/monitoring,http" + + "s://www.googleapis.com/auth/monitoring.r" + + "ead,https://www.googleapis.com/auth/moni" + + "toring.writeB\206\010\n\030com.google.monitoring.v" + + "3B\022MetricServiceProtoP\001Z>google.golang.o" + + "rg/genproto/googleapis/monitoring/v3;mon" + + "itoring\252\002\032Google.Cloud.Monitoring.V3\312\002\032G" + + "oogle\\Cloud\\Monitoring\\V3\352\002\035Google::Clou" + + "d::Monitoring::V3\352A\360\001\n*monitoring.google" + + "apis.com/MetricDescriptor\022;projects/{pro" + + "ject}/metricDescriptors/{metric_descript" + + "or=**}\022Eorganizations/{organization}/met" + + "ricDescriptors/{metric_descriptor=**}\0229f" + + "olders/{folder}/metricDescriptors/{metri" + + "c_descriptor=**}\022\001* \001\352A\267\002\n5monitoring.go" + + "ogleapis.com/MonitoredResourceDescriptor" + + "\022Oprojects/{project}/monitoredResourceDe" + + "scriptors/{monitored_resource_descriptor" + + "}\022Yorganizations/{organization}/monitore" + + "dResourceDescriptors/{monitored_resource" + + "_descriptor}\022Mfolders/{folder}/monitored" + "ResourceDescriptors/{monitored_resource_" - + "descriptor}\022Yorganizations/{organization" - + "}/monitoredResourceDescriptors/{monitore" - + "d_resource_descriptor}\022Mfolders/{folder}" - + "/monitoredResourceDescriptors/{monitored" - + "_resource_descriptor}\022\001* \001b\006proto3" + + "descriptor}\022\001* \001\352AQ\n#monitoring.googleap" + + "is.com/Workspace\022\022projects/{project}\022\026wo" + + "rkspaces/{workspace}\352A\265\001\n$monitoring.goo" + + "gleapis.com/TimeSeries\022+projects/{projec" + + "t}/timeSeries/{time_series}\0225organizatio" + + "ns/{organization}/timeSeries/{time_serie" + + "s}\022)folders/{folder}/timeSeries/{time_se" + + "ries}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -333,6 +344,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Filter", "Interval", "Aggregation", + "SecondaryAggregation", "OrderBy", "View", "PageSize", @@ -344,7 +356,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_ListTimeSeriesResponse_descriptor, new java.lang.String[] { - "TimeSeries", "NextPageToken", "ExecutionErrors", + "TimeSeries", "NextPageToken", "ExecutionErrors", "Unit", }); internal_static_google_monitoring_v3_CreateTimeSeriesRequest_descriptor = getDescriptor().getMessageTypes().get(10); diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannel.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannel.java index 59aa4259..1b29503a 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannel.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannel.java @@ -47,6 +47,7 @@ private NotificationChannel() { displayName_ = ""; description_ = ""; verificationStatus_ = 0; + mutationRecords_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -157,6 +158,34 @@ private NotificationChannel( break; } + case 98: + { + com.google.monitoring.v3.MutationRecord.Builder subBuilder = null; + if (creationRecord_ != null) { + subBuilder = creationRecord_.toBuilder(); + } + creationRecord_ = + input.readMessage( + com.google.monitoring.v3.MutationRecord.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(creationRecord_); + creationRecord_ = subBuilder.buildPartial(); + } + + break; + } + case 106: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + mutationRecords_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + mutationRecords_.add( + input.readMessage( + com.google.monitoring.v3.MutationRecord.parser(), extensionRegistry)); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -171,6 +200,9 @@ private NotificationChannel( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000004) != 0)) { + mutationRecords_ = java.util.Collections.unmodifiableList(mutationRecords_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -964,6 +996,123 @@ public com.google.protobuf.BoolValueOrBuilder getEnabledOrBuilder() { return getEnabled(); } + public static final int CREATION_RECORD_FIELD_NUMBER = 12; + private com.google.monitoring.v3.MutationRecord creationRecord_; + /** + * + * + *
+   * Record of the creation of this channel.
+   * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + * + * @return Whether the creationRecord field is set. + */ + @java.lang.Override + public boolean hasCreationRecord() { + return creationRecord_ != null; + } + /** + * + * + *
+   * Record of the creation of this channel.
+   * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + * + * @return The creationRecord. + */ + @java.lang.Override + public com.google.monitoring.v3.MutationRecord getCreationRecord() { + return creationRecord_ == null + ? com.google.monitoring.v3.MutationRecord.getDefaultInstance() + : creationRecord_; + } + /** + * + * + *
+   * Record of the creation of this channel.
+   * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + */ + @java.lang.Override + public com.google.monitoring.v3.MutationRecordOrBuilder getCreationRecordOrBuilder() { + return getCreationRecord(); + } + + public static final int MUTATION_RECORDS_FIELD_NUMBER = 13; + private java.util.List mutationRecords_; + /** + * + * + *
+   * Records of the modification of this channel.
+   * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + @java.lang.Override + public java.util.List getMutationRecordsList() { + return mutationRecords_; + } + /** + * + * + *
+   * Records of the modification of this channel.
+   * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + @java.lang.Override + public java.util.List + getMutationRecordsOrBuilderList() { + return mutationRecords_; + } + /** + * + * + *
+   * Records of the modification of this channel.
+   * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + @java.lang.Override + public int getMutationRecordsCount() { + return mutationRecords_.size(); + } + /** + * + * + *
+   * Records of the modification of this channel.
+   * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + @java.lang.Override + public com.google.monitoring.v3.MutationRecord getMutationRecords(int index) { + return mutationRecords_.get(index); + } + /** + * + * + *
+   * Records of the modification of this channel.
+   * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + @java.lang.Override + public com.google.monitoring.v3.MutationRecordOrBuilder getMutationRecordsOrBuilder(int index) { + return mutationRecords_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1003,6 +1152,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (enabled_ != null) { output.writeMessage(11, getEnabled()); } + if (creationRecord_ != null) { + output.writeMessage(12, getCreationRecord()); + } + for (int i = 0; i < mutationRecords_.size(); i++) { + output.writeMessage(13, mutationRecords_.get(i)); + } unknownFields.writeTo(output); } @@ -1053,6 +1208,12 @@ public int getSerializedSize() { if (enabled_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getEnabled()); } + if (creationRecord_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getCreationRecord()); + } + for (int i = 0; i < mutationRecords_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, mutationRecords_.get(i)); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1080,6 +1241,11 @@ public boolean equals(final java.lang.Object obj) { if (hasEnabled()) { if (!getEnabled().equals(other.getEnabled())) return false; } + if (hasCreationRecord() != other.hasCreationRecord()) return false; + if (hasCreationRecord()) { + if (!getCreationRecord().equals(other.getCreationRecord())) return false; + } + if (!getMutationRecordsList().equals(other.getMutationRecordsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -1113,6 +1279,14 @@ public int hashCode() { hash = (37 * hash) + ENABLED_FIELD_NUMBER; hash = (53 * hash) + getEnabled().hashCode(); } + if (hasCreationRecord()) { + hash = (37 * hash) + CREATION_RECORD_FIELD_NUMBER; + hash = (53 * hash) + getCreationRecord().hashCode(); + } + if (getMutationRecordsCount() > 0) { + hash = (37 * hash) + MUTATION_RECORDS_FIELD_NUMBER; + hash = (53 * hash) + getMutationRecordsList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1280,7 +1454,9 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMutationRecordsFieldBuilder(); + } } @java.lang.Override @@ -1304,6 +1480,18 @@ public Builder clear() { enabled_ = null; enabledBuilder_ = null; } + if (creationRecordBuilder_ == null) { + creationRecord_ = null; + } else { + creationRecord_ = null; + creationRecordBuilder_ = null; + } + if (mutationRecordsBuilder_ == null) { + mutationRecords_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + mutationRecordsBuilder_.clear(); + } return this; } @@ -1346,6 +1534,20 @@ public com.google.monitoring.v3.NotificationChannel buildPartial() { } else { result.enabled_ = enabledBuilder_.build(); } + if (creationRecordBuilder_ == null) { + result.creationRecord_ = creationRecord_; + } else { + result.creationRecord_ = creationRecordBuilder_.build(); + } + if (mutationRecordsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + mutationRecords_ = java.util.Collections.unmodifiableList(mutationRecords_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.mutationRecords_ = mutationRecords_; + } else { + result.mutationRecords_ = mutationRecordsBuilder_.build(); + } onBuilt(); return result; } @@ -1419,6 +1621,36 @@ public Builder mergeFrom(com.google.monitoring.v3.NotificationChannel other) { if (other.hasEnabled()) { mergeEnabled(other.getEnabled()); } + if (other.hasCreationRecord()) { + mergeCreationRecord(other.getCreationRecord()); + } + if (mutationRecordsBuilder_ == null) { + if (!other.mutationRecords_.isEmpty()) { + if (mutationRecords_.isEmpty()) { + mutationRecords_ = other.mutationRecords_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureMutationRecordsIsMutable(); + mutationRecords_.addAll(other.mutationRecords_); + } + onChanged(); + } + } else { + if (!other.mutationRecords_.isEmpty()) { + if (mutationRecordsBuilder_.isEmpty()) { + mutationRecordsBuilder_.dispose(); + mutationRecordsBuilder_ = null; + mutationRecords_ = other.mutationRecords_; + bitField0_ = (bitField0_ & ~0x00000004); + mutationRecordsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMutationRecordsFieldBuilder() + : null; + } else { + mutationRecordsBuilder_.addAllMessages(other.mutationRecords_); + } + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -2700,6 +2932,546 @@ public com.google.protobuf.BoolValueOrBuilder getEnabledOrBuilder() { return enabledBuilder_; } + private com.google.monitoring.v3.MutationRecord creationRecord_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.MutationRecord, + com.google.monitoring.v3.MutationRecord.Builder, + com.google.monitoring.v3.MutationRecordOrBuilder> + creationRecordBuilder_; + /** + * + * + *
+     * Record of the creation of this channel.
+     * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + * + * @return Whether the creationRecord field is set. + */ + public boolean hasCreationRecord() { + return creationRecordBuilder_ != null || creationRecord_ != null; + } + /** + * + * + *
+     * Record of the creation of this channel.
+     * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + * + * @return The creationRecord. + */ + public com.google.monitoring.v3.MutationRecord getCreationRecord() { + if (creationRecordBuilder_ == null) { + return creationRecord_ == null + ? com.google.monitoring.v3.MutationRecord.getDefaultInstance() + : creationRecord_; + } else { + return creationRecordBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Record of the creation of this channel.
+     * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + */ + public Builder setCreationRecord(com.google.monitoring.v3.MutationRecord value) { + if (creationRecordBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + creationRecord_ = value; + onChanged(); + } else { + creationRecordBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Record of the creation of this channel.
+     * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + */ + public Builder setCreationRecord( + com.google.monitoring.v3.MutationRecord.Builder builderForValue) { + if (creationRecordBuilder_ == null) { + creationRecord_ = builderForValue.build(); + onChanged(); + } else { + creationRecordBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Record of the creation of this channel.
+     * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + */ + public Builder mergeCreationRecord(com.google.monitoring.v3.MutationRecord value) { + if (creationRecordBuilder_ == null) { + if (creationRecord_ != null) { + creationRecord_ = + com.google.monitoring.v3.MutationRecord.newBuilder(creationRecord_) + .mergeFrom(value) + .buildPartial(); + } else { + creationRecord_ = value; + } + onChanged(); + } else { + creationRecordBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Record of the creation of this channel.
+     * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + */ + public Builder clearCreationRecord() { + if (creationRecordBuilder_ == null) { + creationRecord_ = null; + onChanged(); + } else { + creationRecord_ = null; + creationRecordBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Record of the creation of this channel.
+     * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + */ + public com.google.monitoring.v3.MutationRecord.Builder getCreationRecordBuilder() { + + onChanged(); + return getCreationRecordFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Record of the creation of this channel.
+     * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + */ + public com.google.monitoring.v3.MutationRecordOrBuilder getCreationRecordOrBuilder() { + if (creationRecordBuilder_ != null) { + return creationRecordBuilder_.getMessageOrBuilder(); + } else { + return creationRecord_ == null + ? com.google.monitoring.v3.MutationRecord.getDefaultInstance() + : creationRecord_; + } + } + /** + * + * + *
+     * Record of the creation of this channel.
+     * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.MutationRecord, + com.google.monitoring.v3.MutationRecord.Builder, + com.google.monitoring.v3.MutationRecordOrBuilder> + getCreationRecordFieldBuilder() { + if (creationRecordBuilder_ == null) { + creationRecordBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.MutationRecord, + com.google.monitoring.v3.MutationRecord.Builder, + com.google.monitoring.v3.MutationRecordOrBuilder>( + getCreationRecord(), getParentForChildren(), isClean()); + creationRecord_ = null; + } + return creationRecordBuilder_; + } + + private java.util.List mutationRecords_ = + java.util.Collections.emptyList(); + + private void ensureMutationRecordsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + mutationRecords_ = + new java.util.ArrayList(mutationRecords_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.MutationRecord, + com.google.monitoring.v3.MutationRecord.Builder, + com.google.monitoring.v3.MutationRecordOrBuilder> + mutationRecordsBuilder_; + + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public java.util.List getMutationRecordsList() { + if (mutationRecordsBuilder_ == null) { + return java.util.Collections.unmodifiableList(mutationRecords_); + } else { + return mutationRecordsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public int getMutationRecordsCount() { + if (mutationRecordsBuilder_ == null) { + return mutationRecords_.size(); + } else { + return mutationRecordsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public com.google.monitoring.v3.MutationRecord getMutationRecords(int index) { + if (mutationRecordsBuilder_ == null) { + return mutationRecords_.get(index); + } else { + return mutationRecordsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public Builder setMutationRecords(int index, com.google.monitoring.v3.MutationRecord value) { + if (mutationRecordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationRecordsIsMutable(); + mutationRecords_.set(index, value); + onChanged(); + } else { + mutationRecordsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public Builder setMutationRecords( + int index, com.google.monitoring.v3.MutationRecord.Builder builderForValue) { + if (mutationRecordsBuilder_ == null) { + ensureMutationRecordsIsMutable(); + mutationRecords_.set(index, builderForValue.build()); + onChanged(); + } else { + mutationRecordsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public Builder addMutationRecords(com.google.monitoring.v3.MutationRecord value) { + if (mutationRecordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationRecordsIsMutable(); + mutationRecords_.add(value); + onChanged(); + } else { + mutationRecordsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public Builder addMutationRecords(int index, com.google.monitoring.v3.MutationRecord value) { + if (mutationRecordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationRecordsIsMutable(); + mutationRecords_.add(index, value); + onChanged(); + } else { + mutationRecordsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public Builder addMutationRecords( + com.google.monitoring.v3.MutationRecord.Builder builderForValue) { + if (mutationRecordsBuilder_ == null) { + ensureMutationRecordsIsMutable(); + mutationRecords_.add(builderForValue.build()); + onChanged(); + } else { + mutationRecordsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public Builder addMutationRecords( + int index, com.google.monitoring.v3.MutationRecord.Builder builderForValue) { + if (mutationRecordsBuilder_ == null) { + ensureMutationRecordsIsMutable(); + mutationRecords_.add(index, builderForValue.build()); + onChanged(); + } else { + mutationRecordsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public Builder addAllMutationRecords( + java.lang.Iterable values) { + if (mutationRecordsBuilder_ == null) { + ensureMutationRecordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, mutationRecords_); + onChanged(); + } else { + mutationRecordsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public Builder clearMutationRecords() { + if (mutationRecordsBuilder_ == null) { + mutationRecords_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + mutationRecordsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public Builder removeMutationRecords(int index) { + if (mutationRecordsBuilder_ == null) { + ensureMutationRecordsIsMutable(); + mutationRecords_.remove(index); + onChanged(); + } else { + mutationRecordsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public com.google.monitoring.v3.MutationRecord.Builder getMutationRecordsBuilder(int index) { + return getMutationRecordsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public com.google.monitoring.v3.MutationRecordOrBuilder getMutationRecordsOrBuilder(int index) { + if (mutationRecordsBuilder_ == null) { + return mutationRecords_.get(index); + } else { + return mutationRecordsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public java.util.List + getMutationRecordsOrBuilderList() { + if (mutationRecordsBuilder_ != null) { + return mutationRecordsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(mutationRecords_); + } + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public com.google.monitoring.v3.MutationRecord.Builder addMutationRecordsBuilder() { + return getMutationRecordsFieldBuilder() + .addBuilder(com.google.monitoring.v3.MutationRecord.getDefaultInstance()); + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public com.google.monitoring.v3.MutationRecord.Builder addMutationRecordsBuilder(int index) { + return getMutationRecordsFieldBuilder() + .addBuilder(index, com.google.monitoring.v3.MutationRecord.getDefaultInstance()); + } + /** + * + * + *
+     * Records of the modification of this channel.
+     * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + public java.util.List + getMutationRecordsBuilderList() { + return getMutationRecordsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.MutationRecord, + com.google.monitoring.v3.MutationRecord.Builder, + com.google.monitoring.v3.MutationRecordOrBuilder> + getMutationRecordsFieldBuilder() { + if (mutationRecordsBuilder_ == null) { + mutationRecordsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.MutationRecord, + com.google.monitoring.v3.MutationRecord.Builder, + com.google.monitoring.v3.MutationRecordOrBuilder>( + mutationRecords_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + mutationRecords_ = null; + } + return mutationRecordsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptor.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptor.java index ee713355..bd092496 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptor.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptor.java @@ -248,7 +248,10 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * The type of notification channel, such as "email", "sms", etc.
+   * The type of notification channel, such as "email" and "sms". To view the
+   * full list of channels, see
+   * [Channel
+   * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd).
    * Notification channel types are globally unique.
    * 
* @@ -272,7 +275,10 @@ public java.lang.String getType() { * * *
-   * The type of notification channel, such as "email", "sms", etc.
+   * The type of notification channel, such as "email" and "sms". To view the
+   * full list of channels, see
+   * [Channel
+   * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd).
    * Notification channel types are globally unique.
    * 
* @@ -1228,7 +1234,10 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * The type of notification channel, such as "email", "sms", etc.
+     * The type of notification channel, such as "email" and "sms". To view the
+     * full list of channels, see
+     * [Channel
+     * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd).
      * Notification channel types are globally unique.
      * 
* @@ -1251,7 +1260,10 @@ public java.lang.String getType() { * * *
-     * The type of notification channel, such as "email", "sms", etc.
+     * The type of notification channel, such as "email" and "sms". To view the
+     * full list of channels, see
+     * [Channel
+     * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd).
      * Notification channel types are globally unique.
      * 
* @@ -1274,7 +1286,10 @@ public com.google.protobuf.ByteString getTypeBytes() { * * *
-     * The type of notification channel, such as "email", "sms", etc.
+     * The type of notification channel, such as "email" and "sms". To view the
+     * full list of channels, see
+     * [Channel
+     * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd).
      * Notification channel types are globally unique.
      * 
* @@ -1296,7 +1311,10 @@ public Builder setType(java.lang.String value) { * * *
-     * The type of notification channel, such as "email", "sms", etc.
+     * The type of notification channel, such as "email" and "sms". To view the
+     * full list of channels, see
+     * [Channel
+     * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd).
      * Notification channel types are globally unique.
      * 
* @@ -1314,7 +1332,10 @@ public Builder clearType() { * * *
-     * The type of notification channel, such as "email", "sms", etc.
+     * The type of notification channel, such as "email" and "sms". To view the
+     * full list of channels, see
+     * [Channel
+     * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd).
      * Notification channel types are globally unique.
      * 
* diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptorOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptorOrBuilder.java index c7a04458..40f0655e 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptorOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptorOrBuilder.java @@ -56,7 +56,10 @@ public interface NotificationChannelDescriptorOrBuilder * * *
-   * The type of notification channel, such as "email", "sms", etc.
+   * The type of notification channel, such as "email" and "sms". To view the
+   * full list of channels, see
+   * [Channel
+   * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd).
    * Notification channel types are globally unique.
    * 
* @@ -69,7 +72,10 @@ public interface NotificationChannelDescriptorOrBuilder * * *
-   * The type of notification channel, such as "email", "sms", etc.
+   * The type of notification channel, such as "email" and "sms". To view the
+   * full list of channels, see
+   * [Channel
+   * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd).
    * Notification channel types are globally unique.
    * 
* diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelOrBuilder.java index 132b4f52..c7012842 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelOrBuilder.java @@ -403,4 +403,91 @@ public interface NotificationChannelOrBuilder * .google.protobuf.BoolValue enabled = 11; */ com.google.protobuf.BoolValueOrBuilder getEnabledOrBuilder(); + + /** + * + * + *
+   * Record of the creation of this channel.
+   * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + * + * @return Whether the creationRecord field is set. + */ + boolean hasCreationRecord(); + /** + * + * + *
+   * Record of the creation of this channel.
+   * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + * + * @return The creationRecord. + */ + com.google.monitoring.v3.MutationRecord getCreationRecord(); + /** + * + * + *
+   * Record of the creation of this channel.
+   * 
+ * + * .google.monitoring.v3.MutationRecord creation_record = 12; + */ + com.google.monitoring.v3.MutationRecordOrBuilder getCreationRecordOrBuilder(); + + /** + * + * + *
+   * Records of the modification of this channel.
+   * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + java.util.List getMutationRecordsList(); + /** + * + * + *
+   * Records of the modification of this channel.
+   * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + com.google.monitoring.v3.MutationRecord getMutationRecords(int index); + /** + * + * + *
+   * Records of the modification of this channel.
+   * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + int getMutationRecordsCount(); + /** + * + * + *
+   * Records of the modification of this channel.
+   * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + java.util.List + getMutationRecordsOrBuilderList(); + /** + * + * + *
+   * Records of the modification of this channel.
+   * 
+ * + * repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + com.google.monitoring.v3.MutationRecordOrBuilder getMutationRecordsOrBuilder(int index); } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationProto.java index 3dac71da..20fca624 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationProto.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationProto.java @@ -56,48 +56,52 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "o\022\024google.monitoring.v3\032\026google/api/labe" + "l.proto\032\035google/api/launch_stage.proto\032\031" + "google/api/resource.proto\032!google/monito" - + "ring/v3/common.proto\032\036google/protobuf/wr" - + "appers.proto\"\245\004\n\035NotificationChannelDesc" - + "riptor\022\014\n\004name\030\006 \001(\t\022\014\n\004type\030\001 \001(\t\022\024\n\014di" - + "splay_name\030\002 \001(\t\022\023\n\013description\030\003 \001(\t\022+\n" - + "\006labels\030\004 \003(\0132\033.google.api.LabelDescript" - + "or\022>\n\017supported_tiers\030\005 \003(\0162!.google.mon" - + "itoring.v3.ServiceTierB\002\030\001\022-\n\014launch_sta" - + "ge\030\007 \001(\0162\027.google.api.LaunchStage:\240\002\352A\234\002" - + "\n7monitoring.googleapis.com/Notification" - + "ChannelDescriptor\022Fprojects/{project}/no" - + "tificationChannelDescriptors/{channel_de" - + "scriptor}\022Porganizations/{organization}/" - + "notificationChannelDescriptors/{channel_" - + "descriptor}\022Dfolders/{folder}/notificati" - + "onChannelDescriptors/{channel_descriptor" - + "}\022\001*\"\267\006\n\023NotificationChannel\022\014\n\004type\030\001 \001" - + "(\t\022\014\n\004name\030\006 \001(\t\022\024\n\014display_name\030\003 \001(\t\022\023" - + "\n\013description\030\004 \001(\t\022E\n\006labels\030\005 \003(\01325.go" - + "ogle.monitoring.v3.NotificationChannel.L" - + "abelsEntry\022N\n\013user_labels\030\010 \003(\01329.google" - + ".monitoring.v3.NotificationChannel.UserL" - + "abelsEntry\022Y\n\023verification_status\030\t \001(\0162" - + "<.google.monitoring.v3.NotificationChann" - + "el.VerificationStatus\022+\n\007enabled\030\013 \001(\0132\032" - + ".google.protobuf.BoolValue\032-\n\013LabelsEntr" - + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0321\n\017Use" - + "rLabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" - + ":\0028\001\"W\n\022VerificationStatus\022#\n\037VERIFICATI" - + "ON_STATUS_UNSPECIFIED\020\000\022\016\n\nUNVERIFIED\020\001\022" - + "\014\n\010VERIFIED\020\002:\376\001\352A\372\001\n-monitoring.googlea" - + "pis.com/NotificationChannel\022>projects/{p" - + "roject}/notificationChannels/{notificati" - + "on_channel}\022Horganizations/{organization" - + "}/notificationChannels/{notification_cha" - + "nnel}\022google.golang.org/genproto/googleapis/" - + "monitoring/v3;monitoring\252\002\032Google.Cloud." - + "Monitoring.V3\312\002\032Google\\Cloud\\Monitoring\\" - + "V3\352\002\035Google::Cloud::Monitoring::V3b\006prot" - + "o3" + + "ring/v3/common.proto\032*google/monitoring/" + + "v3/mutation_record.proto\032\036google/protobu" + + "f/wrappers.proto\"\245\004\n\035NotificationChannel" + + "Descriptor\022\014\n\004name\030\006 \001(\t\022\014\n\004type\030\001 \001(\t\022\024" + + "\n\014display_name\030\002 \001(\t\022\023\n\013description\030\003 \001(" + + "\t\022+\n\006labels\030\004 \003(\0132\033.google.api.LabelDesc" + + "riptor\022>\n\017supported_tiers\030\005 \003(\0162!.google" + + ".monitoring.v3.ServiceTierB\002\030\001\022-\n\014launch" + + "_stage\030\007 \001(\0162\027.google.api.LaunchStage:\240\002" + + "\352A\234\002\n7monitoring.googleapis.com/Notifica" + + "tionChannelDescriptor\022Fprojects/{project" + + "}/notificationChannelDescriptors/{channe" + + "l_descriptor}\022Porganizations/{organizati" + + "on}/notificationChannelDescriptors/{chan" + + "nel_descriptor}\022Dfolders/{folder}/notifi" + + "cationChannelDescriptors/{channel_descri" + + "ptor}\022\001*\"\266\007\n\023NotificationChannel\022\014\n\004type" + + "\030\001 \001(\t\022\014\n\004name\030\006 \001(\t\022\024\n\014display_name\030\003 \001" + + "(\t\022\023\n\013description\030\004 \001(\t\022E\n\006labels\030\005 \003(\0132" + + "5.google.monitoring.v3.NotificationChann" + + "el.LabelsEntry\022N\n\013user_labels\030\010 \003(\01329.go" + + "ogle.monitoring.v3.NotificationChannel.U" + + "serLabelsEntry\022Y\n\023verification_status\030\t " + + "\001(\0162<.google.monitoring.v3.NotificationC" + + "hannel.VerificationStatus\022+\n\007enabled\030\013 \001" + + "(\0132\032.google.protobuf.BoolValue\022=\n\017creati" + + "on_record\030\014 \001(\0132$.google.monitoring.v3.M" + + "utationRecord\022>\n\020mutation_records\030\r \003(\0132" + + "$.google.monitoring.v3.MutationRecord\032-\n" + + "\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + + ":\0028\001\0321\n\017UserLabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + + "value\030\002 \001(\t:\0028\001\"W\n\022VerificationStatus\022#\n" + + "\037VERIFICATION_STATUS_UNSPECIFIED\020\000\022\016\n\nUN" + + "VERIFIED\020\001\022\014\n\010VERIFIED\020\002:\376\001\352A\372\001\n-monitor" + + "ing.googleapis.com/NotificationChannel\022>" + + "projects/{project}/notificationChannels/" + + "{notification_channel}\022Horganizations/{o" + + "rganization}/notificationChannels/{notif" + + "ication_channel}\022google.golang.org/genproto/" + + "googleapis/monitoring/v3;monitoring\252\002\032Go" + + "ogle.Cloud.Monitoring.V3\312\002\032Google\\Cloud\\" + + "Monitoring\\V3\352\002\035Google::Cloud::Monitorin" + + "g::V3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -107,6 +111,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.LaunchStageProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), com.google.monitoring.v3.CommonProto.getDescriptor(), + com.google.monitoring.v3.MutationRecordProto.getDescriptor(), com.google.protobuf.WrappersProto.getDescriptor(), }); internal_static_google_monitoring_v3_NotificationChannelDescriptor_descriptor = @@ -137,6 +142,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "UserLabels", "VerificationStatus", "Enabled", + "CreationRecord", + "MutationRecords", }); internal_static_google_monitoring_v3_NotificationChannel_LabelsEntry_descriptor = internal_static_google_monitoring_v3_NotificationChannel_descriptor.getNestedTypes().get(0); @@ -163,6 +170,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.LaunchStageProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); com.google.monitoring.v3.CommonProto.getDescriptor(); + com.google.monitoring.v3.MutationRecordProto.getDescriptor(); com.google.protobuf.WrappersProto.getDescriptor(); } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationServiceProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationServiceProto.java index 53315a5c..87511c52 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationServiceProto.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationServiceProto.java @@ -116,99 +116,100 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "annelsRequest\022C\n\004name\030\005 \001(\tB5\340A\002\372A/\022-mon" + "itoring.googleapis.com/NotificationChann" + "el\022\016\n\006filter\030\006 \001(\t\022\020\n\010order_by\030\007 \001(\t\022\021\n\t" - + "page_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"\205\001\n " + + "page_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"\231\001\n " + "ListNotificationChannelsResponse\022H\n\025noti" + "fication_channels\030\003 \003(\0132).google.monitor" + "ing.v3.NotificationChannel\022\027\n\017next_page_" - + "token\030\002 \001(\t\"d\n\035GetNotificationChannelReq" - + "uest\022C\n\004name\030\003 \001(\tB5\340A\002\372A/\n-monitoring.g" - + "oogleapis.com/NotificationChannel\"\241\001\n Up" - + "dateNotificationChannelRequest\022/\n\013update" - + "_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\022" - + "L\n\024notification_channel\030\003 \001(\0132).google.m" - + "onitoring.v3.NotificationChannelB\003\340A\002\"v\n" - + " DeleteNotificationChannelRequest\022C\n\004nam" - + "e\030\003 \001(\tB5\340A\002\372A/\n-monitoring.googleapis.c" - + "om/NotificationChannel\022\r\n\005force\030\005 \001(\010\"u\n" - + ".SendNotificationChannelVerificationCode" - + "Request\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n-monitorin" - + "g.googleapis.com/NotificationChannel\"\245\001\n" - + "-GetNotificationChannelVerificationCodeR" - + "equest\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n-monitoring" - + ".googleapis.com/NotificationChannel\022/\n\013e" - + "xpire_time\030\002 \001(\0132\032.google.protobuf.Times" - + "tamp\"o\n.GetNotificationChannelVerificati" - + "onCodeResponse\022\014\n\004code\030\001 \001(\t\022/\n\013expire_t" - + "ime\030\002 \001(\0132\032.google.protobuf.Timestamp\"z\n" - + " VerifyNotificationChannelRequest\022C\n\004nam" - + "e\030\001 \001(\tB5\340A\002\372A/\n-monitoring.googleapis.c" - + "om/NotificationChannel\022\021\n\004code\030\002 \001(\tB\003\340A" - + "\0022\352\022\n\032NotificationChannelService\022\354\001\n\"Lis" - + "tNotificationChannelDescriptors\022?.google" - + ".monitoring.v3.ListNotificationChannelDe" - + "scriptorsRequest\032@.google.monitoring.v3." - + "ListNotificationChannelDescriptorsRespon" - + "se\"C\202\323\344\223\0026\0224/v3/{name=projects/*}/notifi" - + "cationChannelDescriptors\332A\004name\022\335\001\n GetN" - + "otificationChannelDescriptor\022=.google.mo" - + "nitoring.v3.GetNotificationChannelDescri" - + "ptorRequest\0323.google.monitoring.v3.Notif" - + "icationChannelDescriptor\"E\202\323\344\223\0028\0226/v3/{n" - + "ame=projects/*/notificationChannelDescri" - + "ptors/*}\332A\004name\022\304\001\n\030ListNotificationChan" - + "nels\0225.google.monitoring.v3.ListNotifica" - + "tionChannelsRequest\0326.google.monitoring." - + "v3.ListNotificationChannelsResponse\"9\202\323\344" - + "\223\002,\022*/v3/{name=projects/*}/notificationC" - + "hannels\332A\004name\022\265\001\n\026GetNotificationChanne" - + "l\0223.google.monitoring.v3.GetNotification" - + "ChannelRequest\032).google.monitoring.v3.No" - + "tificationChannel\";\202\323\344\223\002.\022,/v3/{name=pro" - + "jects/*/notificationChannels/*}\332A\004name\022\344" - + "\001\n\031CreateNotificationChannel\0226.google.mo" - + "nitoring.v3.CreateNotificationChannelReq" - + "uest\032).google.monitoring.v3.Notification" - + "Channel\"d\202\323\344\223\002B\"*/v3/{name=projects/*}/n" - + "otificationChannels:\024notification_channe" - + "l\332A\031name,notification_channel\022\203\002\n\031Update" - + "NotificationChannel\0226.google.monitoring." - + "v3.UpdateNotificationChannelRequest\032).go" - + "ogle.monitoring.v3.NotificationChannel\"\202" - + "\001\202\323\344\223\002Y2A/v3/{notification_channel.name=" - + "projects/*/notificationChannels/*}:\024noti" - + "fication_channel\332A update_mask,notificat" - + "ion_channel\022\256\001\n\031DeleteNotificationChanne" - + "l\0226.google.monitoring.v3.DeleteNotificat" - + "ionChannelRequest\032\026.google.protobuf.Empt" - + "y\"A\202\323\344\223\002.*,/v3/{name=projects/*/notifica" - + "tionChannels/*}\332A\nname,force\022\334\001\n\'SendNot" - + "ificationChannelVerificationCode\022D.googl" - + "e.monitoring.v3.SendNotificationChannelV" - + "erificationCodeRequest\032\026.google.protobuf" - + ".Empty\"S\202\323\344\223\002F\"A/v3/{name=projects/*/not" - + "ificationChannels/*}:sendVerificationCod" - + "e:\001*\332A\004name\022\207\002\n&GetNotificationChannelVe" - + "rificationCode\022C.google.monitoring.v3.Ge" - + "tNotificationChannelVerificationCodeRequ" - + "est\032D.google.monitoring.v3.GetNotificati" - + "onChannelVerificationCodeResponse\"R\202\323\344\223\002" - + "E\"@/v3/{name=projects/*/notificationChan" - + "nels/*}:getVerificationCode:\001*\332A\004name\022\312\001" - + "\n\031VerifyNotificationChannel\0226.google.mon" - + "itoring.v3.VerifyNotificationChannelRequ" - + "est\032).google.monitoring.v3.NotificationC" - + "hannel\"J\202\323\344\223\0028\"3/v3/{name=projects/*/not" - + "ificationChannels/*}:verify:\001*\332A\tname,co" - + "de\032\251\001\312A\031monitoring.googleapis.com\322A\211\001htt" - + "ps://www.googleapis.com/auth/cloud-platf" - + "orm,https://www.googleapis.com/auth/moni" - + "toring,https://www.googleapis.com/auth/m" - + "onitoring.readB\320\001\n\030com.google.monitoring" - + ".v3B\030NotificationServiceProtoP\001Z>google." - + "golang.org/genproto/googleapis/monitorin" - + "g/v3;monitoring\252\002\032Google.Cloud.Monitorin" - + "g.V3\312\002\032Google\\Cloud\\Monitoring\\V3\352\002\035Goog" - + "le::Cloud::Monitoring::V3b\006proto3" + + "token\030\002 \001(\t\022\022\n\ntotal_size\030\004 \001(\005\"d\n\035GetNo" + + "tificationChannelRequest\022C\n\004name\030\003 \001(\tB5" + + "\340A\002\372A/\n-monitoring.googleapis.com/Notifi" + + "cationChannel\"\241\001\n UpdateNotificationChan" + + "nelRequest\022/\n\013update_mask\030\002 \001(\0132\032.google" + + ".protobuf.FieldMask\022L\n\024notification_chan" + + "nel\030\003 \001(\0132).google.monitoring.v3.Notific" + + "ationChannelB\003\340A\002\"v\n DeleteNotificationC" + + "hannelRequest\022C\n\004name\030\003 \001(\tB5\340A\002\372A/\n-mon" + + "itoring.googleapis.com/NotificationChann" + + "el\022\r\n\005force\030\005 \001(\010\"u\n.SendNotificationCha" + + "nnelVerificationCodeRequest\022C\n\004name\030\001 \001(" + + "\tB5\340A\002\372A/\n-monitoring.googleapis.com/Not" + + "ificationChannel\"\245\001\n-GetNotificationChan" + + "nelVerificationCodeRequest\022C\n\004name\030\001 \001(\t" + + "B5\340A\002\372A/\n-monitoring.googleapis.com/Noti" + + "ficationChannel\022/\n\013expire_time\030\002 \001(\0132\032.g" + + "oogle.protobuf.Timestamp\"o\n.GetNotificat" + + "ionChannelVerificationCodeResponse\022\014\n\004co" + + "de\030\001 \001(\t\022/\n\013expire_time\030\002 \001(\0132\032.google.p" + + "rotobuf.Timestamp\"z\n VerifyNotificationC" + + "hannelRequest\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n-mon" + + "itoring.googleapis.com/NotificationChann" + + "el\022\021\n\004code\030\002 \001(\tB\003\340A\0022\352\022\n\032NotificationCh" + + "annelService\022\354\001\n\"ListNotificationChannel" + + "Descriptors\022?.google.monitoring.v3.ListN" + + "otificationChannelDescriptorsRequest\032@.g" + + "oogle.monitoring.v3.ListNotificationChan" + + "nelDescriptorsResponse\"C\202\323\344\223\0026\0224/v3/{nam" + + "e=projects/*}/notificationChannelDescrip" + + "tors\332A\004name\022\335\001\n GetNotificationChannelDe" + + "scriptor\022=.google.monitoring.v3.GetNotif" + + "icationChannelDescriptorRequest\0323.google" + + ".monitoring.v3.NotificationChannelDescri" + + "ptor\"E\202\323\344\223\0028\0226/v3/{name=projects/*/notif" + + "icationChannelDescriptors/*}\332A\004name\022\304\001\n\030" + + "ListNotificationChannels\0225.google.monito" + + "ring.v3.ListNotificationChannelsRequest\032" + + "6.google.monitoring.v3.ListNotificationC" + + "hannelsResponse\"9\202\323\344\223\002,\022*/v3/{name=proje" + + "cts/*}/notificationChannels\332A\004name\022\265\001\n\026G" + + "etNotificationChannel\0223.google.monitorin" + + "g.v3.GetNotificationChannelRequest\032).goo" + + "gle.monitoring.v3.NotificationChannel\";\202" + + "\323\344\223\002.\022,/v3/{name=projects/*/notification" + + "Channels/*}\332A\004name\022\344\001\n\031CreateNotificatio" + + "nChannel\0226.google.monitoring.v3.CreateNo" + + "tificationChannelRequest\032).google.monito" + + "ring.v3.NotificationChannel\"d\202\323\344\223\002B\"*/v3" + + "/{name=projects/*}/notificationChannels:" + + "\024notification_channel\332A\031name,notificatio" + + "n_channel\022\203\002\n\031UpdateNotificationChannel\022" + + "6.google.monitoring.v3.UpdateNotificatio" + + "nChannelRequest\032).google.monitoring.v3.N" + + "otificationChannel\"\202\001\202\323\344\223\002Y2A/v3/{notifi" + + "cation_channel.name=projects/*/notificat" + + "ionChannels/*}:\024notification_channel\332A u" + + "pdate_mask,notification_channel\022\256\001\n\031Dele" + + "teNotificationChannel\0226.google.monitorin" + + "g.v3.DeleteNotificationChannelRequest\032\026." + + "google.protobuf.Empty\"A\202\323\344\223\002.*,/v3/{name" + + "=projects/*/notificationChannels/*}\332A\nna" + + "me,force\022\334\001\n\'SendNotificationChannelVeri" + + "ficationCode\022D.google.monitoring.v3.Send" + + "NotificationChannelVerificationCodeReque" + + "st\032\026.google.protobuf.Empty\"S\202\323\344\223\002F\"A/v3/" + + "{name=projects/*/notificationChannels/*}" + + ":sendVerificationCode:\001*\332A\004name\022\207\002\n&GetN" + + "otificationChannelVerificationCode\022C.goo" + + "gle.monitoring.v3.GetNotificationChannel" + + "VerificationCodeRequest\032D.google.monitor" + + "ing.v3.GetNotificationChannelVerificatio" + + "nCodeResponse\"R\202\323\344\223\002E\"@/v3/{name=project" + + "s/*/notificationChannels/*}:getVerificat" + + "ionCode:\001*\332A\004name\022\312\001\n\031VerifyNotification" + + "Channel\0226.google.monitoring.v3.VerifyNot" + + "ificationChannelRequest\032).google.monitor" + + "ing.v3.NotificationChannel\"J\202\323\344\223\0028\"3/v3/" + + "{name=projects/*/notificationChannels/*}" + + ":verify:\001*\332A\tname,code\032\251\001\312A\031monitoring.g" + + "oogleapis.com\322A\211\001https://www.googleapis." + + "com/auth/cloud-platform,https://www.goog" + + "leapis.com/auth/monitoring,https://www.g" + + "oogleapis.com/auth/monitoring.readB\320\001\n\030c" + + "om.google.monitoring.v3B\030NotificationSer" + + "viceProtoP\001Z>google.golang.org/genproto/" + + "googleapis/monitoring/v3;monitoring\252\002\032Go" + + "ogle.Cloud.Monitoring.V3\312\002\032Google\\Cloud\\" + + "Monitoring\\V3\352\002\035Google::Cloud::Monitorin" + + "g::V3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -270,7 +271,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_ListNotificationChannelsResponse_descriptor, new java.lang.String[] { - "NotificationChannels", "NextPageToken", + "NotificationChannels", "NextPageToken", "TotalSize", }); internal_static_google_monitoring_v3_GetNotificationChannelRequest_descriptor = getDescriptor().getMessageTypes().get(6); diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryServiceProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryServiceProto.java new file mode 100644 index 00000000..1d19a150 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryServiceProto.java @@ -0,0 +1,84 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/monitoring/v3/query_service.proto + +package com.google.monitoring.v3; + +public final class QueryServiceProto { + private QueryServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n(google/monitoring/v3/query_service.pro" + + "to\022\024google.monitoring.v3\032\034google/api/ann" + + "otations.proto\032\026google/api/label.proto\032!" + + "google/monitoring/v3/metric.proto\032)googl" + + "e/monitoring/v3/metric_service.proto\032\027go" + + "ogle/api/client.proto2\336\002\n\014QueryService\022\241" + + "\001\n\017QueryTimeSeries\022,.google.monitoring.v" + + "3.QueryTimeSeriesRequest\032-.google.monito" + + "ring.v3.QueryTimeSeriesResponse\"1\202\323\344\223\002+\"" + + "&/v3/{name=projects/*}/timeSeries:query:" + + "\001*\032\251\001\312A\031monitoring.googleapis.com\322A\211\001htt" + + "ps://www.googleapis.com/auth/cloud-platf" + + "orm,https://www.googleapis.com/auth/moni" + + "toring,https://www.googleapis.com/auth/m" + + "onitoring.readB\311\001\n\030com.google.monitoring" + + ".v3B\021QueryServiceProtoP\001Z>google.golang." + + "org/genproto/googleapis/monitoring/v3;mo" + + "nitoring\252\002\032Google.Cloud.Monitoring.V3\312\002\032" + + "Google\\Cloud\\Monitoring\\V3\352\002\035Google::Clo" + + "ud::Monitoring::V3b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.LabelProto.getDescriptor(), + com.google.monitoring.v3.MetricProto.getDescriptor(), + com.google.monitoring.v3.MetricServiceProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.LabelProto.getDescriptor(); + com.google.monitoring.v3.MetricProto.getDescriptor(); + com.google.monitoring.v3.MetricServiceProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryTimeSeriesRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryTimeSeriesRequest.java index cb8c37e8..e0cdf23f 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryTimeSeriesRequest.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryTimeSeriesRequest.java @@ -189,8 +189,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * Required. The query in the monitoring query language format. The default
-   * time zone is in UTC.
+   * Required. The query in the [Monitoring Query
+   * Language](https://cloud.google.com/monitoring/mql/reference) format.
+   * The default time zone is in UTC.
    * 
* * string query = 7; @@ -213,8 +214,9 @@ public java.lang.String getQuery() { * * *
-   * Required. The query in the monitoring query language format. The default
-   * time zone is in UTC.
+   * Required. The query in the [Monitoring Query
+   * Language](https://cloud.google.com/monitoring/mql/reference) format.
+   * The default time zone is in UTC.
    * 
* * string query = 7; @@ -785,8 +787,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. The query in the monitoring query language format. The default
-     * time zone is in UTC.
+     * Required. The query in the [Monitoring Query
+     * Language](https://cloud.google.com/monitoring/mql/reference) format.
+     * The default time zone is in UTC.
      * 
* * string query = 7; @@ -808,8 +811,9 @@ public java.lang.String getQuery() { * * *
-     * Required. The query in the monitoring query language format. The default
-     * time zone is in UTC.
+     * Required. The query in the [Monitoring Query
+     * Language](https://cloud.google.com/monitoring/mql/reference) format.
+     * The default time zone is in UTC.
      * 
* * string query = 7; @@ -831,8 +835,9 @@ public com.google.protobuf.ByteString getQueryBytes() { * * *
-     * Required. The query in the monitoring query language format. The default
-     * time zone is in UTC.
+     * Required. The query in the [Monitoring Query
+     * Language](https://cloud.google.com/monitoring/mql/reference) format.
+     * The default time zone is in UTC.
      * 
* * string query = 7; @@ -853,8 +858,9 @@ public Builder setQuery(java.lang.String value) { * * *
-     * Required. The query in the monitoring query language format. The default
-     * time zone is in UTC.
+     * Required. The query in the [Monitoring Query
+     * Language](https://cloud.google.com/monitoring/mql/reference) format.
+     * The default time zone is in UTC.
      * 
* * string query = 7; @@ -871,8 +877,9 @@ public Builder clearQuery() { * * *
-     * Required. The query in the monitoring query language format. The default
-     * time zone is in UTC.
+     * Required. The query in the [Monitoring Query
+     * Language](https://cloud.google.com/monitoring/mql/reference) format.
+     * The default time zone is in UTC.
      * 
* * string query = 7; diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryTimeSeriesRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryTimeSeriesRequestOrBuilder.java index ed501d09..fb661f8c 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryTimeSeriesRequestOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryTimeSeriesRequestOrBuilder.java @@ -54,8 +54,9 @@ public interface QueryTimeSeriesRequestOrBuilder * * *
-   * Required. The query in the monitoring query language format. The default
-   * time zone is in UTC.
+   * Required. The query in the [Monitoring Query
+   * Language](https://cloud.google.com/monitoring/mql/reference) format.
+   * The default time zone is in UTC.
    * 
* * string query = 7; @@ -67,8 +68,9 @@ public interface QueryTimeSeriesRequestOrBuilder * * *
-   * Required. The query in the monitoring query language format. The default
-   * time zone is in UTC.
+   * Required. The query in the [Monitoring Query
+   * Language](https://cloud.google.com/monitoring/mql/reference) format.
+   * The default time zone is in UTC.
    * 
* * string query = 7; diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Service.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Service.java index 877535a6..c5277c12 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Service.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Service.java @@ -171,6 +171,26 @@ private Service( identifierCase_ = 10; break; } + case 90: + { + com.google.monitoring.v3.Service.IstioCanonicalService.Builder subBuilder = null; + if (identifierCase_ == 11) { + subBuilder = + ((com.google.monitoring.v3.Service.IstioCanonicalService) identifier_) + .toBuilder(); + } + identifier_ = + input.readMessage( + com.google.monitoring.v3.Service.IstioCanonicalService.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.v3.Service.IstioCanonicalService) identifier_); + identifier_ = subBuilder.buildPartial(); + } + identifierCase_ = 11; + break; + } case 106: { com.google.monitoring.v3.Service.Telemetry.Builder subBuilder = null; @@ -2003,7 +2023,6 @@ public com.google.monitoring.v3.Service.CloudEndpoints getDefaultInstanceForType } } - @java.lang.Deprecated public interface ClusterIstioOrBuilder extends // @@protoc_insertion_point(interface_extends:google.monitoring.v3.Service.ClusterIstio) @@ -2126,12 +2145,12 @@ public interface ClusterIstioOrBuilder * *
    * Istio service scoped to a single Kubernetes cluster. Learn more at
-   * http://istio.io.
+   * https://istio.io. Clusters running OSS Istio will have their services
+   * ingested as this type.
    * 
* * Protobuf type {@code google.monitoring.v3.Service.ClusterIstio} */ - @java.lang.Deprecated public static final class ClusterIstio extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.monitoring.v3.Service.ClusterIstio) @@ -2640,7 +2659,8 @@ protected Builder newBuilderForType( * *
      * Istio service scoped to a single Kubernetes cluster. Learn more at
-     * http://istio.io.
+     * https://istio.io. Clusters running OSS Istio will have their services
+     * ingested as this type.
      * 
* * Protobuf type {@code google.monitoring.v3.Service.ClusterIstio} @@ -3414,7 +3434,8 @@ public interface MeshIstioOrBuilder * * *
-   * Istio service scoped to an Istio mesh
+   * Istio service scoped to an Istio mesh. Anthos clusters running ASM < 1.6.8
+   * will have their services ingested as this type.
    * 
* * Protobuf type {@code google.monitoring.v3.Service.MeshIstio} @@ -3854,7 +3875,8 @@ protected Builder newBuilderForType( * * *
-     * Istio service scoped to an Istio mesh
+     * Istio service scoped to an Istio mesh. Anthos clusters running ASM < 1.6.8
+     * will have their services ingested as this type.
      * 
* * Protobuf type {@code google.monitoring.v3.Service.MeshIstio} @@ -4409,65 +4431,132 @@ public com.google.monitoring.v3.Service.MeshIstio getDefaultInstanceForType() { } } - public interface TelemetryOrBuilder + public interface IstioCanonicalServiceOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.monitoring.v3.Service.Telemetry) + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.Service.IstioCanonicalService) com.google.protobuf.MessageOrBuilder { /** * * *
-     * The full name of the resource that defines this service. Formatted as
-     * described in https://cloud.google.com/apis/design/resource_names.
+     * Identifier for the Istio mesh in which this canonical service is defined.
+     * Corresponds to the `mesh_uid` metric label in
+     * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio).
      * 
* - * string resource_name = 1; + * string mesh_uid = 1; * - * @return The resourceName. + * @return The meshUid. */ - java.lang.String getResourceName(); + java.lang.String getMeshUid(); /** * * *
-     * The full name of the resource that defines this service. Formatted as
-     * described in https://cloud.google.com/apis/design/resource_names.
+     * Identifier for the Istio mesh in which this canonical service is defined.
+     * Corresponds to the `mesh_uid` metric label in
+     * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio).
      * 
* - * string resource_name = 1; + * string mesh_uid = 1; * - * @return The bytes for resourceName. + * @return The bytes for meshUid. */ - com.google.protobuf.ByteString getResourceNameBytes(); + com.google.protobuf.ByteString getMeshUidBytes(); + + /** + * + * + *
+     * The namespace of the canonical service underlying this service.
+     * Corresponds to the `destination_canonical_service_namespace` metric
+     * label in [Istio
+     * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+     * 
+ * + * string canonical_service_namespace = 3; + * + * @return The canonicalServiceNamespace. + */ + java.lang.String getCanonicalServiceNamespace(); + /** + * + * + *
+     * The namespace of the canonical service underlying this service.
+     * Corresponds to the `destination_canonical_service_namespace` metric
+     * label in [Istio
+     * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+     * 
+ * + * string canonical_service_namespace = 3; + * + * @return The bytes for canonicalServiceNamespace. + */ + com.google.protobuf.ByteString getCanonicalServiceNamespaceBytes(); + + /** + * + * + *
+     * The name of the canonical service underlying this service.
+     * Corresponds to the `destination_canonical_service_name` metric label in
+     * label in [Istio
+     * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+     * 
+ * + * string canonical_service = 4; + * + * @return The canonicalService. + */ + java.lang.String getCanonicalService(); + /** + * + * + *
+     * The name of the canonical service underlying this service.
+     * Corresponds to the `destination_canonical_service_name` metric label in
+     * label in [Istio
+     * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+     * 
+ * + * string canonical_service = 4; + * + * @return The bytes for canonicalService. + */ + com.google.protobuf.ByteString getCanonicalServiceBytes(); } /** * * *
-   * Configuration for how to query telemetry on a Service.
+   * Canonical service scoped to an Istio mesh. Anthos clusters running ASM >=
+   * 1.6.8 will have their services ingested as this type.
    * 
* - * Protobuf type {@code google.monitoring.v3.Service.Telemetry} + * Protobuf type {@code google.monitoring.v3.Service.IstioCanonicalService} */ - public static final class Telemetry extends com.google.protobuf.GeneratedMessageV3 + public static final class IstioCanonicalService extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.monitoring.v3.Service.Telemetry) - TelemetryOrBuilder { + // @@protoc_insertion_point(message_implements:google.monitoring.v3.Service.IstioCanonicalService) + IstioCanonicalServiceOrBuilder { private static final long serialVersionUID = 0L; - // Use Telemetry.newBuilder() to construct. - private Telemetry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use IstioCanonicalService.newBuilder() to construct. + private IstioCanonicalService(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Telemetry() { - resourceName_ = ""; + private IstioCanonicalService() { + meshUid_ = ""; + canonicalServiceNamespace_ = ""; + canonicalService_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Telemetry(); + return new IstioCanonicalService(); } @java.lang.Override @@ -4475,7 +4564,7 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Telemetry( + private IstioCanonicalService( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4497,7 +4586,21 @@ private Telemetry( { java.lang.String s = input.readStringRequireUtf8(); - resourceName_ = s; + meshUid_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + canonicalServiceNamespace_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + canonicalService_ = s; break; } default: @@ -4521,42 +4624,43 @@ private Telemetry( public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.monitoring.v3.ServiceMonitoringProto - .internal_static_google_monitoring_v3_Service_Telemetry_descriptor; + .internal_static_google_monitoring_v3_Service_IstioCanonicalService_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.monitoring.v3.ServiceMonitoringProto - .internal_static_google_monitoring_v3_Service_Telemetry_fieldAccessorTable + .internal_static_google_monitoring_v3_Service_IstioCanonicalService_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.Service.Telemetry.class, - com.google.monitoring.v3.Service.Telemetry.Builder.class); + com.google.monitoring.v3.Service.IstioCanonicalService.class, + com.google.monitoring.v3.Service.IstioCanonicalService.Builder.class); } - public static final int RESOURCE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object resourceName_; + public static final int MESH_UID_FIELD_NUMBER = 1; + private volatile java.lang.Object meshUid_; /** * * *
-     * The full name of the resource that defines this service. Formatted as
-     * described in https://cloud.google.com/apis/design/resource_names.
+     * Identifier for the Istio mesh in which this canonical service is defined.
+     * Corresponds to the `mesh_uid` metric label in
+     * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio).
      * 
* - * string resource_name = 1; + * string mesh_uid = 1; * - * @return The resourceName. + * @return The meshUid. */ @java.lang.Override - public java.lang.String getResourceName() { - java.lang.Object ref = resourceName_; + public java.lang.String getMeshUid() { + java.lang.Object ref = meshUid_; 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(); - resourceName_ = s; + meshUid_ = s; return s; } } @@ -4564,21 +4668,132 @@ public java.lang.String getResourceName() { * * *
-     * The full name of the resource that defines this service. Formatted as
-     * described in https://cloud.google.com/apis/design/resource_names.
+     * Identifier for the Istio mesh in which this canonical service is defined.
+     * Corresponds to the `mesh_uid` metric label in
+     * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio).
      * 
* - * string resource_name = 1; + * string mesh_uid = 1; * - * @return The bytes for resourceName. + * @return The bytes for meshUid. */ @java.lang.Override - public com.google.protobuf.ByteString getResourceNameBytes() { - java.lang.Object ref = resourceName_; + public com.google.protobuf.ByteString getMeshUidBytes() { + java.lang.Object ref = meshUid_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - resourceName_ = b; + meshUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANONICAL_SERVICE_NAMESPACE_FIELD_NUMBER = 3; + private volatile java.lang.Object canonicalServiceNamespace_; + /** + * + * + *
+     * The namespace of the canonical service underlying this service.
+     * Corresponds to the `destination_canonical_service_namespace` metric
+     * label in [Istio
+     * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+     * 
+ * + * string canonical_service_namespace = 3; + * + * @return The canonicalServiceNamespace. + */ + @java.lang.Override + public java.lang.String getCanonicalServiceNamespace() { + java.lang.Object ref = canonicalServiceNamespace_; + 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(); + canonicalServiceNamespace_ = s; + return s; + } + } + /** + * + * + *
+     * The namespace of the canonical service underlying this service.
+     * Corresponds to the `destination_canonical_service_namespace` metric
+     * label in [Istio
+     * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+     * 
+ * + * string canonical_service_namespace = 3; + * + * @return The bytes for canonicalServiceNamespace. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCanonicalServiceNamespaceBytes() { + java.lang.Object ref = canonicalServiceNamespace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalServiceNamespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANONICAL_SERVICE_FIELD_NUMBER = 4; + private volatile java.lang.Object canonicalService_; + /** + * + * + *
+     * The name of the canonical service underlying this service.
+     * Corresponds to the `destination_canonical_service_name` metric label in
+     * label in [Istio
+     * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+     * 
+ * + * string canonical_service = 4; + * + * @return The canonicalService. + */ + @java.lang.Override + public java.lang.String getCanonicalService() { + java.lang.Object ref = canonicalService_; + 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(); + canonicalService_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the canonical service underlying this service.
+     * Corresponds to the `destination_canonical_service_name` metric label in
+     * label in [Istio
+     * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+     * 
+ * + * string canonical_service = 4; + * + * @return The bytes for canonicalService. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCanonicalServiceBytes() { + java.lang.Object ref = canonicalService_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalService_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -4599,8 +4814,14 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getResourceNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceName_); + if (!getMeshUidBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, meshUid_); + } + if (!getCanonicalServiceNamespaceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, canonicalServiceNamespace_); + } + if (!getCanonicalServiceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, canonicalService_); } unknownFields.writeTo(output); } @@ -4611,8 +4832,15 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getResourceNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceName_); + if (!getMeshUidBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, meshUid_); + } + if (!getCanonicalServiceNamespaceBytes().isEmpty()) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(3, canonicalServiceNamespace_); + } + if (!getCanonicalServiceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, canonicalService_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -4624,13 +4852,16 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.monitoring.v3.Service.Telemetry)) { + if (!(obj instanceof com.google.monitoring.v3.Service.IstioCanonicalService)) { return super.equals(obj); } - com.google.monitoring.v3.Service.Telemetry other = - (com.google.monitoring.v3.Service.Telemetry) obj; + com.google.monitoring.v3.Service.IstioCanonicalService other = + (com.google.monitoring.v3.Service.IstioCanonicalService) obj; - if (!getResourceName().equals(other.getResourceName())) return false; + if (!getMeshUid().equals(other.getMeshUid())) return false; + if (!getCanonicalServiceNamespace().equals(other.getCanonicalServiceNamespace())) + return false; + if (!getCanonicalService().equals(other.getCanonicalService())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -4642,78 +4873,82 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + RESOURCE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getResourceName().hashCode(); + hash = (37 * hash) + MESH_UID_FIELD_NUMBER; + hash = (53 * hash) + getMeshUid().hashCode(); + hash = (37 * hash) + CANONICAL_SERVICE_NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getCanonicalServiceNamespace().hashCode(); + hash = (37 * hash) + CANONICAL_SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getCanonicalService().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static com.google.monitoring.v3.Service.Telemetry parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.monitoring.v3.Service.IstioCanonicalService parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.Service.Telemetry parseFrom( + public static com.google.monitoring.v3.Service.IstioCanonicalService 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.Service.Telemetry parseFrom( + public static com.google.monitoring.v3.Service.IstioCanonicalService parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.Service.Telemetry parseFrom( + public static com.google.monitoring.v3.Service.IstioCanonicalService 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.Service.Telemetry parseFrom(byte[] data) + public static com.google.monitoring.v3.Service.IstioCanonicalService parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.monitoring.v3.Service.Telemetry parseFrom( + public static com.google.monitoring.v3.Service.IstioCanonicalService parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.monitoring.v3.Service.Telemetry parseFrom(java.io.InputStream input) - throws java.io.IOException { + public static com.google.monitoring.v3.Service.IstioCanonicalService parseFrom( + java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.monitoring.v3.Service.Telemetry parseFrom( + public static com.google.monitoring.v3.Service.IstioCanonicalService 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.Service.Telemetry parseDelimitedFrom( + public static com.google.monitoring.v3.Service.IstioCanonicalService parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - public static com.google.monitoring.v3.Service.Telemetry parseDelimitedFrom( + public static com.google.monitoring.v3.Service.IstioCanonicalService 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.Service.Telemetry parseFrom( + public static com.google.monitoring.v3.Service.IstioCanonicalService parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.monitoring.v3.Service.Telemetry parseFrom( + public static com.google.monitoring.v3.Service.IstioCanonicalService parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -4730,7 +4965,8 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.google.monitoring.v3.Service.Telemetry prototype) { + public static Builder newBuilder( + com.google.monitoring.v3.Service.IstioCanonicalService prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -4749,32 +4985,33 @@ protected Builder newBuilderForType( * * *
-     * Configuration for how to query telemetry on a Service.
+     * Canonical service scoped to an Istio mesh. Anthos clusters running ASM >=
+     * 1.6.8 will have their services ingested as this type.
      * 
* - * Protobuf type {@code google.monitoring.v3.Service.Telemetry} + * Protobuf type {@code google.monitoring.v3.Service.IstioCanonicalService} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.monitoring.v3.Service.Telemetry) - com.google.monitoring.v3.Service.TelemetryOrBuilder { + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.Service.IstioCanonicalService) + com.google.monitoring.v3.Service.IstioCanonicalServiceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.monitoring.v3.ServiceMonitoringProto - .internal_static_google_monitoring_v3_Service_Telemetry_descriptor; + .internal_static_google_monitoring_v3_Service_IstioCanonicalService_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.monitoring.v3.ServiceMonitoringProto - .internal_static_google_monitoring_v3_Service_Telemetry_fieldAccessorTable + .internal_static_google_monitoring_v3_Service_IstioCanonicalService_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.Service.Telemetry.class, - com.google.monitoring.v3.Service.Telemetry.Builder.class); + com.google.monitoring.v3.Service.IstioCanonicalService.class, + com.google.monitoring.v3.Service.IstioCanonicalService.Builder.class); } - // Construct using com.google.monitoring.v3.Service.Telemetry.newBuilder() + // Construct using com.google.monitoring.v3.Service.IstioCanonicalService.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -4791,7 +5028,11 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - resourceName_ = ""; + meshUid_ = ""; + + canonicalServiceNamespace_ = ""; + + canonicalService_ = ""; return this; } @@ -4799,17 +5040,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.monitoring.v3.ServiceMonitoringProto - .internal_static_google_monitoring_v3_Service_Telemetry_descriptor; + .internal_static_google_monitoring_v3_Service_IstioCanonicalService_descriptor; } @java.lang.Override - public com.google.monitoring.v3.Service.Telemetry getDefaultInstanceForType() { - return com.google.monitoring.v3.Service.Telemetry.getDefaultInstance(); + public com.google.monitoring.v3.Service.IstioCanonicalService getDefaultInstanceForType() { + return com.google.monitoring.v3.Service.IstioCanonicalService.getDefaultInstance(); } @java.lang.Override - public com.google.monitoring.v3.Service.Telemetry build() { - com.google.monitoring.v3.Service.Telemetry result = buildPartial(); + public com.google.monitoring.v3.Service.IstioCanonicalService build() { + com.google.monitoring.v3.Service.IstioCanonicalService result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -4817,10 +5058,12 @@ public com.google.monitoring.v3.Service.Telemetry build() { } @java.lang.Override - public com.google.monitoring.v3.Service.Telemetry buildPartial() { - com.google.monitoring.v3.Service.Telemetry result = - new com.google.monitoring.v3.Service.Telemetry(this); - result.resourceName_ = resourceName_; + public com.google.monitoring.v3.Service.IstioCanonicalService buildPartial() { + com.google.monitoring.v3.Service.IstioCanonicalService result = + new com.google.monitoring.v3.Service.IstioCanonicalService(this); + result.meshUid_ = meshUid_; + result.canonicalServiceNamespace_ = canonicalServiceNamespace_; + result.canonicalService_ = canonicalService_; onBuilt(); return result; } @@ -4862,17 +5105,933 @@ public Builder addRepeatedField( @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.monitoring.v3.Service.Telemetry) { - return mergeFrom((com.google.monitoring.v3.Service.Telemetry) other); + if (other instanceof com.google.monitoring.v3.Service.IstioCanonicalService) { + return mergeFrom((com.google.monitoring.v3.Service.IstioCanonicalService) other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.google.monitoring.v3.Service.Telemetry other) { - if (other == com.google.monitoring.v3.Service.Telemetry.getDefaultInstance()) return this; - if (!other.getResourceName().isEmpty()) { + public Builder mergeFrom(com.google.monitoring.v3.Service.IstioCanonicalService other) { + if (other == com.google.monitoring.v3.Service.IstioCanonicalService.getDefaultInstance()) + return this; + if (!other.getMeshUid().isEmpty()) { + meshUid_ = other.meshUid_; + onChanged(); + } + if (!other.getCanonicalServiceNamespace().isEmpty()) { + canonicalServiceNamespace_ = other.canonicalServiceNamespace_; + onChanged(); + } + if (!other.getCanonicalService().isEmpty()) { + canonicalService_ = other.canonicalService_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.monitoring.v3.Service.IstioCanonicalService parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.Service.IstioCanonicalService) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object meshUid_ = ""; + /** + * + * + *
+       * Identifier for the Istio mesh in which this canonical service is defined.
+       * Corresponds to the `mesh_uid` metric label in
+       * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string mesh_uid = 1; + * + * @return The meshUid. + */ + public java.lang.String getMeshUid() { + java.lang.Object ref = meshUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + meshUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Identifier for the Istio mesh in which this canonical service is defined.
+       * Corresponds to the `mesh_uid` metric label in
+       * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string mesh_uid = 1; + * + * @return The bytes for meshUid. + */ + public com.google.protobuf.ByteString getMeshUidBytes() { + java.lang.Object ref = meshUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + meshUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Identifier for the Istio mesh in which this canonical service is defined.
+       * Corresponds to the `mesh_uid` metric label in
+       * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string mesh_uid = 1; + * + * @param value The meshUid to set. + * @return This builder for chaining. + */ + public Builder setMeshUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + meshUid_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Identifier for the Istio mesh in which this canonical service is defined.
+       * Corresponds to the `mesh_uid` metric label in
+       * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string mesh_uid = 1; + * + * @return This builder for chaining. + */ + public Builder clearMeshUid() { + + meshUid_ = getDefaultInstance().getMeshUid(); + onChanged(); + return this; + } + /** + * + * + *
+       * Identifier for the Istio mesh in which this canonical service is defined.
+       * Corresponds to the `mesh_uid` metric label in
+       * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string mesh_uid = 1; + * + * @param value The bytes for meshUid to set. + * @return This builder for chaining. + */ + public Builder setMeshUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + meshUid_ = value; + onChanged(); + return this; + } + + private java.lang.Object canonicalServiceNamespace_ = ""; + /** + * + * + *
+       * The namespace of the canonical service underlying this service.
+       * Corresponds to the `destination_canonical_service_namespace` metric
+       * label in [Istio
+       * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string canonical_service_namespace = 3; + * + * @return The canonicalServiceNamespace. + */ + public java.lang.String getCanonicalServiceNamespace() { + java.lang.Object ref = canonicalServiceNamespace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + canonicalServiceNamespace_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The namespace of the canonical service underlying this service.
+       * Corresponds to the `destination_canonical_service_namespace` metric
+       * label in [Istio
+       * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string canonical_service_namespace = 3; + * + * @return The bytes for canonicalServiceNamespace. + */ + public com.google.protobuf.ByteString getCanonicalServiceNamespaceBytes() { + java.lang.Object ref = canonicalServiceNamespace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalServiceNamespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The namespace of the canonical service underlying this service.
+       * Corresponds to the `destination_canonical_service_namespace` metric
+       * label in [Istio
+       * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string canonical_service_namespace = 3; + * + * @param value The canonicalServiceNamespace to set. + * @return This builder for chaining. + */ + public Builder setCanonicalServiceNamespace(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + canonicalServiceNamespace_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The namespace of the canonical service underlying this service.
+       * Corresponds to the `destination_canonical_service_namespace` metric
+       * label in [Istio
+       * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string canonical_service_namespace = 3; + * + * @return This builder for chaining. + */ + public Builder clearCanonicalServiceNamespace() { + + canonicalServiceNamespace_ = getDefaultInstance().getCanonicalServiceNamespace(); + onChanged(); + return this; + } + /** + * + * + *
+       * The namespace of the canonical service underlying this service.
+       * Corresponds to the `destination_canonical_service_namespace` metric
+       * label in [Istio
+       * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string canonical_service_namespace = 3; + * + * @param value The bytes for canonicalServiceNamespace to set. + * @return This builder for chaining. + */ + public Builder setCanonicalServiceNamespaceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + canonicalServiceNamespace_ = value; + onChanged(); + return this; + } + + private java.lang.Object canonicalService_ = ""; + /** + * + * + *
+       * The name of the canonical service underlying this service.
+       * Corresponds to the `destination_canonical_service_name` metric label in
+       * label in [Istio
+       * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string canonical_service = 4; + * + * @return The canonicalService. + */ + public java.lang.String getCanonicalService() { + java.lang.Object ref = canonicalService_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + canonicalService_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the canonical service underlying this service.
+       * Corresponds to the `destination_canonical_service_name` metric label in
+       * label in [Istio
+       * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string canonical_service = 4; + * + * @return The bytes for canonicalService. + */ + public com.google.protobuf.ByteString getCanonicalServiceBytes() { + java.lang.Object ref = canonicalService_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalService_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the canonical service underlying this service.
+       * Corresponds to the `destination_canonical_service_name` metric label in
+       * label in [Istio
+       * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string canonical_service = 4; + * + * @param value The canonicalService to set. + * @return This builder for chaining. + */ + public Builder setCanonicalService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + canonicalService_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the canonical service underlying this service.
+       * Corresponds to the `destination_canonical_service_name` metric label in
+       * label in [Istio
+       * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string canonical_service = 4; + * + * @return This builder for chaining. + */ + public Builder clearCanonicalService() { + + canonicalService_ = getDefaultInstance().getCanonicalService(); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the canonical service underlying this service.
+       * Corresponds to the `destination_canonical_service_name` metric label in
+       * label in [Istio
+       * metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+       * 
+ * + * string canonical_service = 4; + * + * @param value The bytes for canonicalService to set. + * @return This builder for chaining. + */ + public Builder setCanonicalServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + canonicalService_ = value; + 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.Service.IstioCanonicalService) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.Service.IstioCanonicalService) + private static final com.google.monitoring.v3.Service.IstioCanonicalService DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.Service.IstioCanonicalService(); + } + + public static com.google.monitoring.v3.Service.IstioCanonicalService getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IstioCanonicalService parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IstioCanonicalService(input, extensionRegistry); + } + }; + + 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.Service.IstioCanonicalService getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TelemetryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.Service.Telemetry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The full name of the resource that defines this service. Formatted as
+     * described in https://cloud.google.com/apis/design/resource_names.
+     * 
+ * + * string resource_name = 1; + * + * @return The resourceName. + */ + java.lang.String getResourceName(); + /** + * + * + *
+     * The full name of the resource that defines this service. Formatted as
+     * described in https://cloud.google.com/apis/design/resource_names.
+     * 
+ * + * string resource_name = 1; + * + * @return The bytes for resourceName. + */ + com.google.protobuf.ByteString getResourceNameBytes(); + } + /** + * + * + *
+   * Configuration for how to query telemetry on a Service.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.Service.Telemetry} + */ + public static final class Telemetry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.Service.Telemetry) + TelemetryOrBuilder { + private static final long serialVersionUID = 0L; + // Use Telemetry.newBuilder() to construct. + private Telemetry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Telemetry() { + resourceName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Telemetry(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Telemetry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_Telemetry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_Telemetry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.Telemetry.class, + com.google.monitoring.v3.Service.Telemetry.Builder.class); + } + + public static final int RESOURCE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object resourceName_; + /** + * + * + *
+     * The full name of the resource that defines this service. Formatted as
+     * described in https://cloud.google.com/apis/design/resource_names.
+     * 
+ * + * string resource_name = 1; + * + * @return The resourceName. + */ + @java.lang.Override + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + 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(); + resourceName_ = s; + return s; + } + } + /** + * + * + *
+     * The full name of the resource that defines this service. Formatted as
+     * described in https://cloud.google.com/apis/design/resource_names.
+     * 
+ * + * string resource_name = 1; + * + * @return The bytes for resourceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getResourceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResourceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceName_); + } + size += unknownFields.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.Service.Telemetry)) { + return super.equals(obj); + } + com.google.monitoring.v3.Service.Telemetry other = + (com.google.monitoring.v3.Service.Telemetry) obj; + + if (!getResourceName().equals(other.getResourceName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + RESOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getResourceName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.Service.Telemetry parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.Telemetry 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.Service.Telemetry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.Telemetry 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.Service.Telemetry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.Telemetry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.Service.Telemetry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service.Telemetry 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.Service.Telemetry parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service.Telemetry 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.Service.Telemetry parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service.Telemetry 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.Service.Telemetry 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; + } + /** + * + * + *
+     * Configuration for how to query telemetry on a Service.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.Service.Telemetry} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.Service.Telemetry) + com.google.monitoring.v3.Service.TelemetryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_Telemetry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_Telemetry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.Telemetry.class, + com.google.monitoring.v3.Service.Telemetry.Builder.class); + } + + // Construct using com.google.monitoring.v3.Service.Telemetry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + resourceName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_Telemetry_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.Service.Telemetry getDefaultInstanceForType() { + return com.google.monitoring.v3.Service.Telemetry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.Service.Telemetry build() { + com.google.monitoring.v3.Service.Telemetry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.Service.Telemetry buildPartial() { + com.google.monitoring.v3.Service.Telemetry result = + new com.google.monitoring.v3.Service.Telemetry(this); + result.resourceName_ = resourceName_; + onBuilt(); + return result; + } + + @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.Service.Telemetry) { + return mergeFrom((com.google.monitoring.v3.Service.Telemetry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.Service.Telemetry other) { + if (other == com.google.monitoring.v3.Service.Telemetry.getDefaultInstance()) return this; + if (!other.getResourceName().isEmpty()) { resourceName_ = other.resourceName_; onChanged(); } @@ -5078,9 +6237,9 @@ public enum IdentifierCase CUSTOM(6), APP_ENGINE(7), CLOUD_ENDPOINTS(8), - @java.lang.Deprecated CLUSTER_ISTIO(9), MESH_ISTIO(10), + ISTIO_CANONICAL_SERVICE(11), IDENTIFIER_NOT_SET(0); private final int value; @@ -5109,6 +6268,8 @@ public static IdentifierCase forNumber(int value) { return CLUSTER_ISTIO; case 10: return MESH_ISTIO; + case 11: + return ISTIO_CANONICAL_SERVICE; case 0: return IDENTIFIER_NOT_SET; default: @@ -5386,12 +6547,11 @@ public com.google.monitoring.v3.Service.CloudEndpointsOrBuilder getCloudEndpoint * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; * * @return Whether the clusterIstio field is set. */ @java.lang.Override - @java.lang.Deprecated public boolean hasClusterIstio() { return identifierCase_ == 9; } @@ -5402,12 +6562,11 @@ public boolean hasClusterIstio() { * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; * * @return The clusterIstio. */ @java.lang.Override - @java.lang.Deprecated public com.google.monitoring.v3.Service.ClusterIstio getClusterIstio() { if (identifierCase_ == 9) { return (com.google.monitoring.v3.Service.ClusterIstio) identifier_; @@ -5421,10 +6580,9 @@ public com.google.monitoring.v3.Service.ClusterIstio getClusterIstio() { * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; */ @java.lang.Override - @java.lang.Deprecated public com.google.monitoring.v3.Service.ClusterIstioOrBuilder getClusterIstioOrBuilder() { if (identifierCase_ == 9) { return (com.google.monitoring.v3.Service.ClusterIstio) identifier_; @@ -5483,6 +6641,64 @@ public com.google.monitoring.v3.Service.MeshIstioOrBuilder getMeshIstioOrBuilder return com.google.monitoring.v3.Service.MeshIstio.getDefaultInstance(); } + public static final int ISTIO_CANONICAL_SERVICE_FIELD_NUMBER = 11; + /** + * + * + *
+   * Type used for canonical services scoped to an Istio mesh.
+   * Metrics for Istio are
+   * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+   * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + * @return Whether the istioCanonicalService field is set. + */ + @java.lang.Override + public boolean hasIstioCanonicalService() { + return identifierCase_ == 11; + } + /** + * + * + *
+   * Type used for canonical services scoped to an Istio mesh.
+   * Metrics for Istio are
+   * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+   * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + * @return The istioCanonicalService. + */ + @java.lang.Override + public com.google.monitoring.v3.Service.IstioCanonicalService getIstioCanonicalService() { + if (identifierCase_ == 11) { + return (com.google.monitoring.v3.Service.IstioCanonicalService) identifier_; + } + return com.google.monitoring.v3.Service.IstioCanonicalService.getDefaultInstance(); + } + /** + * + * + *
+   * Type used for canonical services scoped to an Istio mesh.
+   * Metrics for Istio are
+   * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+   * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + */ + @java.lang.Override + public com.google.monitoring.v3.Service.IstioCanonicalServiceOrBuilder + getIstioCanonicalServiceOrBuilder() { + if (identifierCase_ == 11) { + return (com.google.monitoring.v3.Service.IstioCanonicalService) identifier_; + } + return com.google.monitoring.v3.Service.IstioCanonicalService.getDefaultInstance(); + } + public static final int TELEMETRY_FIELD_NUMBER = 13; private com.google.monitoring.v3.Service.Telemetry telemetry_; /** @@ -5566,6 +6782,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (identifierCase_ == 10) { output.writeMessage(10, (com.google.monitoring.v3.Service.MeshIstio) identifier_); } + if (identifierCase_ == 11) { + output.writeMessage(11, (com.google.monitoring.v3.Service.IstioCanonicalService) identifier_); + } if (telemetry_ != null) { output.writeMessage(13, getTelemetry()); } @@ -5609,6 +6828,11 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 10, (com.google.monitoring.v3.Service.MeshIstio) identifier_); } + if (identifierCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.monitoring.v3.Service.IstioCanonicalService) identifier_); + } if (telemetry_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getTelemetry()); } @@ -5650,6 +6874,9 @@ public boolean equals(final java.lang.Object obj) { case 10: if (!getMeshIstio().equals(other.getMeshIstio())) return false; break; + case 11: + if (!getIstioCanonicalService().equals(other.getIstioCanonicalService())) return false; + break; case 0: default: } @@ -5693,6 +6920,10 @@ public int hashCode() { hash = (37 * hash) + MESH_ISTIO_FIELD_NUMBER; hash = (53 * hash) + getMeshIstio().hashCode(); break; + case 11: + hash = (37 * hash) + ISTIO_CANONICAL_SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getIstioCanonicalService().hashCode(); + break; case 0: default: } @@ -5919,6 +7150,13 @@ public com.google.monitoring.v3.Service buildPartial() { result.identifier_ = meshIstioBuilder_.build(); } } + if (identifierCase_ == 11) { + if (istioCanonicalServiceBuilder_ == null) { + result.identifier_ = identifier_; + } else { + result.identifier_ = istioCanonicalServiceBuilder_.build(); + } + } if (telemetryBuilder_ == null) { result.telemetry_ = telemetry_; } else { @@ -6011,6 +7249,11 @@ public Builder mergeFrom(com.google.monitoring.v3.Service other) { mergeMeshIstio(other.getMeshIstio()); break; } + case ISTIO_CANONICAL_SERVICE: + { + mergeIstioCanonicalService(other.getIstioCanonicalService()); + break; + } case IDENTIFIER_NOT_SET: { break; @@ -6915,13 +8158,11 @@ public com.google.monitoring.v3.Service.CloudEndpointsOrBuilder getCloudEndpoint * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; - * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; * * @return Whether the clusterIstio field is set. */ @java.lang.Override - @java.lang.Deprecated public boolean hasClusterIstio() { return identifierCase_ == 9; } @@ -6932,13 +8173,11 @@ public boolean hasClusterIstio() { * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; - * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; * * @return The clusterIstio. */ @java.lang.Override - @java.lang.Deprecated public com.google.monitoring.v3.Service.ClusterIstio getClusterIstio() { if (clusterIstioBuilder_ == null) { if (identifierCase_ == 9) { @@ -6959,10 +8198,8 @@ public com.google.monitoring.v3.Service.ClusterIstio getClusterIstio() { * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; - * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; */ - @java.lang.Deprecated public Builder setClusterIstio(com.google.monitoring.v3.Service.ClusterIstio value) { if (clusterIstioBuilder_ == null) { if (value == null) { @@ -6983,10 +8220,8 @@ public Builder setClusterIstio(com.google.monitoring.v3.Service.ClusterIstio val * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; - * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; */ - @java.lang.Deprecated public Builder setClusterIstio( com.google.monitoring.v3.Service.ClusterIstio.Builder builderForValue) { if (clusterIstioBuilder_ == null) { @@ -7005,10 +8240,8 @@ public Builder setClusterIstio( * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; - * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; */ - @java.lang.Deprecated public Builder mergeClusterIstio(com.google.monitoring.v3.Service.ClusterIstio value) { if (clusterIstioBuilder_ == null) { if (identifierCase_ == 9 @@ -7038,10 +8271,8 @@ public Builder mergeClusterIstio(com.google.monitoring.v3.Service.ClusterIstio v * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; - * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; */ - @java.lang.Deprecated public Builder clearClusterIstio() { if (clusterIstioBuilder_ == null) { if (identifierCase_ == 9) { @@ -7065,10 +8296,8 @@ public Builder clearClusterIstio() { * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; - * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; */ - @java.lang.Deprecated public com.google.monitoring.v3.Service.ClusterIstio.Builder getClusterIstioBuilder() { return getClusterIstioFieldBuilder().getBuilder(); } @@ -7079,11 +8308,9 @@ public com.google.monitoring.v3.Service.ClusterIstio.Builder getClusterIstioBuil * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; - * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; */ @java.lang.Override - @java.lang.Deprecated public com.google.monitoring.v3.Service.ClusterIstioOrBuilder getClusterIstioOrBuilder() { if ((identifierCase_ == 9) && (clusterIstioBuilder_ != null)) { return clusterIstioBuilder_.getMessageOrBuilder(); @@ -7101,8 +8328,7 @@ public com.google.monitoring.v3.Service.ClusterIstioOrBuilder getClusterIstioOrB * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; - * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.monitoring.v3.Service.ClusterIstio, @@ -7338,6 +8564,247 @@ public com.google.monitoring.v3.Service.MeshIstioOrBuilder getMeshIstioOrBuilder return meshIstioBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.IstioCanonicalService, + com.google.monitoring.v3.Service.IstioCanonicalService.Builder, + com.google.monitoring.v3.Service.IstioCanonicalServiceOrBuilder> + istioCanonicalServiceBuilder_; + /** + * + * + *
+     * Type used for canonical services scoped to an Istio mesh.
+     * Metrics for Istio are
+     * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+     * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + * + * @return Whether the istioCanonicalService field is set. + */ + @java.lang.Override + public boolean hasIstioCanonicalService() { + return identifierCase_ == 11; + } + /** + * + * + *
+     * Type used for canonical services scoped to an Istio mesh.
+     * Metrics for Istio are
+     * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+     * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + * + * @return The istioCanonicalService. + */ + @java.lang.Override + public com.google.monitoring.v3.Service.IstioCanonicalService getIstioCanonicalService() { + if (istioCanonicalServiceBuilder_ == null) { + if (identifierCase_ == 11) { + return (com.google.monitoring.v3.Service.IstioCanonicalService) identifier_; + } + return com.google.monitoring.v3.Service.IstioCanonicalService.getDefaultInstance(); + } else { + if (identifierCase_ == 11) { + return istioCanonicalServiceBuilder_.getMessage(); + } + return com.google.monitoring.v3.Service.IstioCanonicalService.getDefaultInstance(); + } + } + /** + * + * + *
+     * Type used for canonical services scoped to an Istio mesh.
+     * Metrics for Istio are
+     * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+     * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + */ + public Builder setIstioCanonicalService( + com.google.monitoring.v3.Service.IstioCanonicalService value) { + if (istioCanonicalServiceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + identifier_ = value; + onChanged(); + } else { + istioCanonicalServiceBuilder_.setMessage(value); + } + identifierCase_ = 11; + return this; + } + /** + * + * + *
+     * Type used for canonical services scoped to an Istio mesh.
+     * Metrics for Istio are
+     * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+     * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + */ + public Builder setIstioCanonicalService( + com.google.monitoring.v3.Service.IstioCanonicalService.Builder builderForValue) { + if (istioCanonicalServiceBuilder_ == null) { + identifier_ = builderForValue.build(); + onChanged(); + } else { + istioCanonicalServiceBuilder_.setMessage(builderForValue.build()); + } + identifierCase_ = 11; + return this; + } + /** + * + * + *
+     * Type used for canonical services scoped to an Istio mesh.
+     * Metrics for Istio are
+     * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+     * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + */ + public Builder mergeIstioCanonicalService( + com.google.monitoring.v3.Service.IstioCanonicalService value) { + if (istioCanonicalServiceBuilder_ == null) { + if (identifierCase_ == 11 + && identifier_ + != com.google.monitoring.v3.Service.IstioCanonicalService.getDefaultInstance()) { + identifier_ = + com.google.monitoring.v3.Service.IstioCanonicalService.newBuilder( + (com.google.monitoring.v3.Service.IstioCanonicalService) identifier_) + .mergeFrom(value) + .buildPartial(); + } else { + identifier_ = value; + } + onChanged(); + } else { + if (identifierCase_ == 11) { + istioCanonicalServiceBuilder_.mergeFrom(value); + } + istioCanonicalServiceBuilder_.setMessage(value); + } + identifierCase_ = 11; + return this; + } + /** + * + * + *
+     * Type used for canonical services scoped to an Istio mesh.
+     * Metrics for Istio are
+     * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+     * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + */ + public Builder clearIstioCanonicalService() { + if (istioCanonicalServiceBuilder_ == null) { + if (identifierCase_ == 11) { + identifierCase_ = 0; + identifier_ = null; + onChanged(); + } + } else { + if (identifierCase_ == 11) { + identifierCase_ = 0; + identifier_ = null; + } + istioCanonicalServiceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Type used for canonical services scoped to an Istio mesh.
+     * Metrics for Istio are
+     * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+     * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + */ + public com.google.monitoring.v3.Service.IstioCanonicalService.Builder + getIstioCanonicalServiceBuilder() { + return getIstioCanonicalServiceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Type used for canonical services scoped to an Istio mesh.
+     * Metrics for Istio are
+     * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+     * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + */ + @java.lang.Override + public com.google.monitoring.v3.Service.IstioCanonicalServiceOrBuilder + getIstioCanonicalServiceOrBuilder() { + if ((identifierCase_ == 11) && (istioCanonicalServiceBuilder_ != null)) { + return istioCanonicalServiceBuilder_.getMessageOrBuilder(); + } else { + if (identifierCase_ == 11) { + return (com.google.monitoring.v3.Service.IstioCanonicalService) identifier_; + } + return com.google.monitoring.v3.Service.IstioCanonicalService.getDefaultInstance(); + } + } + /** + * + * + *
+     * Type used for canonical services scoped to an Istio mesh.
+     * Metrics for Istio are
+     * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+     * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.IstioCanonicalService, + com.google.monitoring.v3.Service.IstioCanonicalService.Builder, + com.google.monitoring.v3.Service.IstioCanonicalServiceOrBuilder> + getIstioCanonicalServiceFieldBuilder() { + if (istioCanonicalServiceBuilder_ == null) { + if (!(identifierCase_ == 11)) { + identifier_ = com.google.monitoring.v3.Service.IstioCanonicalService.getDefaultInstance(); + } + istioCanonicalServiceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.IstioCanonicalService, + com.google.monitoring.v3.Service.IstioCanonicalService.Builder, + com.google.monitoring.v3.Service.IstioCanonicalServiceOrBuilder>( + (com.google.monitoring.v3.Service.IstioCanonicalService) identifier_, + getParentForChildren(), + isClean()); + identifier_ = null; + } + identifierCase_ = 11; + onChanged(); + ; + return istioCanonicalServiceBuilder_; + } + private com.google.monitoring.v3.Service.Telemetry telemetry_; private com.google.protobuf.SingleFieldBuilderV3< com.google.monitoring.v3.Service.Telemetry, diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringProto.java index 2288dd4f..7a15d846 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringProto.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringProto.java @@ -51,6 +51,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_monitoring_v3_Service_MeshIstio_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_monitoring_v3_Service_MeshIstio_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_Service_IstioCanonicalService_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_Service_IstioCanonicalService_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_monitoring_v3_Service_Telemetry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -113,101 +117,104 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\"google/monitoring/v3/service.proto\022\024go" - + "ogle.monitoring.v3\032#google/api/monitored" - + "_resource.proto\032\031google/api/resource.pro" - + "to\032\036google/protobuf/duration.proto\032\037goog" - + "le/protobuf/timestamp.proto\032!google/type" - + "/calendar_period.proto\"\227\007\n\007Service\022\014\n\004na" - + "me\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\0226\n\006custom" - + "\030\006 \001(\0132$.google.monitoring.v3.Service.Cu" - + "stomH\000\022=\n\napp_engine\030\007 \001(\0132\'.google.moni" - + "toring.v3.Service.AppEngineH\000\022G\n\017cloud_e" - + "ndpoints\030\010 \001(\0132,.google.monitoring.v3.Se" - + "rvice.CloudEndpointsH\000\022G\n\rcluster_istio\030" - + "\t \001(\0132*.google.monitoring.v3.Service.Clu" - + "sterIstioB\002\030\001H\000\022=\n\nmesh_istio\030\n \001(\0132\'.go" - + "ogle.monitoring.v3.Service.MeshIstioH\000\022:" - + "\n\ttelemetry\030\r \001(\0132\'.google.monitoring.v3" - + ".Service.Telemetry\032\010\n\006Custom\032\036\n\tAppEngin" - + "e\022\021\n\tmodule_id\030\001 \001(\t\032!\n\016CloudEndpoints\022\017" - + "\n\007service\030\001 \001(\t\032k\n\014ClusterIstio\022\020\n\010locat" - + "ion\030\001 \001(\t\022\024\n\014cluster_name\030\002 \001(\t\022\031\n\021servi" - + "ce_namespace\030\003 \001(\t\022\024\n\014service_name\030\004 \001(\t" - + ":\002\030\001\032N\n\tMeshIstio\022\020\n\010mesh_uid\030\001 \001(\t\022\031\n\021s" - + "ervice_namespace\030\003 \001(\t\022\024\n\014service_name\030\004" - + " \001(\t\032\"\n\tTelemetry\022\025\n\rresource_name\030\001 \001(\t" - + ":\247\001\352A\243\001\n!monitoring.googleapis.com/Servi" - + "ce\022%projects/{project}/services/{service" - + "}\022/organizations/{organization}/services" - + "/{service}\022#folders/{folder}/services/{s" - + "ervice}\022\001*B\014\n\nidentifier\"\221\005\n\025ServiceLeve" - + "lObjective\022\014\n\004name\030\001 \001(\t\022\024\n\014display_name" - + "\030\013 \001(\t\022L\n\027service_level_indicator\030\003 \001(\0132" - + "+.google.monitoring.v3.ServiceLevelIndic" - + "ator\022\014\n\004goal\030\004 \001(\001\0223\n\016rolling_period\030\005 \001" - + "(\0132\031.google.protobuf.DurationH\000\0226\n\017calen" - + "dar_period\030\006 \001(\0162\033.google.type.CalendarP" - + "eriodH\000\"4\n\004View\022\024\n\020VIEW_UNSPECIFIED\020\000\022\010\n" - + "\004FULL\020\002\022\014\n\010EXPLICIT\020\001:\312\002\352A\306\002\n/monitoring" - + ".googleapis.com/ServiceLevelObjective\022Vp" - + "rojects/{project}/services/{service}/ser" - + "viceLevelObjectives/{service_level_objec" - + "tive}\022`organizations/{organization}/serv" - + "ices/{service}/serviceLevelObjectives/{s" - + "ervice_level_objective}\022Tfolders/{folder" - + "}/services/{service}/serviceLevelObjecti" - + "ves/{service_level_objective}\022\001* \001B\010\n\006pe" - + "riod\"\324\001\n\025ServiceLevelIndicator\0223\n\tbasic_" - + "sli\030\004 \001(\0132\036.google.monitoring.v3.BasicSl" - + "iH\000\022>\n\rrequest_based\030\001 \001(\0132%.google.moni" - + "toring.v3.RequestBasedSliH\000\022>\n\rwindows_b" - + "ased\030\002 \001(\0132%.google.monitoring.v3.Window" - + "sBasedSliH\000B\006\n\004type\"\266\002\n\010BasicSli\022\016\n\006meth" - + "od\030\007 \003(\t\022\020\n\010location\030\010 \003(\t\022\017\n\007version\030\t " - + "\003(\t\022K\n\014availability\030\002 \001(\01323.google.monit" - + "oring.v3.BasicSli.AvailabilityCriteriaH\000" - + "\022A\n\007latency\030\003 \001(\0132..google.monitoring.v3" - + ".BasicSli.LatencyCriteriaH\000\032\026\n\024Availabil" - + "ityCriteria\032?\n\017LatencyCriteria\022,\n\tthresh" - + "old\030\003 \001(\0132\031.google.protobuf.DurationB\016\n\014" - + "sli_criteria\"!\n\005Range\022\013\n\003min\030\001 \001(\001\022\013\n\003ma" - + "x\030\002 \001(\001\"\241\001\n\017RequestBasedSli\022A\n\020good_tota" - + "l_ratio\030\001 \001(\0132%.google.monitoring.v3.Tim" - + "eSeriesRatioH\000\022A\n\020distribution_cut\030\003 \001(\013" - + "2%.google.monitoring.v3.DistributionCutH" - + "\000B\010\n\006method\"h\n\017TimeSeriesRatio\022\033\n\023good_s" - + "ervice_filter\030\004 \001(\t\022\032\n\022bad_service_filte" - + "r\030\005 \001(\t\022\034\n\024total_service_filter\030\006 \001(\t\"Z\n" - + "\017DistributionCut\022\033\n\023distribution_filter\030" - + "\004 \001(\t\022*\n\005range\030\005 \001(\0132\033.google.monitoring" - + ".v3.Range\"\203\005\n\017WindowsBasedSli\022 \n\026good_ba" - + "d_metric_filter\030\005 \001(\tH\000\022`\n\032good_total_ra" - + "tio_threshold\030\002 \001(\0132:.google.monitoring." - + "v3.WindowsBasedSli.PerformanceThresholdH" - + "\000\022Q\n\024metric_mean_in_range\030\006 \001(\01321.google" - + ".monitoring.v3.WindowsBasedSli.MetricRan" - + "geH\000\022P\n\023metric_sum_in_range\030\007 \001(\01321.goog" - + "le.monitoring.v3.WindowsBasedSli.MetricR" - + "angeH\000\0220\n\rwindow_period\030\004 \001(\0132\031.google.p" - + "rotobuf.Duration\032\260\001\n\024PerformanceThreshol" - + "d\022<\n\013performance\030\001 \001(\0132%.google.monitori" - + "ng.v3.RequestBasedSliH\000\022?\n\025basic_sli_per" - + "formance\030\003 \001(\0132\036.google.monitoring.v3.Ba" - + "sicSliH\000\022\021\n\tthreshold\030\002 \001(\001B\006\n\004type\032N\n\013M" - + "etricRange\022\023\n\013time_series\030\001 \001(\t\022*\n\005range" - + "\030\004 \001(\0132\033.google.monitoring.v3.RangeB\022\n\020w" - + "indow_criterionB\316\001\n\030com.google.monitorin" - + "g.v3B\026ServiceMonitoringProtoP\001Z>google.g" - + "olang.org/genproto/googleapis/monitoring" - + "/v3;monitoring\252\002\032Google.Cloud.Monitoring" - + ".V3\312\002\032Google\\Cloud\\Monitoring\\V3\352\002\035Googl" - + "e::Cloud::Monitoring::V3b\006proto3" + + "ogle.monitoring.v3\032\031google/api/resource." + + "proto\032\036google/protobuf/duration.proto\032\037g" + + "oogle/protobuf/timestamp.proto\032!google/t" + + "ype/calendar_period.proto\"\322\010\n\007Service\022\014\n" + + "\004name\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\0226\n\006cus" + + "tom\030\006 \001(\0132$.google.monitoring.v3.Service" + + ".CustomH\000\022=\n\napp_engine\030\007 \001(\0132\'.google.m" + + "onitoring.v3.Service.AppEngineH\000\022G\n\017clou" + + "d_endpoints\030\010 \001(\0132,.google.monitoring.v3" + + ".Service.CloudEndpointsH\000\022C\n\rcluster_ist" + + "io\030\t \001(\0132*.google.monitoring.v3.Service." + + "ClusterIstioH\000\022=\n\nmesh_istio\030\n \001(\0132\'.goo" + + "gle.monitoring.v3.Service.MeshIstioH\000\022V\n" + + "\027istio_canonical_service\030\013 \001(\01323.google." + + "monitoring.v3.Service.IstioCanonicalServ" + + "iceH\000\022:\n\ttelemetry\030\r \001(\0132\'.google.monito" + + "ring.v3.Service.Telemetry\032\010\n\006Custom\032\036\n\tA" + + "ppEngine\022\021\n\tmodule_id\030\001 \001(\t\032!\n\016CloudEndp" + + "oints\022\017\n\007service\030\001 \001(\t\032g\n\014ClusterIstio\022\020" + + "\n\010location\030\001 \001(\t\022\024\n\014cluster_name\030\002 \001(\t\022\031" + + "\n\021service_namespace\030\003 \001(\t\022\024\n\014service_nam" + + "e\030\004 \001(\t\032N\n\tMeshIstio\022\020\n\010mesh_uid\030\001 \001(\t\022\031" + + "\n\021service_namespace\030\003 \001(\t\022\024\n\014service_nam" + + "e\030\004 \001(\t\032i\n\025IstioCanonicalService\022\020\n\010mesh" + + "_uid\030\001 \001(\t\022#\n\033canonical_service_namespac" + + "e\030\003 \001(\t\022\031\n\021canonical_service\030\004 \001(\t\032\"\n\tTe" + + "lemetry\022\025\n\rresource_name\030\001 \001(\t:\247\001\352A\243\001\n!m" + + "onitoring.googleapis.com/Service\022%projec" + + "ts/{project}/services/{service}\022/organiz" + + "ations/{organization}/services/{service}" + + "\022#folders/{folder}/services/{service}\022\001*" + + "B\014\n\nidentifier\"\221\005\n\025ServiceLevelObjective" + + "\022\014\n\004name\030\001 \001(\t\022\024\n\014display_name\030\013 \001(\t\022L\n\027" + + "service_level_indicator\030\003 \001(\0132+.google.m" + + "onitoring.v3.ServiceLevelIndicator\022\014\n\004go" + + "al\030\004 \001(\001\0223\n\016rolling_period\030\005 \001(\0132\031.googl" + + "e.protobuf.DurationH\000\0226\n\017calendar_period" + + "\030\006 \001(\0162\033.google.type.CalendarPeriodH\000\"4\n" + + "\004View\022\024\n\020VIEW_UNSPECIFIED\020\000\022\010\n\004FULL\020\002\022\014\n" + + "\010EXPLICIT\020\001:\312\002\352A\306\002\n/monitoring.googleapi" + + "s.com/ServiceLevelObjective\022Vprojects/{p" + + "roject}/services/{service}/serviceLevelO" + + "bjectives/{service_level_objective}\022`org" + + "anizations/{organization}/services/{serv" + + "ice}/serviceLevelObjectives/{service_lev" + + "el_objective}\022Tfolders/{folder}/services" + + "/{service}/serviceLevelObjectives/{servi" + + "ce_level_objective}\022\001* \001B\010\n\006period\"\324\001\n\025S" + + "erviceLevelIndicator\0223\n\tbasic_sli\030\004 \001(\0132" + + "\036.google.monitoring.v3.BasicSliH\000\022>\n\rreq" + + "uest_based\030\001 \001(\0132%.google.monitoring.v3." + + "RequestBasedSliH\000\022>\n\rwindows_based\030\002 \001(\013" + + "2%.google.monitoring.v3.WindowsBasedSliH" + + "\000B\006\n\004type\"\266\002\n\010BasicSli\022\016\n\006method\030\007 \003(\t\022\020" + + "\n\010location\030\010 \003(\t\022\017\n\007version\030\t \003(\t\022K\n\014ava" + + "ilability\030\002 \001(\01323.google.monitoring.v3.B" + + "asicSli.AvailabilityCriteriaH\000\022A\n\007latenc" + + "y\030\003 \001(\0132..google.monitoring.v3.BasicSli." + + "LatencyCriteriaH\000\032\026\n\024AvailabilityCriteri" + + "a\032?\n\017LatencyCriteria\022,\n\tthreshold\030\003 \001(\0132" + + "\031.google.protobuf.DurationB\016\n\014sli_criter" + + "ia\"!\n\005Range\022\013\n\003min\030\001 \001(\001\022\013\n\003max\030\002 \001(\001\"\241\001" + + "\n\017RequestBasedSli\022A\n\020good_total_ratio\030\001 " + + "\001(\0132%.google.monitoring.v3.TimeSeriesRat" + + "ioH\000\022A\n\020distribution_cut\030\003 \001(\0132%.google." + + "monitoring.v3.DistributionCutH\000B\010\n\006metho" + + "d\"h\n\017TimeSeriesRatio\022\033\n\023good_service_fil" + + "ter\030\004 \001(\t\022\032\n\022bad_service_filter\030\005 \001(\t\022\034\n" + + "\024total_service_filter\030\006 \001(\t\"Z\n\017Distribut" + + "ionCut\022\033\n\023distribution_filter\030\004 \001(\t\022*\n\005r" + + "ange\030\005 \001(\0132\033.google.monitoring.v3.Range\"" + + "\203\005\n\017WindowsBasedSli\022 \n\026good_bad_metric_f" + + "ilter\030\005 \001(\tH\000\022`\n\032good_total_ratio_thresh" + + "old\030\002 \001(\0132:.google.monitoring.v3.Windows" + + "BasedSli.PerformanceThresholdH\000\022Q\n\024metri" + + "c_mean_in_range\030\006 \001(\01321.google.monitorin" + + "g.v3.WindowsBasedSli.MetricRangeH\000\022P\n\023me" + + "tric_sum_in_range\030\007 \001(\01321.google.monitor" + + "ing.v3.WindowsBasedSli.MetricRangeH\000\0220\n\r" + + "window_period\030\004 \001(\0132\031.google.protobuf.Du" + + "ration\032\260\001\n\024PerformanceThreshold\022<\n\013perfo" + + "rmance\030\001 \001(\0132%.google.monitoring.v3.Requ" + + "estBasedSliH\000\022?\n\025basic_sli_performance\030\003" + + " \001(\0132\036.google.monitoring.v3.BasicSliH\000\022\021" + + "\n\tthreshold\030\002 \001(\001B\006\n\004type\032N\n\013MetricRange" + + "\022\023\n\013time_series\030\001 \001(\t\022*\n\005range\030\004 \001(\0132\033.g" + + "oogle.monitoring.v3.RangeB\022\n\020window_crit" + + "erionB\316\001\n\030com.google.monitoring.v3B\026Serv" + + "iceMonitoringProtoP\001Z>google.golang.org/" + + "genproto/googleapis/monitoring/v3;monito" + + "ring\252\002\032Google.Cloud.Monitoring.V3\312\002\032Goog" + + "le\\Cloud\\Monitoring\\V3\352\002\035Google::Cloud::" + + "Monitoring::V3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.MonitoredResourceProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), com.google.protobuf.DurationProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), @@ -226,6 +233,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CloudEndpoints", "ClusterIstio", "MeshIstio", + "IstioCanonicalService", "Telemetry", "Identifier", }); @@ -267,8 +275,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "MeshUid", "ServiceNamespace", "ServiceName", }); - internal_static_google_monitoring_v3_Service_Telemetry_descriptor = + internal_static_google_monitoring_v3_Service_IstioCanonicalService_descriptor = internal_static_google_monitoring_v3_Service_descriptor.getNestedTypes().get(5); + internal_static_google_monitoring_v3_Service_IstioCanonicalService_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_Service_IstioCanonicalService_descriptor, + new java.lang.String[] { + "MeshUid", "CanonicalServiceNamespace", "CanonicalService", + }); + internal_static_google_monitoring_v3_Service_Telemetry_descriptor = + internal_static_google_monitoring_v3_Service_descriptor.getNestedTypes().get(6); internal_static_google_monitoring_v3_Service_Telemetry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_Service_Telemetry_descriptor, @@ -385,7 +401,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ResourceProto.resource); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); - com.google.api.MonitoredResourceProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); com.google.protobuf.DurationProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceOrBuilder.java index af66f2d5..5d95fc32 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceOrBuilder.java @@ -187,11 +187,10 @@ public interface ServiceOrBuilder * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; * * @return Whether the clusterIstio field is set. */ - @java.lang.Deprecated boolean hasClusterIstio(); /** * @@ -200,11 +199,10 @@ public interface ServiceOrBuilder * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; * * @return The clusterIstio. */ - @java.lang.Deprecated com.google.monitoring.v3.Service.ClusterIstio getClusterIstio(); /** * @@ -213,9 +211,8 @@ public interface ServiceOrBuilder * Type used for Istio services that live in a Kubernetes cluster. * * - * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; */ - @java.lang.Deprecated com.google.monitoring.v3.Service.ClusterIstioOrBuilder getClusterIstioOrBuilder(); /** @@ -253,6 +250,48 @@ public interface ServiceOrBuilder */ com.google.monitoring.v3.Service.MeshIstioOrBuilder getMeshIstioOrBuilder(); + /** + * + * + *
+   * Type used for canonical services scoped to an Istio mesh.
+   * Metrics for Istio are
+   * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+   * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + * @return Whether the istioCanonicalService field is set. + */ + boolean hasIstioCanonicalService(); + /** + * + * + *
+   * Type used for canonical services scoped to an Istio mesh.
+   * Metrics for Istio are
+   * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+   * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * + * @return The istioCanonicalService. + */ + com.google.monitoring.v3.Service.IstioCanonicalService getIstioCanonicalService(); + /** + * + * + *
+   * Type used for canonical services scoped to an Istio mesh.
+   * Metrics for Istio are
+   * [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+   * 
+ * + * .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + */ + com.google.monitoring.v3.Service.IstioCanonicalServiceOrBuilder + getIstioCanonicalServiceOrBuilder(); + /** * * diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeInterval.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeInterval.java index 0c40a8e0..d1c5d8d5 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeInterval.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeInterval.java @@ -22,25 +22,30 @@ * * *
- * A closed time interval. It extends from the start time to the end time, and
- * includes both: `[startTime, endTime]`. Valid time intervals depend on the
- * [`MetricKind`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind)
- * of the metric value. In no case can the end time be earlier than the start
- * time.
- * * For a `GAUGE` metric, the `startTime` value is technically optional; if
+ * A closed time interval. It extends from the start time to the end time, and includes both: `[startTime, endTime]`. Valid time intervals depend on the [`MetricKind`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind) of the metric value. The end time must not be earlier than the start time. When writing data points, the start time must not be more than 25 hours in the past and the end time must not be more than five minutes in the future.
+ * * For `GAUGE` metrics, the `startTime` value is technically optional; if
  *   no value is specified, the start time defaults to the value of the
  *   end time, and the interval represents a single point in time. If both
  *   start and end times are specified, they must be identical. Such an
  *   interval is valid only for `GAUGE` metrics, which are point-in-time
- *   measurements.
- * * For `DELTA` and `CUMULATIVE` metrics, the start time must be earlier
- *   than the end time.
- * * In all cases, the start time of the next interval must be
- *   at least a millisecond after the end time of the previous interval.
- *   Because the interval is closed, if the start time of a new interval
- *   is the same as the end time of the previous interval, data written
- *   at the new start time could overwrite data written at the previous
- *   end time.
+ *   measurements. The end time of a new interval must be at least a
+ *   millisecond after the end time of the previous interval.
+ * * For `DELTA` metrics, the start time and end time must specify a
+ *   non-zero interval, with subsequent points specifying contiguous and
+ *   non-overlapping intervals. For `DELTA` metrics, the start time of
+ *   the next interval must be at least a millisecond after the end time
+ *   of the previous interval.
+ * * For `CUMULATIVE` metrics, the start time and end time must specify a
+ *   a non-zero interval, with subsequent points specifying the same
+ *   start time and increasing end times, until an event resets the
+ *   cumulative value to zero and sets a new start time for the following
+ *   points. The new start time must be at least a millisecond after the
+ *   end time of the previous interval.
+ * * The start time of a new interval must be at least a millisecond after the
+ *   end time of the previous interval because intervals are closed. If the
+ *   start time of a new interval is the same as the end time of the previous
+ *   interval, then data written at the new start time could overwrite data
+ *   written at the previous end time.
  * 
* * Protobuf type {@code google.monitoring.v3.TimeInterval} @@ -428,25 +433,30 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * A closed time interval. It extends from the start time to the end time, and
-   * includes both: `[startTime, endTime]`. Valid time intervals depend on the
-   * [`MetricKind`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind)
-   * of the metric value. In no case can the end time be earlier than the start
-   * time.
-   * * For a `GAUGE` metric, the `startTime` value is technically optional; if
+   * A closed time interval. It extends from the start time to the end time, and includes both: `[startTime, endTime]`. Valid time intervals depend on the [`MetricKind`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind) of the metric value. The end time must not be earlier than the start time. When writing data points, the start time must not be more than 25 hours in the past and the end time must not be more than five minutes in the future.
+   * * For `GAUGE` metrics, the `startTime` value is technically optional; if
    *   no value is specified, the start time defaults to the value of the
    *   end time, and the interval represents a single point in time. If both
    *   start and end times are specified, they must be identical. Such an
    *   interval is valid only for `GAUGE` metrics, which are point-in-time
-   *   measurements.
-   * * For `DELTA` and `CUMULATIVE` metrics, the start time must be earlier
-   *   than the end time.
-   * * In all cases, the start time of the next interval must be
-   *   at least a millisecond after the end time of the previous interval.
-   *   Because the interval is closed, if the start time of a new interval
-   *   is the same as the end time of the previous interval, data written
-   *   at the new start time could overwrite data written at the previous
-   *   end time.
+   *   measurements. The end time of a new interval must be at least a
+   *   millisecond after the end time of the previous interval.
+   * * For `DELTA` metrics, the start time and end time must specify a
+   *   non-zero interval, with subsequent points specifying contiguous and
+   *   non-overlapping intervals. For `DELTA` metrics, the start time of
+   *   the next interval must be at least a millisecond after the end time
+   *   of the previous interval.
+   * * For `CUMULATIVE` metrics, the start time and end time must specify a
+   *   a non-zero interval, with subsequent points specifying the same
+   *   start time and increasing end times, until an event resets the
+   *   cumulative value to zero and sets a new start time for the following
+   *   points. The new start time must be at least a millisecond after the
+   *   end time of the previous interval.
+   * * The start time of a new interval must be at least a millisecond after the
+   *   end time of the previous interval because intervals are closed. If the
+   *   start time of a new interval is the same as the end time of the previous
+   *   interval, then data written at the new start time could overwrite data
+   *   written at the previous end time.
    * 
* * Protobuf type {@code google.monitoring.v3.TimeInterval} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeries.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeries.java index 7287e695..71e071e8 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeries.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeries.java @@ -44,6 +44,7 @@ private TimeSeries() { metricKind_ = 0; valueType_ = 0; points_ = java.util.Collections.emptyList(); + unit_ = ""; } @java.lang.Override @@ -143,6 +144,13 @@ private TimeSeries( metadata_ = subBuilder.buildPartial(); } + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + unit_ = s; break; } default: @@ -287,8 +295,8 @@ public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { * *
    * Output only. The associated monitored resource metadata. When reading a
-   * a timeseries, this field will include metadata labels that are explicitly
-   * named in the reduction. When creating a timeseries, this field is ignored.
+   * time series, this field will include metadata labels that are explicitly
+   * named in the reduction. When creating a time series, this field is ignored.
    * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -304,8 +312,8 @@ public boolean hasMetadata() { * *
    * Output only. The associated monitored resource metadata. When reading a
-   * a timeseries, this field will include metadata labels that are explicitly
-   * named in the reduction. When creating a timeseries, this field is ignored.
+   * time series, this field will include metadata labels that are explicitly
+   * named in the reduction. When creating a time series, this field is ignored.
    * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -323,8 +331,8 @@ public com.google.api.MonitoredResourceMetadata getMetadata() { * *
    * Output only. The associated monitored resource metadata. When reading a
-   * a timeseries, this field will include metadata labels that are explicitly
-   * named in the reduction. When creating a timeseries, this field is ignored.
+   * time series, this field will include metadata labels that are explicitly
+   * named in the reduction. When creating a time series, this field is ignored.
    * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -527,6 +535,59 @@ public com.google.monitoring.v3.PointOrBuilder getPointsOrBuilder(int index) { return points_.get(index); } + public static final int UNIT_FIELD_NUMBER = 8; + private volatile java.lang.Object unit_; + /** + * + * + *
+   * The units in which the metric value is reported. It is only applicable
+   * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
+   * defines the representation of the stored metric values.
+   * 
+ * + * string unit = 8; + * + * @return The unit. + */ + @java.lang.Override + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + 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(); + unit_ = s; + return s; + } + } + /** + * + * + *
+   * The units in which the metric value is reported. It is only applicable
+   * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
+   * defines the representation of the stored metric values.
+   * 
+ * + * string unit = 8; + * + * @return The bytes for unit. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -561,6 +622,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (metadata_ != null) { output.writeMessage(7, getMetadata()); } + if (!getUnitBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, unit_); + } unknownFields.writeTo(output); } @@ -590,6 +654,9 @@ public int getSerializedSize() { if (metadata_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getMetadata()); } + if (!getUnitBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, unit_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -620,6 +687,7 @@ public boolean equals(final java.lang.Object obj) { if (metricKind_ != other.metricKind_) return false; if (valueType_ != other.valueType_) return false; if (!getPointsList().equals(other.getPointsList())) return false; + if (!getUnit().equals(other.getUnit())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -651,6 +719,8 @@ public int hashCode() { hash = (37 * hash) + POINTS_FIELD_NUMBER; hash = (53 * hash) + getPointsList().hashCode(); } + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -828,6 +898,8 @@ public Builder clear() { } else { pointsBuilder_.clear(); } + unit_ = ""; + return this; } @@ -881,6 +953,7 @@ public com.google.monitoring.v3.TimeSeries buildPartial() { } else { result.points_ = pointsBuilder_.build(); } + result.unit_ = unit_; onBuilt(); return result; } @@ -972,6 +1045,10 @@ public Builder mergeFrom(com.google.monitoring.v3.TimeSeries other) { } } } + if (!other.getUnit().isEmpty()) { + unit_ = other.unit_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1390,8 +1467,8 @@ public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { * *
      * Output only. The associated monitored resource metadata. When reading a
-     * a timeseries, this field will include metadata labels that are explicitly
-     * named in the reduction. When creating a timeseries, this field is ignored.
+     * time series, this field will include metadata labels that are explicitly
+     * named in the reduction. When creating a time series, this field is ignored.
      * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -1406,8 +1483,8 @@ public boolean hasMetadata() { * *
      * Output only. The associated monitored resource metadata. When reading a
-     * a timeseries, this field will include metadata labels that are explicitly
-     * named in the reduction. When creating a timeseries, this field is ignored.
+     * time series, this field will include metadata labels that are explicitly
+     * named in the reduction. When creating a time series, this field is ignored.
      * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -1428,8 +1505,8 @@ public com.google.api.MonitoredResourceMetadata getMetadata() { * *
      * Output only. The associated monitored resource metadata. When reading a
-     * a timeseries, this field will include metadata labels that are explicitly
-     * named in the reduction. When creating a timeseries, this field is ignored.
+     * time series, this field will include metadata labels that are explicitly
+     * named in the reduction. When creating a time series, this field is ignored.
      * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -1452,8 +1529,8 @@ public Builder setMetadata(com.google.api.MonitoredResourceMetadata value) { * *
      * Output only. The associated monitored resource metadata. When reading a
-     * a timeseries, this field will include metadata labels that are explicitly
-     * named in the reduction. When creating a timeseries, this field is ignored.
+     * time series, this field will include metadata labels that are explicitly
+     * named in the reduction. When creating a time series, this field is ignored.
      * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -1473,8 +1550,8 @@ public Builder setMetadata(com.google.api.MonitoredResourceMetadata.Builder buil * *
      * Output only. The associated monitored resource metadata. When reading a
-     * a timeseries, this field will include metadata labels that are explicitly
-     * named in the reduction. When creating a timeseries, this field is ignored.
+     * time series, this field will include metadata labels that are explicitly
+     * named in the reduction. When creating a time series, this field is ignored.
      * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -1501,8 +1578,8 @@ public Builder mergeMetadata(com.google.api.MonitoredResourceMetadata value) { * *
      * Output only. The associated monitored resource metadata. When reading a
-     * a timeseries, this field will include metadata labels that are explicitly
-     * named in the reduction. When creating a timeseries, this field is ignored.
+     * time series, this field will include metadata labels that are explicitly
+     * named in the reduction. When creating a time series, this field is ignored.
      * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -1523,8 +1600,8 @@ public Builder clearMetadata() { * *
      * Output only. The associated monitored resource metadata. When reading a
-     * a timeseries, this field will include metadata labels that are explicitly
-     * named in the reduction. When creating a timeseries, this field is ignored.
+     * time series, this field will include metadata labels that are explicitly
+     * named in the reduction. When creating a time series, this field is ignored.
      * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -1539,8 +1616,8 @@ public com.google.api.MonitoredResourceMetadata.Builder getMetadataBuilder() { * *
      * Output only. The associated monitored resource metadata. When reading a
-     * a timeseries, this field will include metadata labels that are explicitly
-     * named in the reduction. When creating a timeseries, this field is ignored.
+     * time series, this field will include metadata labels that are explicitly
+     * named in the reduction. When creating a time series, this field is ignored.
      * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -1559,8 +1636,8 @@ public com.google.api.MonitoredResourceMetadataOrBuilder getMetadataOrBuilder() * *
      * Output only. The associated monitored resource metadata. When reading a
-     * a timeseries, this field will include metadata labels that are explicitly
-     * named in the reduction. When creating a timeseries, this field is ignored.
+     * time series, this field will include metadata labels that are explicitly
+     * named in the reduction. When creating a time series, this field is ignored.
      * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -2273,6 +2350,122 @@ public java.util.List getPointsBuilderLi return pointsBuilder_; } + private java.lang.Object unit_ = ""; + /** + * + * + *
+     * The units in which the metric value is reported. It is only applicable
+     * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
+     * defines the representation of the stored metric values.
+     * 
+ * + * string unit = 8; + * + * @return The unit. + */ + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + unit_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The units in which the metric value is reported. It is only applicable
+     * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
+     * defines the representation of the stored metric values.
+     * 
+ * + * string unit = 8; + * + * @return The bytes for unit. + */ + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The units in which the metric value is reported. It is only applicable
+     * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
+     * defines the representation of the stored metric values.
+     * 
+ * + * string unit = 8; + * + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + unit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The units in which the metric value is reported. It is only applicable
+     * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
+     * defines the representation of the stored metric values.
+     * 
+ * + * string unit = 8; + * + * @return This builder for chaining. + */ + public Builder clearUnit() { + + unit_ = getDefaultInstance().getUnit(); + onChanged(); + return this; + } + /** + * + * + *
+     * The units in which the metric value is reported. It is only applicable
+     * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
+     * defines the representation of the stored metric values.
+     * 
+ * + * string unit = 8; + * + * @param value The bytes for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + unit_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesDescriptor.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesDescriptor.java index 6f08401d..d7b5ec04 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesDescriptor.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesDescriptor.java @@ -22,7 +22,7 @@ * * *
- * A descriptor for the labels and points in a timeseries.
+ * A descriptor for the labels and points in a time series.
  * 
* * Protobuf type {@code google.monitoring.v3.TimeSeriesDescriptor} @@ -215,6 +215,37 @@ public interface ValueDescriptorOrBuilder * @return The metricKind. */ com.google.api.MetricDescriptor.MetricKind getMetricKind(); + + /** + * + * + *
+     * The unit in which `time_series` point values are reported. `unit`
+     * follows the UCUM format for units as seen in
+     * https://unitsofmeasure.org/ucum.html.
+     * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION.
+     * 
+ * + * string unit = 4; + * + * @return The unit. + */ + java.lang.String getUnit(); + /** + * + * + *
+     * The unit in which `time_series` point values are reported. `unit`
+     * follows the UCUM format for units as seen in
+     * https://unitsofmeasure.org/ucum.html.
+     * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION.
+     * 
+ * + * string unit = 4; + * + * @return The bytes for unit. + */ + com.google.protobuf.ByteString getUnitBytes(); } /** * @@ -239,6 +270,7 @@ private ValueDescriptor() { key_ = ""; valueType_ = 0; metricKind_ = 0; + unit_ = ""; } @java.lang.Override @@ -291,6 +323,13 @@ private ValueDescriptor( metricKind_ = rawValue; break; } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + unit_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -446,6 +485,61 @@ public com.google.api.MetricDescriptor.MetricKind getMetricKind() { return result == null ? com.google.api.MetricDescriptor.MetricKind.UNRECOGNIZED : result; } + public static final int UNIT_FIELD_NUMBER = 4; + private volatile java.lang.Object unit_; + /** + * + * + *
+     * The unit in which `time_series` point values are reported. `unit`
+     * follows the UCUM format for units as seen in
+     * https://unitsofmeasure.org/ucum.html.
+     * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION.
+     * 
+ * + * string unit = 4; + * + * @return The unit. + */ + @java.lang.Override + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + 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(); + unit_ = s; + return s; + } + } + /** + * + * + *
+     * The unit in which `time_series` point values are reported. `unit`
+     * follows the UCUM format for units as seen in
+     * https://unitsofmeasure.org/ucum.html.
+     * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION.
+     * 
+ * + * string unit = 4; + * + * @return The bytes for unit. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -471,6 +565,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) { output.writeEnum(3, metricKind_); } + if (!getUnitBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, unit_); + } unknownFields.writeTo(output); } @@ -491,6 +588,9 @@ public int getSerializedSize() { != com.google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, metricKind_); } + if (!getUnitBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, unit_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -510,6 +610,7 @@ public boolean equals(final java.lang.Object obj) { if (!getKey().equals(other.getKey())) return false; if (valueType_ != other.valueType_) return false; if (metricKind_ != other.metricKind_) return false; + if (!getUnit().equals(other.getUnit())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -527,6 +628,8 @@ public int hashCode() { hash = (53 * hash) + valueType_; hash = (37 * hash) + METRIC_KIND_FIELD_NUMBER; hash = (53 * hash) + metricKind_; + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -681,6 +784,8 @@ public Builder clear() { metricKind_ = 0; + unit_ = ""; + return this; } @@ -712,6 +817,7 @@ public com.google.monitoring.v3.TimeSeriesDescriptor.ValueDescriptor buildPartia result.key_ = key_; result.valueType_ = valueType_; result.metricKind_ = metricKind_; + result.unit_ = unit_; onBuilt(); return result; } @@ -776,6 +882,10 @@ public Builder mergeFrom( if (other.metricKind_ != 0) { setMetricKindValue(other.getMetricKindValue()); } + if (!other.getUnit().isEmpty()) { + unit_ = other.unit_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1095,6 +1205,127 @@ public Builder clearMetricKind() { return this; } + private java.lang.Object unit_ = ""; + /** + * + * + *
+       * The unit in which `time_series` point values are reported. `unit`
+       * follows the UCUM format for units as seen in
+       * https://unitsofmeasure.org/ucum.html.
+       * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION.
+       * 
+ * + * string unit = 4; + * + * @return The unit. + */ + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + unit_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The unit in which `time_series` point values are reported. `unit`
+       * follows the UCUM format for units as seen in
+       * https://unitsofmeasure.org/ucum.html.
+       * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION.
+       * 
+ * + * string unit = 4; + * + * @return The bytes for unit. + */ + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The unit in which `time_series` point values are reported. `unit`
+       * follows the UCUM format for units as seen in
+       * https://unitsofmeasure.org/ucum.html.
+       * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION.
+       * 
+ * + * string unit = 4; + * + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + unit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The unit in which `time_series` point values are reported. `unit`
+       * follows the UCUM format for units as seen in
+       * https://unitsofmeasure.org/ucum.html.
+       * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION.
+       * 
+ * + * string unit = 4; + * + * @return This builder for chaining. + */ + public Builder clearUnit() { + + unit_ = getDefaultInstance().getUnit(); + onChanged(); + return this; + } + /** + * + * + *
+       * The unit in which `time_series` point values are reported. `unit`
+       * follows the UCUM format for units as seen in
+       * https://unitsofmeasure.org/ucum.html.
+       * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION.
+       * 
+ * + * string unit = 4; + * + * @param value The bytes for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + unit_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -1479,7 +1710,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * A descriptor for the labels and points in a timeseries.
+   * A descriptor for the labels and points in a time series.
    * 
* * Protobuf type {@code google.monitoring.v3.TimeSeriesDescriptor} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesName.java new file mode 100644 index 00000000..beff2551 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesName.java @@ -0,0 +1,378 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.monitoring.v3; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class TimeSeriesName implements ResourceName { + private static final PathTemplate PROJECT_TIME_SERIES = + PathTemplate.createWithoutUrlEncoding("projects/{project}/timeSeries/{time_series}"); + private static final PathTemplate ORGANIZATION_TIME_SERIES = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/timeSeries/{time_series}"); + private static final PathTemplate FOLDER_TIME_SERIES = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/timeSeries/{time_series}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String timeSeries; + private final String organization; + private final String folder; + + @Deprecated + protected TimeSeriesName() { + project = null; + timeSeries = null; + organization = null; + folder = null; + } + + private TimeSeriesName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + timeSeries = Preconditions.checkNotNull(builder.getTimeSeries()); + organization = null; + folder = null; + pathTemplate = PROJECT_TIME_SERIES; + } + + private TimeSeriesName(OrganizationTimeSeriesBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + timeSeries = Preconditions.checkNotNull(builder.getTimeSeries()); + project = null; + folder = null; + pathTemplate = ORGANIZATION_TIME_SERIES; + } + + private TimeSeriesName(FolderTimeSeriesBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + timeSeries = Preconditions.checkNotNull(builder.getTimeSeries()); + project = null; + organization = null; + pathTemplate = FOLDER_TIME_SERIES; + } + + public String getProject() { + return project; + } + + public String getTimeSeries() { + return timeSeries; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectTimeSeriesBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationTimeSeriesBuilder newOrganizationTimeSeriesBuilder() { + return new OrganizationTimeSeriesBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderTimeSeriesBuilder newFolderTimeSeriesBuilder() { + return new FolderTimeSeriesBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TimeSeriesName of(String project, String timeSeries) { + return newBuilder().setProject(project).setTimeSeries(timeSeries).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static TimeSeriesName ofProjectTimeSeriesName(String project, String timeSeries) { + return newBuilder().setProject(project).setTimeSeries(timeSeries).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static TimeSeriesName ofOrganizationTimeSeriesName( + String organization, String timeSeries) { + return newOrganizationTimeSeriesBuilder() + .setOrganization(organization) + .setTimeSeries(timeSeries) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static TimeSeriesName ofFolderTimeSeriesName(String folder, String timeSeries) { + return newFolderTimeSeriesBuilder().setFolder(folder).setTimeSeries(timeSeries).build(); + } + + public static String format(String project, String timeSeries) { + return newBuilder().setProject(project).setTimeSeries(timeSeries).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectTimeSeriesName(String project, String timeSeries) { + return newBuilder().setProject(project).setTimeSeries(timeSeries).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationTimeSeriesName(String organization, String timeSeries) { + return newOrganizationTimeSeriesBuilder() + .setOrganization(organization) + .setTimeSeries(timeSeries) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderTimeSeriesName(String folder, String timeSeries) { + return newFolderTimeSeriesBuilder() + .setFolder(folder) + .setTimeSeries(timeSeries) + .build() + .toString(); + } + + public static TimeSeriesName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_TIME_SERIES.matches(formattedString)) { + Map matchMap = PROJECT_TIME_SERIES.match(formattedString); + return ofProjectTimeSeriesName(matchMap.get("project"), matchMap.get("time_series")); + } else if (ORGANIZATION_TIME_SERIES.matches(formattedString)) { + Map matchMap = ORGANIZATION_TIME_SERIES.match(formattedString); + return ofOrganizationTimeSeriesName( + matchMap.get("organization"), matchMap.get("time_series")); + } else if (FOLDER_TIME_SERIES.matches(formattedString)) { + Map matchMap = FOLDER_TIME_SERIES.match(formattedString); + return ofFolderTimeSeriesName(matchMap.get("folder"), matchMap.get("time_series")); + } + throw new ValidationException("TimeSeriesName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (TimeSeriesName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_TIME_SERIES.matches(formattedString) + || ORGANIZATION_TIME_SERIES.matches(formattedString) + || FOLDER_TIME_SERIES.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (timeSeries != null) { + fieldMapBuilder.put("time_series", timeSeries); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TimeSeriesName that = ((TimeSeriesName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.timeSeries, that.timeSeries) + && Objects.equals(this.organization, that.organization) + && Objects.equals(this.folder, that.folder); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(timeSeries); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + return h; + } + + /** Builder for projects/{project}/timeSeries/{time_series}. */ + public static class Builder { + private String project; + private String timeSeries; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getTimeSeries() { + return timeSeries; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setTimeSeries(String timeSeries) { + this.timeSeries = timeSeries; + return this; + } + + private Builder(TimeSeriesName timeSeriesName) { + Preconditions.checkArgument( + Objects.equals(timeSeriesName.pathTemplate, PROJECT_TIME_SERIES), + "toBuilder is only supported when TimeSeriesName has the pattern of projects/{project}/timeSeries/{time_series}"); + project = timeSeriesName.project; + timeSeries = timeSeriesName.timeSeries; + } + + public TimeSeriesName build() { + return new TimeSeriesName(this); + } + } + + /** Builder for organizations/{organization}/timeSeries/{time_series}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationTimeSeriesBuilder { + private String organization; + private String timeSeries; + + protected OrganizationTimeSeriesBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getTimeSeries() { + return timeSeries; + } + + public OrganizationTimeSeriesBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationTimeSeriesBuilder setTimeSeries(String timeSeries) { + this.timeSeries = timeSeries; + return this; + } + + public TimeSeriesName build() { + return new TimeSeriesName(this); + } + } + + /** Builder for folders/{folder}/timeSeries/{time_series}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderTimeSeriesBuilder { + private String folder; + private String timeSeries; + + protected FolderTimeSeriesBuilder() {} + + public String getFolder() { + return folder; + } + + public String getTimeSeries() { + return timeSeries; + } + + public FolderTimeSeriesBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderTimeSeriesBuilder setTimeSeries(String timeSeries) { + this.timeSeries = timeSeries; + return this; + } + + public TimeSeriesName build() { + return new TimeSeriesName(this); + } + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesOrBuilder.java index d92153e2..0394a661 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesOrBuilder.java @@ -104,8 +104,8 @@ public interface TimeSeriesOrBuilder * *
    * Output only. The associated monitored resource metadata. When reading a
-   * a timeseries, this field will include metadata labels that are explicitly
-   * named in the reduction. When creating a timeseries, this field is ignored.
+   * time series, this field will include metadata labels that are explicitly
+   * named in the reduction. When creating a time series, this field is ignored.
    * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -118,8 +118,8 @@ public interface TimeSeriesOrBuilder * *
    * Output only. The associated monitored resource metadata. When reading a
-   * a timeseries, this field will include metadata labels that are explicitly
-   * named in the reduction. When creating a timeseries, this field is ignored.
+   * time series, this field will include metadata labels that are explicitly
+   * named in the reduction. When creating a time series, this field is ignored.
    * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -132,8 +132,8 @@ public interface TimeSeriesOrBuilder * *
    * Output only. The associated monitored resource metadata. When reading a
-   * a timeseries, this field will include metadata labels that are explicitly
-   * named in the reduction. When creating a timeseries, this field is ignored.
+   * time series, this field will include metadata labels that are explicitly
+   * named in the reduction. When creating a time series, this field is ignored.
    * 
* * .google.api.MonitoredResourceMetadata metadata = 7; @@ -292,4 +292,33 @@ public interface TimeSeriesOrBuilder * repeated .google.monitoring.v3.Point points = 5; */ com.google.monitoring.v3.PointOrBuilder getPointsOrBuilder(int index); + + /** + * + * + *
+   * The units in which the metric value is reported. It is only applicable
+   * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
+   * defines the representation of the stored metric values.
+   * 
+ * + * string unit = 8; + * + * @return The unit. + */ + java.lang.String getUnit(); + /** + * + * + *
+   * The units in which the metric value is reported. It is only applicable
+   * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
+   * defines the representation of the stored metric values.
+   * 
+ * + * string unit = 8; + * + * @return The bytes for unit. + */ + com.google.protobuf.ByteString getUnitBytes(); } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfig.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfig.java index 17fc522c..95c1ec18 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfig.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfig.java @@ -1152,7 +1152,8 @@ public interface HttpCheckOrBuilder * * *
-     * The HTTP request method to use for the check.
+     * The HTTP request method to use for the check. If set to
+     * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`.
      * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; @@ -1165,7 +1166,8 @@ public interface HttpCheckOrBuilder * * *
-     * The HTTP request method to use for the check.
+     * The HTTP request method to use for the check. If set to
+     * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`.
      * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; @@ -1283,7 +1285,7 @@ public interface HttpCheckOrBuilder * * *
-     * Boolean specifiying whether to encrypt the header information.
+     * Boolean specifying whether to encrypt the header information.
      * Encryption should be specified for any headers related to authentication
      * that you do not wish to be seen when retrieving the configuration. The
      * server will be responsible for encrypting the headers.
@@ -1390,7 +1392,14 @@ public interface HttpCheckOrBuilder
      *
      *
      * 
-     * The content type to use for the check.
+     * The content type header to use for the check. The following
+     * configurations result in errors:
+     * 1. Content type is specified in both the `headers` field and the
+     * `content_type` field.
+     * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED`
+     * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`.
+     * 4. Request method is `POST` and a "Content-Type" header is provided via
+     * `headers` field. The `content_type` field should be used instead.
      * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; @@ -1402,7 +1411,14 @@ public interface HttpCheckOrBuilder * * *
-     * The content type to use for the check.
+     * The content type header to use for the check. The following
+     * configurations result in errors:
+     * 1. Content type is specified in both the `headers` field and the
+     * `content_type` field.
+     * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED`
+     * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`.
+     * 4. Request method is `POST` and a "Content-Type" header is provided via
+     * `headers` field. The `content_type` field should be used instead.
      * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; @@ -1431,11 +1447,14 @@ public interface HttpCheckOrBuilder * * *
-     * The request body associated with the HTTP request. If `content_type` is
-     * `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide
-     * a `Content-Length` header via the `headers` field or the API will do
-     * so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields
-     * JSON representations are base64 encoded.
+     * The request body associated with the HTTP POST request. If `content_type`
+     * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can
+     * provide a `Content-Length` header via the `headers` field or the API will
+     * do so. If the `request_method` is `GET` and `body` is not empty, the API
+     * will return an error. The maximum byte size is 1 megabyte. Note: As with
+     * all `bytes` fields, JSON representations are base64 encoded. e.g.:
+     * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is
+     * "Zm9vJTI1M0RiYXI=".
      * 
* * bytes body = 10; @@ -1790,9 +1809,7 @@ private RequestMethod(int value) { * * *
-     * Header options corresponding to the Content-Type of the body in HTTP
-     * requests. Note that a `Content-Type` header cannot be present in the
-     * `headers` field if this field is specified.
+     * Header options corresponding to the content type of a HTTP request body.
      * 
* * Protobuf enum {@code google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType} @@ -1802,8 +1819,7 @@ public enum ContentType implements com.google.protobuf.ProtocolMessageEnum { * * *
-       * No content type specified. If the request method is POST, an
-       * unspecified content type results in a check creation rejection.
+       * No content type specified.
        * 
* * TYPE_UNSPECIFIED = 0; @@ -1827,8 +1843,7 @@ public enum ContentType implements com.google.protobuf.ProtocolMessageEnum { * * *
-       * No content type specified. If the request method is POST, an
-       * unspecified content type results in a check creation rejection.
+       * No content type specified.
        * 
* * TYPE_UNSPECIFIED = 0; @@ -2825,7 +2840,8 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * The HTTP request method to use for the check.
+     * The HTTP request method to use for the check. If set to
+     * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`.
      * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; @@ -2841,7 +2857,8 @@ public int getRequestMethodValue() { * * *
-     * The HTTP request method to use for the check.
+     * The HTTP request method to use for the check. If set to
+     * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`.
      * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; @@ -3018,7 +3035,7 @@ public com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication * * *
-     * Boolean specifiying whether to encrypt the header information.
+     * Boolean specifying whether to encrypt the header information.
      * Encryption should be specified for any headers related to authentication
      * that you do not wish to be seen when retrieving the configuration. The
      * server will be responsible for encrypting the headers.
@@ -3168,7 +3185,14 @@ public java.lang.String getHeadersOrThrow(java.lang.String key) {
      *
      *
      * 
-     * The content type to use for the check.
+     * The content type header to use for the check. The following
+     * configurations result in errors:
+     * 1. Content type is specified in both the `headers` field and the
+     * `content_type` field.
+     * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED`
+     * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`.
+     * 4. Request method is `POST` and a "Content-Type" header is provided via
+     * `headers` field. The `content_type` field should be used instead.
      * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; @@ -3183,7 +3207,14 @@ public int getContentTypeValue() { * * *
-     * The content type to use for the check.
+     * The content type header to use for the check. The following
+     * configurations result in errors:
+     * 1. Content type is specified in both the `headers` field and the
+     * `content_type` field.
+     * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED`
+     * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`.
+     * 4. Request method is `POST` and a "Content-Type" header is provided via
+     * `headers` field. The `content_type` field should be used instead.
      * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; @@ -3227,11 +3258,14 @@ public boolean getValidateSsl() { * * *
-     * The request body associated with the HTTP request. If `content_type` is
-     * `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide
-     * a `Content-Length` header via the `headers` field or the API will do
-     * so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields
-     * JSON representations are base64 encoded.
+     * The request body associated with the HTTP POST request. If `content_type`
+     * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can
+     * provide a `Content-Length` header via the `headers` field or the API will
+     * do so. If the `request_method` is `GET` and `body` is not empty, the API
+     * will return an error. The maximum byte size is 1 megabyte. Note: As with
+     * all `bytes` fields, JSON representations are base64 encoded. e.g.:
+     * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is
+     * "Zm9vJTI1M0RiYXI=".
      * 
* * bytes body = 10; @@ -3756,7 +3790,8 @@ public Builder mergeFrom( * * *
-       * The HTTP request method to use for the check.
+       * The HTTP request method to use for the check. If set to
+       * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`.
        * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; @@ -3772,7 +3807,8 @@ public int getRequestMethodValue() { * * *
-       * The HTTP request method to use for the check.
+       * The HTTP request method to use for the check. If set to
+       * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`.
        * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; @@ -3791,7 +3827,8 @@ public Builder setRequestMethodValue(int value) { * * *
-       * The HTTP request method to use for the check.
+       * The HTTP request method to use for the check. If set to
+       * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`.
        * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; @@ -3813,7 +3850,8 @@ public com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod getReq * * *
-       * The HTTP request method to use for the check.
+       * The HTTP request method to use for the check. If set to
+       * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`.
        * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; @@ -3836,7 +3874,8 @@ public Builder setRequestMethod( * * *
-       * The HTTP request method to use for the check.
+       * The HTTP request method to use for the check. If set to
+       * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`.
        * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; @@ -4309,7 +4348,7 @@ public Builder clearAuthInfo() { * * *
-       * Boolean specifiying whether to encrypt the header information.
+       * Boolean specifying whether to encrypt the header information.
        * Encryption should be specified for any headers related to authentication
        * that you do not wish to be seen when retrieving the configuration. The
        * server will be responsible for encrypting the headers.
@@ -4329,7 +4368,7 @@ public boolean getMaskHeaders() {
        *
        *
        * 
-       * Boolean specifiying whether to encrypt the header information.
+       * Boolean specifying whether to encrypt the header information.
        * Encryption should be specified for any headers related to authentication
        * that you do not wish to be seen when retrieving the configuration. The
        * server will be responsible for encrypting the headers.
@@ -4352,7 +4391,7 @@ public Builder setMaskHeaders(boolean value) {
        *
        *
        * 
-       * Boolean specifiying whether to encrypt the header information.
+       * Boolean specifying whether to encrypt the header information.
        * Encryption should be specified for any headers related to authentication
        * that you do not wish to be seen when retrieving the configuration. The
        * server will be responsible for encrypting the headers.
@@ -4584,7 +4623,14 @@ public Builder putAllHeaders(java.util.Map v
        *
        *
        * 
-       * The content type to use for the check.
+       * The content type header to use for the check. The following
+       * configurations result in errors:
+       * 1. Content type is specified in both the `headers` field and the
+       * `content_type` field.
+       * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED`
+       * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`.
+       * 4. Request method is `POST` and a "Content-Type" header is provided via
+       * `headers` field. The `content_type` field should be used instead.
        * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; @@ -4600,7 +4646,14 @@ public int getContentTypeValue() { * * *
-       * The content type to use for the check.
+       * The content type header to use for the check. The following
+       * configurations result in errors:
+       * 1. Content type is specified in both the `headers` field and the
+       * `content_type` field.
+       * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED`
+       * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`.
+       * 4. Request method is `POST` and a "Content-Type" header is provided via
+       * `headers` field. The `content_type` field should be used instead.
        * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; @@ -4619,7 +4672,14 @@ public Builder setContentTypeValue(int value) { * * *
-       * The content type to use for the check.
+       * The content type header to use for the check. The following
+       * configurations result in errors:
+       * 1. Content type is specified in both the `headers` field and the
+       * `content_type` field.
+       * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED`
+       * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`.
+       * 4. Request method is `POST` and a "Content-Type" header is provided via
+       * `headers` field. The `content_type` field should be used instead.
        * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; @@ -4640,7 +4700,14 @@ public com.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType getConte * * *
-       * The content type to use for the check.
+       * The content type header to use for the check. The following
+       * configurations result in errors:
+       * 1. Content type is specified in both the `headers` field and the
+       * `content_type` field.
+       * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED`
+       * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`.
+       * 4. Request method is `POST` and a "Content-Type" header is provided via
+       * `headers` field. The `content_type` field should be used instead.
        * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; @@ -4663,7 +4730,14 @@ public Builder setContentType( * * *
-       * The content type to use for the check.
+       * The content type header to use for the check. The following
+       * configurations result in errors:
+       * 1. Content type is specified in both the `headers` field and the
+       * `content_type` field.
+       * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED`
+       * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`.
+       * 4. Request method is `POST` and a "Content-Type" header is provided via
+       * `headers` field. The `content_type` field should be used instead.
        * 
* * .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; @@ -4744,11 +4818,14 @@ public Builder clearValidateSsl() { * * *
-       * The request body associated with the HTTP request. If `content_type` is
-       * `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide
-       * a `Content-Length` header via the `headers` field or the API will do
-       * so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields
-       * JSON representations are base64 encoded.
+       * The request body associated with the HTTP POST request. If `content_type`
+       * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can
+       * provide a `Content-Length` header via the `headers` field or the API will
+       * do so. If the `request_method` is `GET` and `body` is not empty, the API
+       * will return an error. The maximum byte size is 1 megabyte. Note: As with
+       * all `bytes` fields, JSON representations are base64 encoded. e.g.:
+       * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is
+       * "Zm9vJTI1M0RiYXI=".
        * 
* * bytes body = 10; @@ -4763,11 +4840,14 @@ public com.google.protobuf.ByteString getBody() { * * *
-       * The request body associated with the HTTP request. If `content_type` is
-       * `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide
-       * a `Content-Length` header via the `headers` field or the API will do
-       * so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields
-       * JSON representations are base64 encoded.
+       * The request body associated with the HTTP POST request. If `content_type`
+       * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can
+       * provide a `Content-Length` header via the `headers` field or the API will
+       * do so. If the `request_method` is `GET` and `body` is not empty, the API
+       * will return an error. The maximum byte size is 1 megabyte. Note: As with
+       * all `bytes` fields, JSON representations are base64 encoded. e.g.:
+       * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is
+       * "Zm9vJTI1M0RiYXI=".
        * 
* * bytes body = 10; @@ -4788,11 +4868,14 @@ public Builder setBody(com.google.protobuf.ByteString value) { * * *
-       * The request body associated with the HTTP request. If `content_type` is
-       * `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide
-       * a `Content-Length` header via the `headers` field or the API will do
-       * so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields
-       * JSON representations are base64 encoded.
+       * The request body associated with the HTTP POST request. If `content_type`
+       * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can
+       * provide a `Content-Length` header via the `headers` field or the API will
+       * do so. If the `request_method` is `GET` and `body` is not empty, the API
+       * will return an error. The maximum byte size is 1 megabyte. Note: As with
+       * all `bytes` fields, JSON representations are base64 encoded. e.g.:
+       * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is
+       * "Zm9vJTI1M0RiYXI=".
        * 
* * bytes body = 10; @@ -6635,6 +6718,8 @@ public CheckRequestTypeCase getCheckRequestTypeCase() { *
    * A unique resource name for this Uptime check configuration. The format is:
    *      projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
+   * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the
+   * Uptime check.
    * This field should be omitted when creating the Uptime check configuration;
    * on create, the resource name is assigned by the server and included in the
    * response.
@@ -6662,6 +6747,8 @@ public java.lang.String getName() {
    * 
    * A unique resource name for this Uptime check configuration. The format is:
    *      projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
+   * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the
+   * Uptime check.
    * This field should be omitted when creating the Uptime check configuration;
    * on create, the resource name is assigned by the server and included in the
    * response.
@@ -8148,6 +8235,8 @@ public Builder clearCheckRequestType() {
      * 
      * A unique resource name for this Uptime check configuration. The format is:
      *      projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
+     * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the
+     * Uptime check.
      * This field should be omitted when creating the Uptime check configuration;
      * on create, the resource name is assigned by the server and included in the
      * response.
@@ -8174,6 +8263,8 @@ public java.lang.String getName() {
      * 
      * A unique resource name for this Uptime check configuration. The format is:
      *      projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
+     * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the
+     * Uptime check.
      * This field should be omitted when creating the Uptime check configuration;
      * on create, the resource name is assigned by the server and included in the
      * response.
@@ -8200,6 +8291,8 @@ public com.google.protobuf.ByteString getNameBytes() {
      * 
      * A unique resource name for this Uptime check configuration. The format is:
      *      projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
+     * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the
+     * Uptime check.
      * This field should be omitted when creating the Uptime check configuration;
      * on create, the resource name is assigned by the server and included in the
      * response.
@@ -8225,6 +8318,8 @@ public Builder setName(java.lang.String value) {
      * 
      * A unique resource name for this Uptime check configuration. The format is:
      *      projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
+     * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the
+     * Uptime check.
      * This field should be omitted when creating the Uptime check configuration;
      * on create, the resource name is assigned by the server and included in the
      * response.
@@ -8246,6 +8341,8 @@ public Builder clearName() {
      * 
      * A unique resource name for this Uptime check configuration. The format is:
      *      projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
+     * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the
+     * Uptime check.
      * This field should be omitted when creating the Uptime check configuration;
      * on create, the resource name is assigned by the server and included in the
      * response.
diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfigOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfigOrBuilder.java
index b33ddb85..9c303ffc 100644
--- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfigOrBuilder.java
+++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfigOrBuilder.java
@@ -29,6 +29,8 @@ public interface UptimeCheckConfigOrBuilder
    * 
    * A unique resource name for this Uptime check configuration. The format is:
    *      projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
+   * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the
+   * Uptime check.
    * This field should be omitted when creating the Uptime check configuration;
    * on create, the resource name is assigned by the server and included in the
    * response.
@@ -45,6 +47,8 @@ public interface UptimeCheckConfigOrBuilder
    * 
    * A unique resource name for this Uptime check configuration. The format is:
    *      projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
+   * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the
+   * Uptime check.
    * This field should be omitted when creating the Uptime check configuration;
    * on create, the resource name is assigned by the server and included in the
    * response.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto
index 6662304d..8d1cbf2e 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@ syntax = "proto3";
 
 package google.monitoring.v3;
 
+import "google/api/field_behavior.proto";
 import "google/api/resource.proto";
 import "google/monitoring/v3/common.proto";
 import "google/monitoring/v3/mutation_record.proto";
@@ -89,17 +90,17 @@ message AlertPolicy {
     // A condition type that compares a collection of time series
     // against a threshold.
     message MetricThreshold {
-      // 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
       // [`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) and 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 filter = 2;
+      // 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];
 
       // Specifies the alignment of data points in individual time series as
       // well as how to combine the retrieved time series together (such as
@@ -175,17 +176,17 @@ 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 {
-      // 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
       // [`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) and 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 filter = 1;
+      // 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];
 
       // Specifies the alignment of data points in individual time series as
       // well as how to combine the retrieved time series together (such as
@@ -201,9 +202,10 @@ message AlertPolicy {
       repeated Aggregation aggregations = 5;
 
       // The amount of time that a time series must fail to report new
-      // data to be considered failing. Currently, only values that
-      // are a multiple of a minute--e.g.  60, 120, or 300
-      // seconds--are supported. If an invalid value is given, an
+      // 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;
@@ -215,6 +217,34 @@ message AlertPolicy {
       Trigger trigger = 3;
     }
 
+    // A condition type that allows alert policies to be defined using
+    // [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
+    message MonitoringQueryLanguageCondition {
+      // [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
+      // query that outputs a boolean stream.
+      string query = 1;
+
+      // 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;
+
+      // 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.
+      Trigger trigger = 3;
+    }
+
     // Required if the condition exists. The unique resource name for this
     // condition. Its format is:
     //
@@ -255,6 +285,10 @@ message AlertPolicy {
       // A condition that checks that a time series continues to
       // receive new data points.
       MetricAbsence condition_absent = 2;
+
+      // A condition that uses the Monitoring Query Language to define
+      // alerts.
+      MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;
     }
   }
 
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert_service.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert_service.proto
index ea0c5ada..4017b16e 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert_service.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert_service.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ service AlertPolicyService {
       "https://www.googleapis.com/auth/monitoring,"
       "https://www.googleapis.com/auth/monitoring.read";
 
-  // Lists the existing alerting policies for the project.
+  // Lists the existing alerting policies for the workspace.
   rpc ListAlertPolicies(ListAlertPoliciesRequest) returns (ListAlertPoliciesResponse) {
     option (google.api.http) = {
       get: "/v3/{name=projects/*}/alertPolicies"
@@ -101,10 +101,11 @@ message CreateAlertPolicyRequest {
   //     projects/[PROJECT_ID_OR_NUMBER]
   //
   // Note that this field names the parent container in which the alerting
-  // policy will be written, not the name of the created policy. The alerting
-  // policy that is returned will have a name that contains a normalized
-  // representation of this name as a prefix but adds a suffix of the form
-  // `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the
+  // policy will be written, not the name of the created policy. |name| must be
+  // a host project of a workspace, otherwise INVALID_ARGUMENT error will
+  // return. The alerting policy that is returned will have a name that contains
+  // a normalized representation of this name as a prefix but adds a suffix of
+  // the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the
   // container.
   string name = 3 [
     (google.api.field_behavior) = REQUIRED,
@@ -183,6 +184,10 @@ message ListAlertPoliciesResponse {
   // to a non-empty value. To see the additional results,
   // use that value as `page_token` in the next call to this method.
   string next_page_token = 2;
+
+  // The total number of alert policies in all pages. This number is only an
+  // estimate, and may change in subsequent pages. https://aip.dev/158
+  int32 total_size = 4;
 }
 
 // The protocol for the `UpdateAlertPolicy` request.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/common.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/common.proto
index 26242225..77a28ea3 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/common.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/common.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -51,28 +51,34 @@ message TypedValue {
   }
 }
 
-// A closed time interval. It extends from the start time to the end time, and
-// includes both: `[startTime, endTime]`. Valid time intervals depend on the
-// [`MetricKind`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind)
-// of the metric value. In no case can the end time be earlier than the start
-// time.
+// A closed time interval. It extends from the start time to the end time, and includes both: `[startTime, endTime]`. Valid time intervals depend on the [`MetricKind`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind) of the metric value. The end time must not be earlier than the start time. When writing data points, the start time must not be more than 25 hours in the past and the end time must not be more than five minutes in the future.
 //
-// * For a `GAUGE` metric, the `startTime` value is technically optional; if
+// * For `GAUGE` metrics, the `startTime` value is technically optional; if
 //   no value is specified, the start time defaults to the value of the
 //   end time, and the interval represents a single point in time. If both
 //   start and end times are specified, they must be identical. Such an
 //   interval is valid only for `GAUGE` metrics, which are point-in-time
-//   measurements.
+//   measurements. The end time of a new interval must be at least a
+//   millisecond after the end time of the previous interval.
 //
-// * For `DELTA` and `CUMULATIVE` metrics, the start time must be earlier
-//   than the end time.
+// * For `DELTA` metrics, the start time and end time must specify a
+//   non-zero interval, with subsequent points specifying contiguous and
+//   non-overlapping intervals. For `DELTA` metrics, the start time of
+//   the next interval must be at least a millisecond after the end time
+//   of the previous interval.
 //
-// * In all cases, the start time of the next interval must be
-//   at least a millisecond after the end time of the previous interval.
-//   Because the interval is closed, if the start time of a new interval
-//   is the same as the end time of the previous interval, data written
-//   at the new start time could overwrite data written at the previous
-//   end time.
+// * For `CUMULATIVE` metrics, the start time and end time must specify a
+//   a non-zero interval, with subsequent points specifying the same
+//   start time and increasing end times, until an event resets the
+//   cumulative value to zero and sets a new start time for the following
+//   points. The new start time must be at least a millisecond after the
+//   end time of the previous interval.
+//
+// * The start time of a new interval must be at least a millisecond after the
+//   end time of the previous interval because intervals are closed. If the
+//   start time of a new interval is the same as the end time of the previous
+//   interval, then data written at the new start time could overwrite data
+//   written at the previous end time.
 message TimeInterval {
   // Required. The end of the time interval.
   google.protobuf.Timestamp end_time = 2;
@@ -370,10 +376,13 @@ message Aggregation {
   // time. This will be done before the per-series aligner can be applied to
   // the data.
   //
-  // The value must be at least 60 seconds. If a per-series aligner other than
-  // `ALIGN_NONE` is specified, this field is required or an error is returned.
-  // If no per-series aligner is specified, or the aligner `ALIGN_NONE` is
-  // specified, then this field is ignored.
+  // The value must be at least 60 seconds. If a per-series
+  // aligner other than `ALIGN_NONE` is specified, this field is required or an
+  // error is returned. If no per-series aligner is specified, or the aligner
+  // `ALIGN_NONE` is specified, then this field is ignored.
+  //
+  // The maximum value of the `alignment_period` is 104 weeks (2 years) for
+  // charts, and 90,000 seconds (25 hours) for alerting policies.
   google.protobuf.Duration alignment_period = 1;
 
   // An `Aligner` describes how to bring the data points in a single
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/dropped_labels.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/dropped_labels.proto
index ce6e46e1..16e213c4 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/dropped_labels.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/dropped_labels.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -24,16 +24,17 @@ option java_package = "com.google.monitoring.v3";
 option php_namespace = "Google\\Cloud\\Monitoring\\V3";
 option ruby_package = "Google::Cloud::Monitoring::V3";
 
-// A set of (label, value) pairs which were dropped during aggregation, attached
-// to google.api.Distribution.Exemplars in google.api.Distribution values during
-// aggregation.
+// A set of (label, value) pairs that were removed from a Distribution
+// time series during aggregation and then added as an attachment to a
+// Distribution.Exemplar.
 //
-// These values are used in combination with the label values that remain on the
-// aggregated Distribution timeseries to construct the full label set for the
-// exemplar values.  The resulting full label set may be used to identify the
-// specific task/job/instance (for example) which may be contributing to a
-// long-tail, while allowing the storage savings of only storing aggregated
-// distribution values for a large group.
+// The full label set for the exemplars is constructed by using the dropped
+// pairs in combination with the label values that remain on the aggregated
+// Distribution time series. The constructed full label set can be used to
+// identify the specific entity, such as the instance or job, which might be
+// contributing to a long-tail. However, with dropped labels, the storage
+// requirements are reduced because only the aggregated distribution values for
+// a large group of time series are stored.
 //
 // Note that there are no guarantees on ordering of the labels from
 // exemplar-to-exemplar and from distribution-to-distribution in the same
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/group.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/group.proto
index 2d1ffbb6..a414cc85 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/group.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/group.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/group_service.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/group_service.proto
index 0163ab36..6385c8bb 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/group_service.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/group_service.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/metric.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/metric.proto
index 5a4833b1..c0c23a39 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/metric.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/metric.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -62,8 +62,8 @@ message TimeSeries {
   google.api.MonitoredResource resource = 2;
 
   // Output only. The associated monitored resource metadata. When reading a
-  // a timeseries, this field will include metadata labels that are explicitly
-  // named in the reduction. When creating a timeseries, this field is ignored.
+  // time series, this field will include metadata labels that are explicitly
+  // named in the reduction. When creating a time series, this field is ignored.
   google.api.MonitoredResourceMetadata metadata = 7;
 
   // The metric kind of the time series. When listing time series, this metric
@@ -94,9 +94,14 @@ message TimeSeries {
   // the value type of the descriptor is determined by the point's type, which
   // must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`.
   repeated Point points = 5;
+
+  // The units in which the metric value is reported. It is only applicable
+  // if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
+  // defines the representation of the stored metric values.
+  string unit = 8;
 }
 
-// A descriptor for the labels and points in a timeseries.
+// A descriptor for the labels and points in a time series.
 message TimeSeriesDescriptor {
   // A descriptor for the value columns in a data point.
   message ValueDescriptor {
@@ -108,6 +113,12 @@ message TimeSeriesDescriptor {
 
     // The value stream kind.
     google.api.MetricDescriptor.MetricKind metric_kind = 3;
+
+    // The unit in which `time_series` point values are reported. `unit`
+    // follows the UCUM format for units as seen in
+    // https://unitsofmeasure.org/ucum.html.
+    // `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION.
+    string unit = 4;
   }
 
   // Descriptors for the labels.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/metric_service.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/metric_service.proto
index 11999035..ab30e285 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/metric_service.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/metric_service.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -52,6 +52,17 @@ option (google.api.resource_definition) = {
   pattern: "*"
   history: ORIGINALLY_SINGLE_PATTERN
 };
+option (google.api.resource_definition) = {
+  type: "monitoring.googleapis.com/Workspace"
+  pattern: "projects/{project}"
+  pattern: "workspaces/{workspace}"
+};
+option (google.api.resource_definition) = {
+  type: "monitoring.googleapis.com/TimeSeries"
+  pattern: "projects/{project}/timeSeries/{time_series}"
+  pattern: "organizations/{organization}/timeSeries/{time_series}"
+  pattern: "folders/{folder}/timeSeries/{time_series}"
+};
 
 // Manages metric descriptors, monitored resource descriptors, and
 // time series data.
@@ -120,6 +131,12 @@ service MetricService {
   rpc ListTimeSeries(ListTimeSeriesRequest) returns (ListTimeSeriesResponse) {
     option (google.api.http) = {
       get: "/v3/{name=projects/*}/timeSeries"
+      additional_bindings {
+        get: "/v3/{name=organizations/*}/timeSeries"
+      }
+      additional_bindings {
+        get: "/v3/{name=folders/*}/timeSeries"
+      }
     };
     option (google.api.method_signature) = "name,filter,interval,view";
   }
@@ -299,13 +316,16 @@ message ListTimeSeriesRequest {
     HEADERS = 1;
   }
 
-  // Required. The project on which to execute the request. The format is:
+  // Required. The project, organization or folder on which to execute the request. The
+  // format is:
   //
   //     projects/[PROJECT_ID_OR_NUMBER]
+  //     organizations/[ORGANIZATION_ID]
+  //     folders/[FOLDER_ID]
   string name = 10 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.resource_reference) = {
-      type: "cloudresourcemanager.googleapis.com/Project"
+      child_type: "monitoring.googleapis.com/TimeSeries"
     }
   ];
 
@@ -330,6 +350,10 @@ message ListTimeSeriesRequest {
   // series data is returned.
   Aggregation aggregation = 5;
 
+  // Apply a second aggregation after `aggregation` is applied. May only be
+  // specified if `aggregation` is specified.
+  Aggregation secondary_aggregation = 11;
+
   // Unsupported: must be left blank. The points in each time series are
   // currently returned in reverse time order (most recent to oldest).
   string order_by = 6;
@@ -363,6 +387,14 @@ message ListTimeSeriesResponse {
   // Query execution errors that may have caused the time series data returned
   // to be incomplete.
   repeated google.rpc.Status execution_errors = 3;
+
+  // The unit in which all `time_series` point values are reported. `unit`
+  // follows the UCUM format for units as seen in
+  // https://unitsofmeasure.org/ucum.html.
+  // If different `time_series` have different units (for example, because they
+  // come from different metric types, or a unit is absent), then `unit` will be
+  // "{not_a_unit}".
+  string unit = 5;
 }
 
 // The `CreateTimeSeries` request.
@@ -424,8 +456,9 @@ message QueryTimeSeriesRequest {
   //     projects/[PROJECT_ID_OR_NUMBER]
   string name = 1;
 
-  // Required. The query in the monitoring query language format. The default
-  // time zone is in UTC.
+  // Required. The query in the [Monitoring Query
+  // Language](https://cloud.google.com/monitoring/mql/reference) format.
+  // The default time zone is in UTC.
   string query = 7;
 
   // A positive number that is the maximum number of time_series_data to return.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/mutation_record.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/mutation_record.proto
index b830eb62..77c2d5c2 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/mutation_record.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/mutation_record.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification.proto
index 897a14c0..74ea3a15 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import "google/api/label.proto";
 import "google/api/launch_stage.proto";
 import "google/api/resource.proto";
 import "google/monitoring/v3/common.proto";
+import "google/monitoring/v3/mutation_record.proto";
 import "google/protobuf/wrappers.proto";
 
 option csharp_namespace = "Google.Cloud.Monitoring.V3";
@@ -49,7 +50,10 @@ message NotificationChannelDescriptor {
   // In the above, `[TYPE]` is the value of the `type` field.
   string name = 6;
 
-  // The type of notification channel, such as "email", "sms", etc.
+  // The type of notification channel, such as "email" and "sms". To view the
+  // full list of channels, see
+  // [Channel
+  // descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd).
   // Notification channel types are globally unique.
   string type = 1;
 
@@ -180,4 +184,10 @@ message NotificationChannel {
   // temporary and you want to receive notifications from the same set
   // of alerting policies on the channel at some point in the future.
   google.protobuf.BoolValue enabled = 11;
+
+  // Record of the creation of this channel.
+  MutationRecord creation_record = 12;
+
+  // Records of the modification of this channel.
+  repeated MutationRecord mutation_records = 13;
 }
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification_service.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification_service.proto
index 20c9a8e9..0039ce15 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification_service.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification_service.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -291,6 +291,10 @@ message ListNotificationChannelsResponse {
   // subsequent request to fetch the next set of results. If empty,
   // all results have been returned.
   string next_page_token = 2;
+
+  // The total number of notification channels in all pages. This number is only
+  // an estimate, and may change in subsequent pages. https://aip.dev/158
+  int32 total_size = 4;
 }
 
 // The `GetNotificationChannel` request.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/query_service.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/query_service.proto
new file mode 100644
index 00000000..80bb4126
--- /dev/null
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/query_service.proto
@@ -0,0 +1,50 @@
+// Copyright 2021 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto3";
+
+package google.monitoring.v3;
+
+import "google/api/annotations.proto";
+import "google/api/label.proto";
+import "google/monitoring/v3/metric.proto";
+import "google/monitoring/v3/metric_service.proto";
+import "google/api/client.proto";
+
+option csharp_namespace = "Google.Cloud.Monitoring.V3";
+option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring";
+option java_multiple_files = true;
+option java_outer_classname = "QueryServiceProto";
+option java_package = "com.google.monitoring.v3";
+option php_namespace = "Google\\Cloud\\Monitoring\\V3";
+option ruby_package = "Google::Cloud::Monitoring::V3";
+
+// The QueryService API is used to manage time series data in Stackdriver
+// Monitoring. Time series data is a collection of data points that describes
+// the time-varying values of a metric.
+service QueryService {
+  option (google.api.default_host) = "monitoring.googleapis.com";
+  option (google.api.oauth_scopes) =
+      "https://www.googleapis.com/auth/cloud-platform,"
+      "https://www.googleapis.com/auth/monitoring,"
+      "https://www.googleapis.com/auth/monitoring.read";
+
+  // Queries time series using Monitoring Query Language. This method does not require a Workspace.
+  rpc QueryTimeSeries(QueryTimeSeriesRequest) returns (QueryTimeSeriesResponse) {
+    option (google.api.http) = {
+      post: "/v3/{name=projects/*}/timeSeries:query"
+      body: "*"
+    };
+  }
+}
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service.proto
index a89c007c..a0156e9e 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@ syntax = "proto3";
 
 package google.monitoring.v3;
 
-import "google/api/monitored_resource.proto";
 import "google/api/resource.proto";
 import "google/protobuf/duration.proto";
 import "google/protobuf/timestamp.proto";
@@ -67,10 +66,9 @@ message Service {
   }
 
   // Istio service scoped to a single Kubernetes cluster. Learn more at
-  // http://istio.io.
+  // https://istio.io. Clusters running OSS Istio will have their services
+  // ingested as this type.
   message ClusterIstio {
-    option deprecated = true;
-
     // The location of the Kubernetes cluster in which this Istio service is
     // defined. Corresponds to the `location` resource label in `k8s_cluster`
     // resources.
@@ -90,7 +88,8 @@ message Service {
     string service_name = 4;
   }
 
-  // Istio service scoped to an Istio mesh
+  // Istio service scoped to an Istio mesh. Anthos clusters running ASM < 1.6.8
+  // will have their services ingested as this type.
   message MeshIstio {
     // Identifier for the mesh in which this Istio service is defined.
     // Corresponds to the `mesh_uid` metric label in Istio metrics.
@@ -105,6 +104,27 @@ message Service {
     string service_name = 4;
   }
 
+  // Canonical service scoped to an Istio mesh. Anthos clusters running ASM >=
+  // 1.6.8 will have their services ingested as this type.
+  message IstioCanonicalService {
+    // Identifier for the Istio mesh in which this canonical service is defined.
+    // Corresponds to the `mesh_uid` metric label in
+    // [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+    string mesh_uid = 1;
+
+    // The namespace of the canonical service underlying this service.
+    // Corresponds to the `destination_canonical_service_namespace` metric
+    // label in [Istio
+    // metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+    string canonical_service_namespace = 3;
+
+    // The name of the canonical service underlying this service.
+    // Corresponds to the `destination_canonical_service_name` metric label in
+    // label in [Istio
+    // metrics](https://cloud.google.com/monitoring/api/metrics_istio).
+    string canonical_service = 4;
+  }
+
   // Configuration for how to query telemetry on a Service.
   message Telemetry {
     // The full name of the resource that defines this service. Formatted as
@@ -132,10 +152,15 @@ message Service {
     CloudEndpoints cloud_endpoints = 8;
 
     // Type used for Istio services that live in a Kubernetes cluster.
-    ClusterIstio cluster_istio = 9 [deprecated = true];
+    ClusterIstio cluster_istio = 9;
 
     // Type used for Istio services scoped to an Istio mesh.
     MeshIstio mesh_istio = 10;
+
+    // Type used for canonical services scoped to an Istio mesh.
+    // Metrics for Istio are
+    // [documented here](https://istio.io/latest/docs/reference/config/metrics/)
+    IstioCanonicalService istio_canonical_service = 11;
   }
 
   // Configuration for how to query telemetry on a Service.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service_service.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service_service.proto
index cd5f7db6..07916e62 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service_service.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service_service.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -180,16 +180,20 @@ message ListServicesRequest {
   //
   //     - `identifier_case`
   //     - `app_engine.module_id`
-  //     - `cloud_endpoints.service`
-  //     - `cluster_istio.location`
-  //     - `cluster_istio.cluster_name`
-  //     - `cluster_istio.service_namespace`
-  //     - `cluster_istio.service_name`
+  //     - `cloud_endpoints.service` (reserved for future use)
+  //     - `mesh_istio.mesh_uid`
+  //     - `mesh_istio.service_namespace`
+  //     - `mesh_istio.service_name`
+  //     - `cluster_istio.location` (deprecated)
+  //     - `cluster_istio.cluster_name` (deprecated)
+  //     - `cluster_istio.service_namespace` (deprecated)
+  //     - `cluster_istio.service_name` (deprecated)
   //
   // `identifier_case` refers to which option in the identifier oneof is
   // populated. For example, the filter `identifier_case = "CUSTOM"` would match
   // all services with a value for the `custom` field. Valid options are
-  // "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO".
+  // "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated)
+  // and "CLOUD_ENDPOINTS" (reserved for future use).
   string filter = 2;
 
   // A non-negative number that is the maximum number of results to return.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/span_context.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/span_context.proto
index 72cce35f..cfb8f267 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/span_context.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/span_context.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto
index 54a9b11e..1f66ffcc 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -28,6 +28,27 @@ option java_package = "com.google.monitoring.v3";
 option php_namespace = "Google\\Cloud\\Monitoring\\V3";
 option ruby_package = "Google::Cloud::Monitoring::V3";
 
+// The regions from which an Uptime check can be run.
+enum UptimeCheckRegion {
+  // Default value if no region is specified. Will result in Uptime checks
+  // running from all regions.
+  REGION_UNSPECIFIED = 0;
+
+  // Allows checks to run from locations within the United States of America.
+  USA = 1;
+
+  // Allows checks to run from locations within the continent of Europe.
+  EUROPE = 2;
+
+  // Allows checks to run from locations within the continent of South
+  // America.
+  SOUTH_AMERICA = 3;
+
+  // Allows checks to run from locations within the Asia Pacific area (ex:
+  // Singapore).
+  ASIA_PACIFIC = 4;
+}
+
 // An internal checker allows Uptime checks to run on private/internal GCP
 // resources.
 message InternalChecker {
@@ -84,27 +105,6 @@ message InternalChecker {
   State state = 7;
 }
 
-// The regions from which an Uptime check can be run.
-enum UptimeCheckRegion {
-  // Default value if no region is specified. Will result in Uptime checks
-  // running from all regions.
-  REGION_UNSPECIFIED = 0;
-
-  // Allows checks to run from locations within the United States of America.
-  USA = 1;
-
-  // Allows checks to run from locations within the continent of Europe.
-  EUROPE = 2;
-
-  // Allows checks to run from locations within the continent of South
-  // America.
-  SOUTH_AMERICA = 3;
-
-  // Allows checks to run from locations within the Asia Pacific area (ex:
-  // Singapore).
-  ASIA_PACIFIC = 4;
-}
-
 // This message configures which resources and services to monitor for
 // availability.
 message UptimeCheckConfig {
@@ -154,12 +154,9 @@ message UptimeCheckConfig {
       POST = 2;
     }
 
-    // Header options corresponding to the Content-Type of the body in HTTP
-    // requests. Note that a `Content-Type` header cannot be present in the
-    // `headers` field if this field is specified.
+    // Header options corresponding to the content type of a HTTP request body.
     enum ContentType {
-      // No content type specified. If the request method is POST, an
-      // unspecified content type results in a check creation rejection.
+      // No content type specified.
       TYPE_UNSPECIFIED = 0;
 
       // `body` is in URL-encoded form. Equivalent to setting the `Content-Type`
@@ -167,7 +164,8 @@ message UptimeCheckConfig {
       URL_ENCODED = 1;
     }
 
-    // The HTTP request method to use for the check.
+    // The HTTP request method to use for the check. If set to
+    // `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`.
     RequestMethod request_method = 8;
 
     // If `true`, use HTTPS instead of HTTP to run the check.
@@ -190,7 +188,7 @@ message UptimeCheckConfig {
     // defaults to empty.
     BasicAuthentication auth_info = 4;
 
-    // Boolean specifiying whether to encrypt the header information.
+    // Boolean specifying whether to encrypt the header information.
     // Encryption should be specified for any headers related to authentication
     // that you do not wish to be seen when retrieving the configuration. The
     // server will be responsible for encrypting the headers.
@@ -208,7 +206,14 @@ message UptimeCheckConfig {
     // The maximum number of headers allowed is 100.
     map headers = 6;
 
-    // The content type to use for the check.
+    // The content type header to use for the check. The following
+    // configurations result in errors:
+    // 1. Content type is specified in both the `headers` field and the
+    // `content_type` field.
+    // 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED`
+    // 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`.
+    // 4. Request method is `POST` and a "Content-Type" header is provided via
+    // `headers` field. The `content_type` field should be used instead.
     ContentType content_type = 9;
 
     // Boolean specifying whether to include SSL certificate validation as a
@@ -217,11 +222,14 @@ message UptimeCheckConfig {
     // setting `validate_ssl` to `true` has no effect.
     bool validate_ssl = 7;
 
-    // The request body associated with the HTTP request. If `content_type` is
-    // `URL_ENCODED`, the body passed in must be URL-encoded. Users can provide
-    // a `Content-Length` header via the `headers` field or the API will do
-    // so. The maximum byte size is 1 megabyte. Note: As with all `bytes` fields
-    // JSON representations are base64 encoded.
+    // The request body associated with the HTTP POST request. If `content_type`
+    // is `URL_ENCODED`, the body passed in must be URL-encoded. Users can
+    // provide a `Content-Length` header via the `headers` field or the API will
+    // do so. If the `request_method` is `GET` and `body` is not empty, the API
+    // will return an error. The maximum byte size is 1 megabyte. Note: As with
+    // all `bytes` fields, JSON representations are base64 encoded. e.g.:
+    // "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is
+    // "Zm9vJTI1M0RiYXI=".
     bytes body = 10;
   }
 
@@ -279,6 +287,9 @@ message UptimeCheckConfig {
   //
   //      projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
   //
+  // `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the
+  // Uptime check.
+  //
   // This field should be omitted when creating the Uptime check configuration;
   // on create, the resource name is assigned by the server and included in the
   // response.
diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime_service.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime_service.proto
index 5e53934e..78ad6697 100644
--- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime_service.proto
+++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime_service.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff --git a/synth.metadata b/synth.metadata
index 57e27a9c..360e9a91 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -11,8 +11,8 @@
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "1305ca41d554eb0725237561e34129373bb8cbc1",
-        "internalRef": "362856902"
+        "sha": "2124b6251e56e2ec8dd5c47e7d3815d7d5841880",
+        "internalRef": "364422694"
       }
     },
     {
@@ -109,6 +109,8 @@
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceSettings.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceSettings.java",
+    "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/QueryServiceClient.java",
+    "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/QueryServiceSettings.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java",
@@ -127,6 +129,8 @@
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcMetricServiceStub.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcNotificationChannelServiceCallableFactory.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcNotificationChannelServiceStub.java",
+    "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcQueryServiceCallableFactory.java",
+    "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcQueryServiceStub.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceCallableFactory.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceStub.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcUptimeCheckServiceCallableFactory.java",
@@ -135,6 +139,8 @@
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/MetricServiceStubSettings.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/NotificationChannelServiceStub.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/NotificationChannelServiceStubSettings.java",
+    "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/QueryServiceStub.java",
+    "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/QueryServiceStubSettings.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStub.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStubSettings.java",
     "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/UptimeCheckServiceStub.java",
@@ -150,17 +156,21 @@
     "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockMetricServiceImpl.java",
     "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockNotificationChannelService.java",
     "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockNotificationChannelServiceImpl.java",
+    "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockQueryService.java",
+    "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockQueryServiceImpl.java",
     "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockServiceMonitoringService.java",
     "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockServiceMonitoringServiceImpl.java",
     "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockUptimeCheckService.java",
     "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockUptimeCheckServiceImpl.java",
     "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClientTest.java",
+    "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/QueryServiceClientTest.java",
     "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClientTest.java",
     "google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java",
     "grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyServiceGrpc.java",
     "grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GroupServiceGrpc.java",
     "grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricServiceGrpc.java",
     "grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelServiceGrpc.java",
+    "grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryServiceGrpc.java",
     "grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringServiceGrpc.java",
     "grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckServiceGrpc.java",
     "java.header",
@@ -319,6 +329,7 @@
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryErrorList.java",
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryErrorListOrBuilder.java",
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryErrorOrBuilder.java",
+    "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryServiceProto.java",
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryTimeSeriesRequest.java",
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryTimeSeriesRequestOrBuilder.java",
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/QueryTimeSeriesResponse.java",
@@ -352,6 +363,7 @@
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesDataOrBuilder.java",
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesDescriptor.java",
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesDescriptorOrBuilder.java",
+    "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesName.java",
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesOrBuilder.java",
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesRatio.java",
     "proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesRatioOrBuilder.java",
@@ -392,6 +404,7 @@
     "proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/mutation_record.proto",
     "proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification.proto",
     "proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/notification_service.proto",
+    "proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/query_service.proto",
     "proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service.proto",
     "proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service_service.proto",
     "proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/span_context.proto",