diff --git a/.gitignore b/.gitignore index dc2d514c..3ca4b1fa 100644 --- a/.gitignore +++ b/.gitignore @@ -17,8 +17,6 @@ nosetests.xml # Mr Developer .mr.developer.cfg - -.metadata .project .pydevproject *.iml @@ -30,16 +28,5 @@ nosetests.xml # Built documentation docs/ - -# Wheel directory used in Travis builds. -gcloud-java-wheels/ -src/test/resources/gcd-head.zip -src/test/resources/gcd-v1beta2-rev1-2.1.1.zip - -# API key file containing value of GOOGLE_API_KEY for integration tests -api_key - # Python utilities *.pyc -artman-genfiles -venv \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg index cb8564d9..8492ddeb 100644 --- a/.kokoro/release/drop.cfg +++ b/.kokoro/release/drop.cfg @@ -4,6 +4,3 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/java-monitoring/.kokoro/release/drop.sh" } - -# Download staging properties file. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java/releases/java-monitoring" \ No newline at end of file diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg index b5932f2d..64fc0469 100644 --- a/.kokoro/release/promote.cfg +++ b/.kokoro/release/promote.cfg @@ -4,7 +4,3 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/java-monitoring/.kokoro/release/promote.sh" } - -# Download staging properties file. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java/releases/java-monitoring" - diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index 1c14fcc7..db1f5a05 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -33,7 +33,7 @@ python3 -m pip install gcp-docuploader # compile all packages mvn clean install -B -DskipTests=true -NAME=monitoring +NAME=google-cloud-monitoring VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) # build the docs diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java new file mode 100644 index 00000000..b7a8a4a5 --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java @@ -0,0 +1,1392 @@ +/* + * Copyright 2019 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.ServiceMonitoringServiceStub; +import com.google.cloud.monitoring.v3.stub.ServiceMonitoringServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.monitoring.v3.CreateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.CreateServiceRequest; +import com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest; +import com.google.monitoring.v3.DeleteServiceRequest; +import com.google.monitoring.v3.GetServiceLevelObjectiveRequest; +import com.google.monitoring.v3.GetServiceRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesResponse; +import com.google.monitoring.v3.ListServicesRequest; +import com.google.monitoring.v3.ListServicesResponse; +import com.google.monitoring.v3.ProjectName; +import com.google.monitoring.v3.Service; +import com.google.monitoring.v3.ServiceLevelObjective; +import com.google.monitoring.v3.ServiceLevelObjectiveName; +import com.google.monitoring.v3.ServiceName; +import com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.UpdateServiceRequest; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for + * managing and querying aspects of a workspace's services. These include the `Service`'s monitored + * resources, its Service-Level Objectives, and a taxonomy of categorized Health Metrics. + * + *

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

+ * 
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Service service = Service.newBuilder().build();
+ *   Service response = serviceMonitoringServiceClient.createService(parent, service);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the serviceMonitoringServiceClient 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 + * ServiceMonitoringServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * ServiceMonitoringServiceSettings serviceMonitoringServiceSettings =
+ *     ServiceMonitoringServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+ *     ServiceMonitoringServiceClient.create(serviceMonitoringServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ServiceMonitoringServiceSettings serviceMonitoringServiceSettings =
+ *     ServiceMonitoringServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+ *     ServiceMonitoringServiceClient.create(serviceMonitoringServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class ServiceMonitoringServiceClient implements BackgroundResource { + private final ServiceMonitoringServiceSettings settings; + private final ServiceMonitoringServiceStub stub; + + /** Constructs an instance of ServiceMonitoringServiceClient with default settings. */ + public static final ServiceMonitoringServiceClient create() throws IOException { + return create(ServiceMonitoringServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ServiceMonitoringServiceClient, 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 ServiceMonitoringServiceClient create( + ServiceMonitoringServiceSettings settings) throws IOException { + return new ServiceMonitoringServiceClient(settings); + } + + /** + * Constructs an instance of ServiceMonitoringServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer to use ServiceMonitoringServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ServiceMonitoringServiceClient create(ServiceMonitoringServiceStub stub) { + return new ServiceMonitoringServiceClient(stub); + } + + /** + * Constructs an instance of ServiceMonitoringServiceClient, 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 ServiceMonitoringServiceClient(ServiceMonitoringServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((ServiceMonitoringServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ServiceMonitoringServiceClient(ServiceMonitoringServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ServiceMonitoringServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ServiceMonitoringServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Create a `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Service service = Service.newBuilder().build();
+   *   Service response = serviceMonitoringServiceClient.createService(parent, service);
+   * }
+   * 
+ * + * @param parent Resource name of the parent workspace. Of the form `projects/{project_id}`. + * @param service The `Service` to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Service createService(ProjectName parent, Service service) { + + CreateServiceRequest request = + CreateServiceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setService(service) + .build(); + return createService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Create a `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Service service = Service.newBuilder().build();
+   *   Service response = serviceMonitoringServiceClient.createService(parent.toString(), service);
+   * }
+   * 
+ * + * @param parent Resource name of the parent workspace. Of the form `projects/{project_id}`. + * @param service The `Service` to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Service createService(String parent, Service service) { + + CreateServiceRequest request = + CreateServiceRequest.newBuilder().setParent(parent).setService(service).build(); + return createService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Create a `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Service service = Service.newBuilder().build();
+   *   CreateServiceRequest request = CreateServiceRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setService(service)
+   *     .build();
+   *   Service response = serviceMonitoringServiceClient.createService(request);
+   * }
+   * 
+ * + * @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 Service createService(CreateServiceRequest request) { + return createServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Create a `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Service service = Service.newBuilder().build();
+   *   CreateServiceRequest request = CreateServiceRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setService(service)
+   *     .build();
+   *   ApiFuture<Service> future = serviceMonitoringServiceClient.createServiceCallable().futureCall(request);
+   *   // Do something
+   *   Service response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createServiceCallable() { + return stub.createServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get the named `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   Service response = serviceMonitoringServiceClient.getService(name);
+   * }
+   * 
+ * + * @param name Resource name of the `Service`. Of the form + * `projects/{project_id}/services/{service_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Service getService(ServiceName name) { + + GetServiceRequest request = + GetServiceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get the named `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   Service response = serviceMonitoringServiceClient.getService(name.toString());
+   * }
+   * 
+ * + * @param name Resource name of the `Service`. Of the form + * `projects/{project_id}/services/{service_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Service getService(String name) { + + GetServiceRequest request = GetServiceRequest.newBuilder().setName(name).build(); + return getService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get the named `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   GetServiceRequest request = GetServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Service response = serviceMonitoringServiceClient.getService(request);
+   * }
+   * 
+ * + * @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 Service getService(GetServiceRequest request) { + return getServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get the named `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   GetServiceRequest request = GetServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Service> future = serviceMonitoringServiceClient.getServiceCallable().futureCall(request);
+   *   // Do something
+   *   Service response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getServiceCallable() { + return stub.getServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List `Service`s for this workspace. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (Service element : serviceMonitoringServiceClient.listServices(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the parent `Workspace`. Of the form `projects/{project_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListServicesPagedResponse listServices(ProjectName parent) { + ListServicesRequest request = + ListServicesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listServices(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List `Service`s for this workspace. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (Service element : serviceMonitoringServiceClient.listServices(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the parent `Workspace`. Of the form `projects/{project_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListServicesPagedResponse listServices(String parent) { + ListServicesRequest request = ListServicesRequest.newBuilder().setParent(parent).build(); + return listServices(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List `Service`s for this workspace. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListServicesRequest request = ListServicesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Service element : serviceMonitoringServiceClient.listServices(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 ListServicesPagedResponse listServices(ListServicesRequest request) { + return listServicesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List `Service`s for this workspace. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListServicesRequest request = ListServicesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListServicesPagedResponse> future = serviceMonitoringServiceClient.listServicesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Service element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listServicesPagedCallable() { + return stub.listServicesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List `Service`s for this workspace. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListServicesRequest request = ListServicesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListServicesResponse response = serviceMonitoringServiceClient.listServicesCallable().call(request);
+   *     for (Service element : response.getServicesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listServicesCallable() { + return stub.listServicesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Update this `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   Service service = Service.newBuilder().build();
+   *   Service response = serviceMonitoringServiceClient.updateService(service);
+   * }
+   * 
+ * + * @param service The `Service` to draw updates from. The given `name` specifies the resource to + * update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Service updateService(Service service) { + + UpdateServiceRequest request = UpdateServiceRequest.newBuilder().setService(service).build(); + return updateService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Update this `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   Service service = Service.newBuilder().build();
+   *   UpdateServiceRequest request = UpdateServiceRequest.newBuilder()
+   *     .setService(service)
+   *     .build();
+   *   Service response = serviceMonitoringServiceClient.updateService(request);
+   * }
+   * 
+ * + * @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 Service updateService(UpdateServiceRequest request) { + return updateServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Update this `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   Service service = Service.newBuilder().build();
+   *   UpdateServiceRequest request = UpdateServiceRequest.newBuilder()
+   *     .setService(service)
+   *     .build();
+   *   ApiFuture<Service> future = serviceMonitoringServiceClient.updateServiceCallable().futureCall(request);
+   *   // Do something
+   *   Service response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateServiceCallable() { + return stub.updateServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Soft delete this `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   serviceMonitoringServiceClient.deleteService(name);
+   * }
+   * 
+ * + * @param name Resource name of the `Service` to delete. Of the form + * `projects/{project_id}/service/{service_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteService(ServiceName name) { + + DeleteServiceRequest request = + DeleteServiceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Soft delete this `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   serviceMonitoringServiceClient.deleteService(name.toString());
+   * }
+   * 
+ * + * @param name Resource name of the `Service` to delete. Of the form + * `projects/{project_id}/service/{service_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteService(String name) { + + DeleteServiceRequest request = DeleteServiceRequest.newBuilder().setName(name).build(); + deleteService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Soft delete this `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   serviceMonitoringServiceClient.deleteService(request);
+   * }
+   * 
+ * + * @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 void deleteService(DeleteServiceRequest request) { + deleteServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Soft delete this `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = serviceMonitoringServiceClient.deleteServiceCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteServiceCallable() { + return stub.deleteServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Create a `ServiceLevelObjective` for the given `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
+   *   ServiceLevelObjective response = serviceMonitoringServiceClient.createServiceLevelObjective(parent, serviceLevelObjective);
+   * }
+   * 
+ * + * @param parent Resource name of the parent `Service`. Of the form + * `projects/{project_id}/services/{service_id}`. + * @param serviceLevelObjective The `ServiceLevelObjective` to create. The provided `name` will be + * respected if no `ServiceLevelObjective` exists with this name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServiceLevelObjective createServiceLevelObjective( + ServiceName parent, ServiceLevelObjective serviceLevelObjective) { + + CreateServiceLevelObjectiveRequest request = + CreateServiceLevelObjectiveRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setServiceLevelObjective(serviceLevelObjective) + .build(); + return createServiceLevelObjective(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Create a `ServiceLevelObjective` for the given `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
+   *   ServiceLevelObjective response = serviceMonitoringServiceClient.createServiceLevelObjective(parent.toString(), serviceLevelObjective);
+   * }
+   * 
+ * + * @param parent Resource name of the parent `Service`. Of the form + * `projects/{project_id}/services/{service_id}`. + * @param serviceLevelObjective The `ServiceLevelObjective` to create. The provided `name` will be + * respected if no `ServiceLevelObjective` exists with this name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServiceLevelObjective createServiceLevelObjective( + String parent, ServiceLevelObjective serviceLevelObjective) { + + CreateServiceLevelObjectiveRequest request = + CreateServiceLevelObjectiveRequest.newBuilder() + .setParent(parent) + .setServiceLevelObjective(serviceLevelObjective) + .build(); + return createServiceLevelObjective(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Create a `ServiceLevelObjective` for the given `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
+   *   CreateServiceLevelObjectiveRequest request = CreateServiceLevelObjectiveRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setServiceLevelObjective(serviceLevelObjective)
+   *     .build();
+   *   ServiceLevelObjective response = serviceMonitoringServiceClient.createServiceLevelObjective(request);
+   * }
+   * 
+ * + * @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 ServiceLevelObjective createServiceLevelObjective( + CreateServiceLevelObjectiveRequest request) { + return createServiceLevelObjectiveCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Create a `ServiceLevelObjective` for the given `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
+   *   CreateServiceLevelObjectiveRequest request = CreateServiceLevelObjectiveRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setServiceLevelObjective(serviceLevelObjective)
+   *     .build();
+   *   ApiFuture<ServiceLevelObjective> future = serviceMonitoringServiceClient.createServiceLevelObjectiveCallable().futureCall(request);
+   *   // Do something
+   *   ServiceLevelObjective response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + createServiceLevelObjectiveCallable() { + return stub.createServiceLevelObjectiveCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get a `ServiceLevelObjective` by name. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   ServiceLevelObjective response = serviceMonitoringServiceClient.getServiceLevelObjective(name);
+   * }
+   * 
+ * + * @param name Resource name of the `ServiceLevelObjective` to get. Of the form + * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServiceLevelObjective getServiceLevelObjective(ServiceLevelObjectiveName name) { + + GetServiceLevelObjectiveRequest request = + GetServiceLevelObjectiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getServiceLevelObjective(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get a `ServiceLevelObjective` by name. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   ServiceLevelObjective response = serviceMonitoringServiceClient.getServiceLevelObjective(name.toString());
+   * }
+   * 
+ * + * @param name Resource name of the `ServiceLevelObjective` to get. Of the form + * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServiceLevelObjective getServiceLevelObjective(String name) { + + GetServiceLevelObjectiveRequest request = + GetServiceLevelObjectiveRequest.newBuilder().setName(name).build(); + return getServiceLevelObjective(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get a `ServiceLevelObjective` by name. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   GetServiceLevelObjectiveRequest request = GetServiceLevelObjectiveRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ServiceLevelObjective response = serviceMonitoringServiceClient.getServiceLevelObjective(request);
+   * }
+   * 
+ * + * @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 ServiceLevelObjective getServiceLevelObjective( + GetServiceLevelObjectiveRequest request) { + return getServiceLevelObjectiveCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get a `ServiceLevelObjective` by name. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   GetServiceLevelObjectiveRequest request = GetServiceLevelObjectiveRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<ServiceLevelObjective> future = serviceMonitoringServiceClient.getServiceLevelObjectiveCallable().futureCall(request);
+   *   // Do something
+   *   ServiceLevelObjective response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getServiceLevelObjectiveCallable() { + return stub.getServiceLevelObjectiveCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List the `ServiceLevelObjective`s for the given `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   for (ServiceLevelObjective element : serviceMonitoringServiceClient.listServiceLevelObjectives(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the parent `Service`. Of the form + * `projects/{project_id}/services/{service_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives( + ServiceName parent) { + ListServiceLevelObjectivesRequest request = + ListServiceLevelObjectivesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listServiceLevelObjectives(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List the `ServiceLevelObjective`s for the given `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   for (ServiceLevelObjective element : serviceMonitoringServiceClient.listServiceLevelObjectives(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the parent `Service`. Of the form + * `projects/{project_id}/services/{service_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(String parent) { + ListServiceLevelObjectivesRequest request = + ListServiceLevelObjectivesRequest.newBuilder().setParent(parent).build(); + return listServiceLevelObjectives(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List the `ServiceLevelObjective`s for the given `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ListServiceLevelObjectivesRequest request = ListServiceLevelObjectivesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (ServiceLevelObjective element : serviceMonitoringServiceClient.listServiceLevelObjectives(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 ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives( + ListServiceLevelObjectivesRequest request) { + return listServiceLevelObjectivesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List the `ServiceLevelObjective`s for the given `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ListServiceLevelObjectivesRequest request = ListServiceLevelObjectivesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListServiceLevelObjectivesPagedResponse> future = serviceMonitoringServiceClient.listServiceLevelObjectivesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ServiceLevelObjective element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable< + ListServiceLevelObjectivesRequest, ListServiceLevelObjectivesPagedResponse> + listServiceLevelObjectivesPagedCallable() { + return stub.listServiceLevelObjectivesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List the `ServiceLevelObjective`s for the given `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ListServiceLevelObjectivesRequest request = ListServiceLevelObjectivesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListServiceLevelObjectivesResponse response = serviceMonitoringServiceClient.listServiceLevelObjectivesCallable().call(request);
+   *     for (ServiceLevelObjective element : response.getServiceLevelObjectivesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listServiceLevelObjectivesCallable() { + return stub.listServiceLevelObjectivesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Update the given `ServiceLevelObjective`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
+   *   ServiceLevelObjective response = serviceMonitoringServiceClient.updateServiceLevelObjective(serviceLevelObjective);
+   * }
+   * 
+ * + * @param serviceLevelObjective The `ServiceLevelObjective` to draw updates from. The given `name` + * specifies the resource to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServiceLevelObjective updateServiceLevelObjective( + ServiceLevelObjective serviceLevelObjective) { + + UpdateServiceLevelObjectiveRequest request = + UpdateServiceLevelObjectiveRequest.newBuilder() + .setServiceLevelObjective(serviceLevelObjective) + .build(); + return updateServiceLevelObjective(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Update the given `ServiceLevelObjective`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
+   *   UpdateServiceLevelObjectiveRequest request = UpdateServiceLevelObjectiveRequest.newBuilder()
+   *     .setServiceLevelObjective(serviceLevelObjective)
+   *     .build();
+   *   ServiceLevelObjective response = serviceMonitoringServiceClient.updateServiceLevelObjective(request);
+   * }
+   * 
+ * + * @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 ServiceLevelObjective updateServiceLevelObjective( + UpdateServiceLevelObjectiveRequest request) { + return updateServiceLevelObjectiveCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Update the given `ServiceLevelObjective`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
+   *   UpdateServiceLevelObjectiveRequest request = UpdateServiceLevelObjectiveRequest.newBuilder()
+   *     .setServiceLevelObjective(serviceLevelObjective)
+   *     .build();
+   *   ApiFuture<ServiceLevelObjective> future = serviceMonitoringServiceClient.updateServiceLevelObjectiveCallable().futureCall(request);
+   *   // Do something
+   *   ServiceLevelObjective response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateServiceLevelObjectiveCallable() { + return stub.updateServiceLevelObjectiveCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Delete the given `ServiceLevelObjective`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   serviceMonitoringServiceClient.deleteServiceLevelObjective(name);
+   * }
+   * 
+ * + * @param name Resource name of the `ServiceLevelObjective` to delete. Of the form + * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteServiceLevelObjective(ServiceLevelObjectiveName name) { + + DeleteServiceLevelObjectiveRequest request = + DeleteServiceLevelObjectiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteServiceLevelObjective(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Delete the given `ServiceLevelObjective`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   serviceMonitoringServiceClient.deleteServiceLevelObjective(name.toString());
+   * }
+   * 
+ * + * @param name Resource name of the `ServiceLevelObjective` to delete. Of the form + * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteServiceLevelObjective(String name) { + + DeleteServiceLevelObjectiveRequest request = + DeleteServiceLevelObjectiveRequest.newBuilder().setName(name).build(); + deleteServiceLevelObjective(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Delete the given `ServiceLevelObjective`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   DeleteServiceLevelObjectiveRequest request = DeleteServiceLevelObjectiveRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   serviceMonitoringServiceClient.deleteServiceLevelObjective(request);
+   * }
+   * 
+ * + * @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 void deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest request) { + deleteServiceLevelObjectiveCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Delete the given `ServiceLevelObjective`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   DeleteServiceLevelObjectiveRequest request = DeleteServiceLevelObjectiveRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = serviceMonitoringServiceClient.deleteServiceLevelObjectiveCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + deleteServiceLevelObjectiveCallable() { + return stub.deleteServiceLevelObjectiveCallable(); + } + + @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 ListServicesPagedResponse + extends AbstractPagedListResponse< + ListServicesRequest, + ListServicesResponse, + Service, + ListServicesPage, + ListServicesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListServicesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListServicesPagedResponse apply(ListServicesPage input) { + return new ListServicesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListServicesPagedResponse(ListServicesPage page) { + super(page, ListServicesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListServicesPage + extends AbstractPage { + + private ListServicesPage( + PageContext context, + ListServicesResponse response) { + super(context, response); + } + + private static ListServicesPage createEmptyPage() { + return new ListServicesPage(null, null); + } + + @Override + protected ListServicesPage createPage( + PageContext context, + ListServicesResponse response) { + return new ListServicesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListServicesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListServicesRequest, + ListServicesResponse, + Service, + ListServicesPage, + ListServicesFixedSizeCollection> { + + private ListServicesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListServicesFixedSizeCollection createEmptyCollection() { + return new ListServicesFixedSizeCollection(null, 0); + } + + @Override + protected ListServicesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListServicesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListServiceLevelObjectivesPagedResponse + extends AbstractPagedListResponse< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ServiceLevelObjective, + ListServiceLevelObjectivesPage, + ListServiceLevelObjectivesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ServiceLevelObjective> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListServiceLevelObjectivesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction< + ListServiceLevelObjectivesPage, ListServiceLevelObjectivesPagedResponse>() { + @Override + public ListServiceLevelObjectivesPagedResponse apply( + ListServiceLevelObjectivesPage input) { + return new ListServiceLevelObjectivesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListServiceLevelObjectivesPagedResponse(ListServiceLevelObjectivesPage page) { + super(page, ListServiceLevelObjectivesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListServiceLevelObjectivesPage + extends AbstractPage< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ServiceLevelObjective, + ListServiceLevelObjectivesPage> { + + private ListServiceLevelObjectivesPage( + PageContext< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ServiceLevelObjective> + context, + ListServiceLevelObjectivesResponse response) { + super(context, response); + } + + private static ListServiceLevelObjectivesPage createEmptyPage() { + return new ListServiceLevelObjectivesPage(null, null); + } + + @Override + protected ListServiceLevelObjectivesPage createPage( + PageContext< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ServiceLevelObjective> + context, + ListServiceLevelObjectivesResponse response) { + return new ListServiceLevelObjectivesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ServiceLevelObjective> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListServiceLevelObjectivesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ServiceLevelObjective, + ListServiceLevelObjectivesPage, + ListServiceLevelObjectivesFixedSizeCollection> { + + private ListServiceLevelObjectivesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListServiceLevelObjectivesFixedSizeCollection createEmptyCollection() { + return new ListServiceLevelObjectivesFixedSizeCollection(null, 0); + } + + @Override + protected ListServiceLevelObjectivesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListServiceLevelObjectivesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java new file mode 100644 index 00000000..4b66a134 --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java @@ -0,0 +1,309 @@ +/* + * Copyright 2019 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.ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse; +import static com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServicesPagedResponse; + +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.ServiceMonitoringServiceStubSettings; +import com.google.monitoring.v3.CreateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.CreateServiceRequest; +import com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest; +import com.google.monitoring.v3.DeleteServiceRequest; +import com.google.monitoring.v3.GetServiceLevelObjectiveRequest; +import com.google.monitoring.v3.GetServiceRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesResponse; +import com.google.monitoring.v3.ListServicesRequest; +import com.google.monitoring.v3.ListServicesResponse; +import com.google.monitoring.v3.Service; +import com.google.monitoring.v3.ServiceLevelObjective; +import com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.UpdateServiceRequest; +import com.google.protobuf.Empty; +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 ServiceMonitoringServiceClient}. + * + *

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 createService to 30 seconds: + * + *

+ * 
+ * ServiceMonitoringServiceSettings.Builder serviceMonitoringServiceSettingsBuilder =
+ *     ServiceMonitoringServiceSettings.newBuilder();
+ * serviceMonitoringServiceSettingsBuilder.createServiceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ServiceMonitoringServiceSettings serviceMonitoringServiceSettings = serviceMonitoringServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class ServiceMonitoringServiceSettings + extends ClientSettings { + /** Returns the object with the settings used for calls to createService. */ + public UnaryCallSettings createServiceSettings() { + return ((ServiceMonitoringServiceStubSettings) getStubSettings()).createServiceSettings(); + } + + /** Returns the object with the settings used for calls to getService. */ + public UnaryCallSettings getServiceSettings() { + return ((ServiceMonitoringServiceStubSettings) getStubSettings()).getServiceSettings(); + } + + /** Returns the object with the settings used for calls to listServices. */ + public PagedCallSettings + listServicesSettings() { + return ((ServiceMonitoringServiceStubSettings) getStubSettings()).listServicesSettings(); + } + + /** Returns the object with the settings used for calls to updateService. */ + public UnaryCallSettings updateServiceSettings() { + return ((ServiceMonitoringServiceStubSettings) getStubSettings()).updateServiceSettings(); + } + + /** Returns the object with the settings used for calls to deleteService. */ + public UnaryCallSettings deleteServiceSettings() { + return ((ServiceMonitoringServiceStubSettings) getStubSettings()).deleteServiceSettings(); + } + + /** Returns the object with the settings used for calls to createServiceLevelObjective. */ + public UnaryCallSettings + createServiceLevelObjectiveSettings() { + return ((ServiceMonitoringServiceStubSettings) getStubSettings()) + .createServiceLevelObjectiveSettings(); + } + + /** Returns the object with the settings used for calls to getServiceLevelObjective. */ + public UnaryCallSettings + getServiceLevelObjectiveSettings() { + return ((ServiceMonitoringServiceStubSettings) getStubSettings()) + .getServiceLevelObjectiveSettings(); + } + + /** Returns the object with the settings used for calls to listServiceLevelObjectives. */ + public PagedCallSettings< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ListServiceLevelObjectivesPagedResponse> + listServiceLevelObjectivesSettings() { + return ((ServiceMonitoringServiceStubSettings) getStubSettings()) + .listServiceLevelObjectivesSettings(); + } + + /** Returns the object with the settings used for calls to updateServiceLevelObjective. */ + public UnaryCallSettings + updateServiceLevelObjectiveSettings() { + return ((ServiceMonitoringServiceStubSettings) getStubSettings()) + .updateServiceLevelObjectiveSettings(); + } + + /** Returns the object with the settings used for calls to deleteServiceLevelObjective. */ + public UnaryCallSettings + deleteServiceLevelObjectiveSettings() { + return ((ServiceMonitoringServiceStubSettings) getStubSettings()) + .deleteServiceLevelObjectiveSettings(); + } + + public static final ServiceMonitoringServiceSettings create( + ServiceMonitoringServiceStubSettings stub) throws IOException { + return new ServiceMonitoringServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ServiceMonitoringServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ServiceMonitoringServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ServiceMonitoringServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ServiceMonitoringServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ServiceMonitoringServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ServiceMonitoringServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ServiceMonitoringServiceStubSettings.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 ServiceMonitoringServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ServiceMonitoringServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ServiceMonitoringServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ServiceMonitoringServiceStubSettings.newBuilder()); + } + + protected Builder(ServiceMonitoringServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ServiceMonitoringServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public ServiceMonitoringServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ServiceMonitoringServiceStubSettings.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 createService. */ + public UnaryCallSettings.Builder createServiceSettings() { + return getStubSettingsBuilder().createServiceSettings(); + } + + /** Returns the builder for the settings used for calls to getService. */ + public UnaryCallSettings.Builder getServiceSettings() { + return getStubSettingsBuilder().getServiceSettings(); + } + + /** Returns the builder for the settings used for calls to listServices. */ + public PagedCallSettings.Builder< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse> + listServicesSettings() { + return getStubSettingsBuilder().listServicesSettings(); + } + + /** Returns the builder for the settings used for calls to updateService. */ + public UnaryCallSettings.Builder updateServiceSettings() { + return getStubSettingsBuilder().updateServiceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteService. */ + public UnaryCallSettings.Builder deleteServiceSettings() { + return getStubSettingsBuilder().deleteServiceSettings(); + } + + /** Returns the builder for the settings used for calls to createServiceLevelObjective. */ + public UnaryCallSettings.Builder + createServiceLevelObjectiveSettings() { + return getStubSettingsBuilder().createServiceLevelObjectiveSettings(); + } + + /** Returns the builder for the settings used for calls to getServiceLevelObjective. */ + public UnaryCallSettings.Builder + getServiceLevelObjectiveSettings() { + return getStubSettingsBuilder().getServiceLevelObjectiveSettings(); + } + + /** Returns the builder for the settings used for calls to listServiceLevelObjectives. */ + public PagedCallSettings.Builder< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ListServiceLevelObjectivesPagedResponse> + listServiceLevelObjectivesSettings() { + return getStubSettingsBuilder().listServiceLevelObjectivesSettings(); + } + + /** Returns the builder for the settings used for calls to updateServiceLevelObjective. */ + public UnaryCallSettings.Builder + updateServiceLevelObjectiveSettings() { + return getStubSettingsBuilder().updateServiceLevelObjectiveSettings(); + } + + /** Returns the builder for the settings used for calls to deleteServiceLevelObjective. */ + public UnaryCallSettings.Builder + deleteServiceLevelObjectiveSettings() { + return getStubSettingsBuilder().deleteServiceLevelObjectiveSettings(); + } + + @Override + public ServiceMonitoringServiceSettings build() throws IOException { + return new ServiceMonitoringServiceSettings(this); + } + } +} 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 4c9f41ee..6174bba4 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 @@ -95,6 +95,24 @@ * * * + * ============================== ServiceMonitoringServiceClient ============================== + * + *

Service Description: The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints + * for managing and querying aspects of a workspace's services. These include the `Service`'s + * monitored resources, its Service-Level Objectives, and a taxonomy of categorized Health Metrics. + * + *

Sample for ServiceMonitoringServiceClient: + * + *

+ * 
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Service service = Service.newBuilder().build();
+ *   Service response = serviceMonitoringServiceClient.createService(parent, service);
+ * }
+ * 
+ * 
+ * * ======================== UptimeCheckServiceClient ======================== * *

Service Description: The UptimeCheckService API is used to manage (list, create, delete, edit) diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceCallableFactory.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceCallableFactory.java new file mode 100644 index 00000000..93982924 --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 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.core.BetaApi; +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.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Stackdriver Monitoring API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcServiceMonitoringServiceCallableFactory 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 pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceStub.java new file mode 100644 index 00000000..b55494c0 --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceStub.java @@ -0,0 +1,503 @@ +/* + * Copyright 2019 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.ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse; +import static com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServicesPagedResponse; + +import com.google.api.core.BetaApi; +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.monitoring.v3.CreateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.CreateServiceRequest; +import com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest; +import com.google.monitoring.v3.DeleteServiceRequest; +import com.google.monitoring.v3.GetServiceLevelObjectiveRequest; +import com.google.monitoring.v3.GetServiceRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesResponse; +import com.google.monitoring.v3.ListServicesRequest; +import com.google.monitoring.v3.ListServicesResponse; +import com.google.monitoring.v3.Service; +import com.google.monitoring.v3.ServiceLevelObjective; +import com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.UpdateServiceRequest; +import com.google.protobuf.Empty; +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 Stackdriver Monitoring API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcServiceMonitoringServiceStub extends ServiceMonitoringServiceStub { + + private static final MethodDescriptor + createServiceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.monitoring.v3.ServiceMonitoringService/CreateService") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateServiceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Service.getDefaultInstance())) + .build(); + private static final MethodDescriptor getServiceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.monitoring.v3.ServiceMonitoringService/GetService") + .setRequestMarshaller(ProtoUtils.marshaller(GetServiceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Service.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listServicesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.monitoring.v3.ServiceMonitoringService/ListServices") + .setRequestMarshaller(ProtoUtils.marshaller(ListServicesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListServicesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateServiceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.monitoring.v3.ServiceMonitoringService/UpdateService") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateServiceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Service.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteServiceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.monitoring.v3.ServiceMonitoringService/DeleteService") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteServiceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createServiceLevelObjectiveMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateServiceLevelObjectiveRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ServiceLevelObjective.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getServiceLevelObjectiveMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective") + .setRequestMarshaller( + ProtoUtils.marshaller(GetServiceLevelObjectiveRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ServiceLevelObjective.getDefaultInstance())) + .build(); + private static final MethodDescriptor< + ListServiceLevelObjectivesRequest, ListServiceLevelObjectivesResponse> + listServiceLevelObjectivesMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives") + .setRequestMarshaller( + ProtoUtils.marshaller(ListServiceLevelObjectivesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListServiceLevelObjectivesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateServiceLevelObjectiveMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateServiceLevelObjectiveRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ServiceLevelObjective.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteServiceLevelObjectiveMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteServiceLevelObjectiveRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable createServiceCallable; + private final UnaryCallable getServiceCallable; + private final UnaryCallable listServicesCallable; + private final UnaryCallable + listServicesPagedCallable; + private final UnaryCallable updateServiceCallable; + private final UnaryCallable deleteServiceCallable; + private final UnaryCallable + createServiceLevelObjectiveCallable; + private final UnaryCallable + getServiceLevelObjectiveCallable; + private final UnaryCallable + listServiceLevelObjectivesCallable; + private final UnaryCallable< + ListServiceLevelObjectivesRequest, ListServiceLevelObjectivesPagedResponse> + listServiceLevelObjectivesPagedCallable; + private final UnaryCallable + updateServiceLevelObjectiveCallable; + private final UnaryCallable + deleteServiceLevelObjectiveCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcServiceMonitoringServiceStub create( + ServiceMonitoringServiceStubSettings settings) throws IOException { + return new GrpcServiceMonitoringServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcServiceMonitoringServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcServiceMonitoringServiceStub( + ServiceMonitoringServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcServiceMonitoringServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcServiceMonitoringServiceStub( + ServiceMonitoringServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcServiceMonitoringServiceStub, 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 GrpcServiceMonitoringServiceStub( + ServiceMonitoringServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcServiceMonitoringServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcServiceMonitoringServiceStub, 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 GrpcServiceMonitoringServiceStub( + ServiceMonitoringServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings createServiceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createServiceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateServiceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getServiceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getServiceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetServiceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listServicesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listServicesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListServicesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateServiceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateServiceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateServiceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("service.name", String.valueOf(request.getService().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteServiceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteServiceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteServiceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + createServiceLevelObjectiveTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createServiceLevelObjectiveMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + CreateServiceLevelObjectiveRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getServiceLevelObjectiveTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getServiceLevelObjectiveMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetServiceLevelObjectiveRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listServiceLevelObjectivesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listServiceLevelObjectivesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + ListServiceLevelObjectivesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateServiceLevelObjectiveTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateServiceLevelObjectiveMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + UpdateServiceLevelObjectiveRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "service_level_objective.name", + String.valueOf(request.getServiceLevelObjective().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + deleteServiceLevelObjectiveTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteServiceLevelObjectiveMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + DeleteServiceLevelObjectiveRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.createServiceCallable = + callableFactory.createUnaryCallable( + createServiceTransportSettings, settings.createServiceSettings(), clientContext); + this.getServiceCallable = + callableFactory.createUnaryCallable( + getServiceTransportSettings, settings.getServiceSettings(), clientContext); + this.listServicesCallable = + callableFactory.createUnaryCallable( + listServicesTransportSettings, settings.listServicesSettings(), clientContext); + this.listServicesPagedCallable = + callableFactory.createPagedCallable( + listServicesTransportSettings, settings.listServicesSettings(), clientContext); + this.updateServiceCallable = + callableFactory.createUnaryCallable( + updateServiceTransportSettings, settings.updateServiceSettings(), clientContext); + this.deleteServiceCallable = + callableFactory.createUnaryCallable( + deleteServiceTransportSettings, settings.deleteServiceSettings(), clientContext); + this.createServiceLevelObjectiveCallable = + callableFactory.createUnaryCallable( + createServiceLevelObjectiveTransportSettings, + settings.createServiceLevelObjectiveSettings(), + clientContext); + this.getServiceLevelObjectiveCallable = + callableFactory.createUnaryCallable( + getServiceLevelObjectiveTransportSettings, + settings.getServiceLevelObjectiveSettings(), + clientContext); + this.listServiceLevelObjectivesCallable = + callableFactory.createUnaryCallable( + listServiceLevelObjectivesTransportSettings, + settings.listServiceLevelObjectivesSettings(), + clientContext); + this.listServiceLevelObjectivesPagedCallable = + callableFactory.createPagedCallable( + listServiceLevelObjectivesTransportSettings, + settings.listServiceLevelObjectivesSettings(), + clientContext); + this.updateServiceLevelObjectiveCallable = + callableFactory.createUnaryCallable( + updateServiceLevelObjectiveTransportSettings, + settings.updateServiceLevelObjectiveSettings(), + clientContext); + this.deleteServiceLevelObjectiveCallable = + callableFactory.createUnaryCallable( + deleteServiceLevelObjectiveTransportSettings, + settings.deleteServiceLevelObjectiveSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable createServiceCallable() { + return createServiceCallable; + } + + public UnaryCallable getServiceCallable() { + return getServiceCallable; + } + + public UnaryCallable listServicesPagedCallable() { + return listServicesPagedCallable; + } + + public UnaryCallable listServicesCallable() { + return listServicesCallable; + } + + public UnaryCallable updateServiceCallable() { + return updateServiceCallable; + } + + public UnaryCallable deleteServiceCallable() { + return deleteServiceCallable; + } + + public UnaryCallable + createServiceLevelObjectiveCallable() { + return createServiceLevelObjectiveCallable; + } + + public UnaryCallable + getServiceLevelObjectiveCallable() { + return getServiceLevelObjectiveCallable; + } + + public UnaryCallable + listServiceLevelObjectivesPagedCallable() { + return listServiceLevelObjectivesPagedCallable; + } + + public UnaryCallable + listServiceLevelObjectivesCallable() { + return listServiceLevelObjectivesCallable; + } + + public UnaryCallable + updateServiceLevelObjectiveCallable() { + return updateServiceLevelObjectiveCallable; + } + + public UnaryCallable + deleteServiceLevelObjectiveCallable() { + return deleteServiceLevelObjectiveCallable; + } + + @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/ServiceMonitoringServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStub.java new file mode 100644 index 00000000..7bc2ca8a --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStub.java @@ -0,0 +1,112 @@ +/* + * Copyright 2019 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.ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse; +import static com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServicesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.monitoring.v3.CreateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.CreateServiceRequest; +import com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest; +import com.google.monitoring.v3.DeleteServiceRequest; +import com.google.monitoring.v3.GetServiceLevelObjectiveRequest; +import com.google.monitoring.v3.GetServiceRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesResponse; +import com.google.monitoring.v3.ListServicesRequest; +import com.google.monitoring.v3.ListServicesResponse; +import com.google.monitoring.v3.Service; +import com.google.monitoring.v3.ServiceLevelObjective; +import com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.UpdateServiceRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Stackdriver Monitoring API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class ServiceMonitoringServiceStub implements BackgroundResource { + + public UnaryCallable createServiceCallable() { + throw new UnsupportedOperationException("Not implemented: createServiceCallable()"); + } + + public UnaryCallable getServiceCallable() { + throw new UnsupportedOperationException("Not implemented: getServiceCallable()"); + } + + public UnaryCallable listServicesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listServicesPagedCallable()"); + } + + public UnaryCallable listServicesCallable() { + throw new UnsupportedOperationException("Not implemented: listServicesCallable()"); + } + + public UnaryCallable updateServiceCallable() { + throw new UnsupportedOperationException("Not implemented: updateServiceCallable()"); + } + + public UnaryCallable deleteServiceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteServiceCallable()"); + } + + public UnaryCallable + createServiceLevelObjectiveCallable() { + throw new UnsupportedOperationException( + "Not implemented: createServiceLevelObjectiveCallable()"); + } + + public UnaryCallable + getServiceLevelObjectiveCallable() { + throw new UnsupportedOperationException("Not implemented: getServiceLevelObjectiveCallable()"); + } + + public UnaryCallable + listServiceLevelObjectivesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listServiceLevelObjectivesPagedCallable()"); + } + + public UnaryCallable + listServiceLevelObjectivesCallable() { + throw new UnsupportedOperationException( + "Not implemented: listServiceLevelObjectivesCallable()"); + } + + public UnaryCallable + updateServiceLevelObjectiveCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateServiceLevelObjectiveCallable()"); + } + + public UnaryCallable + deleteServiceLevelObjectiveCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteServiceLevelObjectiveCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStubSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStubSettings.java new file mode 100644 index 00000000..bbd5bd0d --- /dev/null +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStubSettings.java @@ -0,0 +1,683 @@ +/* + * Copyright 2019 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.ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse; +import static com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServicesPagedResponse; + +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.CreateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.CreateServiceRequest; +import com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest; +import com.google.monitoring.v3.DeleteServiceRequest; +import com.google.monitoring.v3.GetServiceLevelObjectiveRequest; +import com.google.monitoring.v3.GetServiceRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesResponse; +import com.google.monitoring.v3.ListServicesRequest; +import com.google.monitoring.v3.ListServicesResponse; +import com.google.monitoring.v3.Service; +import com.google.monitoring.v3.ServiceLevelObjective; +import com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.UpdateServiceRequest; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ServiceMonitoringServiceStub}. + * + *

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 createService to 30 seconds: + * + *

+ * 
+ * ServiceMonitoringServiceStubSettings.Builder serviceMonitoringServiceSettingsBuilder =
+ *     ServiceMonitoringServiceStubSettings.newBuilder();
+ * serviceMonitoringServiceSettingsBuilder.createServiceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ServiceMonitoringServiceStubSettings serviceMonitoringServiceSettings = serviceMonitoringServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class ServiceMonitoringServiceStubSettings + 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") + .add("https://www.googleapis.com/auth/monitoring.write") + .build(); + + private final UnaryCallSettings createServiceSettings; + private final UnaryCallSettings getServiceSettings; + private final PagedCallSettings< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse> + listServicesSettings; + private final UnaryCallSettings updateServiceSettings; + private final UnaryCallSettings deleteServiceSettings; + private final UnaryCallSettings + createServiceLevelObjectiveSettings; + private final UnaryCallSettings + getServiceLevelObjectiveSettings; + private final PagedCallSettings< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ListServiceLevelObjectivesPagedResponse> + listServiceLevelObjectivesSettings; + private final UnaryCallSettings + updateServiceLevelObjectiveSettings; + private final UnaryCallSettings + deleteServiceLevelObjectiveSettings; + + /** Returns the object with the settings used for calls to createService. */ + public UnaryCallSettings createServiceSettings() { + return createServiceSettings; + } + + /** Returns the object with the settings used for calls to getService. */ + public UnaryCallSettings getServiceSettings() { + return getServiceSettings; + } + + /** Returns the object with the settings used for calls to listServices. */ + public PagedCallSettings + listServicesSettings() { + return listServicesSettings; + } + + /** Returns the object with the settings used for calls to updateService. */ + public UnaryCallSettings updateServiceSettings() { + return updateServiceSettings; + } + + /** Returns the object with the settings used for calls to deleteService. */ + public UnaryCallSettings deleteServiceSettings() { + return deleteServiceSettings; + } + + /** Returns the object with the settings used for calls to createServiceLevelObjective. */ + public UnaryCallSettings + createServiceLevelObjectiveSettings() { + return createServiceLevelObjectiveSettings; + } + + /** Returns the object with the settings used for calls to getServiceLevelObjective. */ + public UnaryCallSettings + getServiceLevelObjectiveSettings() { + return getServiceLevelObjectiveSettings; + } + + /** Returns the object with the settings used for calls to listServiceLevelObjectives. */ + public PagedCallSettings< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ListServiceLevelObjectivesPagedResponse> + listServiceLevelObjectivesSettings() { + return listServiceLevelObjectivesSettings; + } + + /** Returns the object with the settings used for calls to updateServiceLevelObjective. */ + public UnaryCallSettings + updateServiceLevelObjectiveSettings() { + return updateServiceLevelObjectiveSettings; + } + + /** Returns the object with the settings used for calls to deleteServiceLevelObjective. */ + public UnaryCallSettings + deleteServiceLevelObjectiveSettings() { + return deleteServiceLevelObjectiveSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ServiceMonitoringServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcServiceMonitoringServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + 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(ServiceMonitoringServiceStubSettings.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 ServiceMonitoringServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createServiceSettings = settingsBuilder.createServiceSettings().build(); + getServiceSettings = settingsBuilder.getServiceSettings().build(); + listServicesSettings = settingsBuilder.listServicesSettings().build(); + updateServiceSettings = settingsBuilder.updateServiceSettings().build(); + deleteServiceSettings = settingsBuilder.deleteServiceSettings().build(); + createServiceLevelObjectiveSettings = + settingsBuilder.createServiceLevelObjectiveSettings().build(); + getServiceLevelObjectiveSettings = settingsBuilder.getServiceLevelObjectiveSettings().build(); + listServiceLevelObjectivesSettings = + settingsBuilder.listServiceLevelObjectivesSettings().build(); + updateServiceLevelObjectiveSettings = + settingsBuilder.updateServiceLevelObjectiveSettings().build(); + deleteServiceLevelObjectiveSettings = + settingsBuilder.deleteServiceLevelObjectiveSettings().build(); + } + + private static final PagedListDescriptor + LIST_SERVICES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListServicesRequest injectToken(ListServicesRequest payload, String token) { + return ListServicesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListServicesRequest injectPageSize(ListServicesRequest payload, int pageSize) { + return ListServicesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListServicesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListServicesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListServicesResponse payload) { + return payload.getServicesList() != null + ? payload.getServicesList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ServiceLevelObjective> + LIST_SERVICE_LEVEL_OBJECTIVES_PAGE_STR_DESC = + new PagedListDescriptor< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ServiceLevelObjective>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListServiceLevelObjectivesRequest injectToken( + ListServiceLevelObjectivesRequest payload, String token) { + return ListServiceLevelObjectivesRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListServiceLevelObjectivesRequest injectPageSize( + ListServiceLevelObjectivesRequest payload, int pageSize) { + return ListServiceLevelObjectivesRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListServiceLevelObjectivesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListServiceLevelObjectivesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListServiceLevelObjectivesResponse payload) { + return payload.getServiceLevelObjectivesList() != null + ? payload.getServiceLevelObjectivesList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse> + LIST_SERVICES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListServicesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SERVICES_PAGE_STR_DESC, request, context); + return ListServicesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ListServiceLevelObjectivesPagedResponse> + LIST_SERVICE_LEVEL_OBJECTIVES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ListServiceLevelObjectivesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListServiceLevelObjectivesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ServiceLevelObjective> + pageContext = + PageContext.create( + callable, LIST_SERVICE_LEVEL_OBJECTIVES_PAGE_STR_DESC, request, context); + return ListServiceLevelObjectivesPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + /** Builder for ServiceMonitoringServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder createServiceSettings; + private final UnaryCallSettings.Builder getServiceSettings; + private final PagedCallSettings.Builder< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse> + listServicesSettings; + private final UnaryCallSettings.Builder updateServiceSettings; + private final UnaryCallSettings.Builder deleteServiceSettings; + private final UnaryCallSettings.Builder< + CreateServiceLevelObjectiveRequest, ServiceLevelObjective> + createServiceLevelObjectiveSettings; + private final UnaryCallSettings.Builder + getServiceLevelObjectiveSettings; + private final PagedCallSettings.Builder< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ListServiceLevelObjectivesPagedResponse> + listServiceLevelObjectivesSettings; + private final UnaryCallSettings.Builder< + UpdateServiceLevelObjectiveRequest, ServiceLevelObjective> + updateServiceLevelObjectiveSettings; + private final UnaryCallSettings.Builder + deleteServiceLevelObjectiveSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", 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() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listServicesSettings = PagedCallSettings.newBuilder(LIST_SERVICES_PAGE_STR_FACT); + + updateServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createServiceLevelObjectiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getServiceLevelObjectiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listServiceLevelObjectivesSettings = + PagedCallSettings.newBuilder(LIST_SERVICE_LEVEL_OBJECTIVES_PAGE_STR_FACT); + + updateServiceLevelObjectiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteServiceLevelObjectiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createServiceSettings, + getServiceSettings, + listServicesSettings, + updateServiceSettings, + deleteServiceSettings, + createServiceLevelObjectiveSettings, + getServiceLevelObjectiveSettings, + listServiceLevelObjectivesSettings, + updateServiceLevelObjectiveSettings, + deleteServiceLevelObjectiveSettings); + + initDefaults(this); + } + + 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 + .createServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listServicesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createServiceLevelObjectiveSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getServiceLevelObjectiveSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listServiceLevelObjectivesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateServiceLevelObjectiveSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteServiceLevelObjectiveSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ServiceMonitoringServiceStubSettings settings) { + super(settings); + + createServiceSettings = settings.createServiceSettings.toBuilder(); + getServiceSettings = settings.getServiceSettings.toBuilder(); + listServicesSettings = settings.listServicesSettings.toBuilder(); + updateServiceSettings = settings.updateServiceSettings.toBuilder(); + deleteServiceSettings = settings.deleteServiceSettings.toBuilder(); + createServiceLevelObjectiveSettings = + settings.createServiceLevelObjectiveSettings.toBuilder(); + getServiceLevelObjectiveSettings = settings.getServiceLevelObjectiveSettings.toBuilder(); + listServiceLevelObjectivesSettings = settings.listServiceLevelObjectivesSettings.toBuilder(); + updateServiceLevelObjectiveSettings = + settings.updateServiceLevelObjectiveSettings.toBuilder(); + deleteServiceLevelObjectiveSettings = + settings.deleteServiceLevelObjectiveSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createServiceSettings, + getServiceSettings, + listServicesSettings, + updateServiceSettings, + deleteServiceSettings, + createServiceLevelObjectiveSettings, + getServiceLevelObjectiveSettings, + listServiceLevelObjectivesSettings, + updateServiceLevelObjectiveSettings, + deleteServiceLevelObjectiveSettings); + } + + // 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 createService. */ + public UnaryCallSettings.Builder createServiceSettings() { + return createServiceSettings; + } + + /** Returns the builder for the settings used for calls to getService. */ + public UnaryCallSettings.Builder getServiceSettings() { + return getServiceSettings; + } + + /** Returns the builder for the settings used for calls to listServices. */ + public PagedCallSettings.Builder< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse> + listServicesSettings() { + return listServicesSettings; + } + + /** Returns the builder for the settings used for calls to updateService. */ + public UnaryCallSettings.Builder updateServiceSettings() { + return updateServiceSettings; + } + + /** Returns the builder for the settings used for calls to deleteService. */ + public UnaryCallSettings.Builder deleteServiceSettings() { + return deleteServiceSettings; + } + + /** Returns the builder for the settings used for calls to createServiceLevelObjective. */ + public UnaryCallSettings.Builder + createServiceLevelObjectiveSettings() { + return createServiceLevelObjectiveSettings; + } + + /** Returns the builder for the settings used for calls to getServiceLevelObjective. */ + public UnaryCallSettings.Builder + getServiceLevelObjectiveSettings() { + return getServiceLevelObjectiveSettings; + } + + /** Returns the builder for the settings used for calls to listServiceLevelObjectives. */ + public PagedCallSettings.Builder< + ListServiceLevelObjectivesRequest, + ListServiceLevelObjectivesResponse, + ListServiceLevelObjectivesPagedResponse> + listServiceLevelObjectivesSettings() { + return listServiceLevelObjectivesSettings; + } + + /** Returns the builder for the settings used for calls to updateServiceLevelObjective. */ + public UnaryCallSettings.Builder + updateServiceLevelObjectiveSettings() { + return updateServiceLevelObjectiveSettings; + } + + /** Returns the builder for the settings used for calls to deleteServiceLevelObjective. */ + public UnaryCallSettings.Builder + deleteServiceLevelObjectiveSettings() { + return deleteServiceLevelObjectiveSettings; + } + + @Override + public ServiceMonitoringServiceStubSettings build() throws IOException { + return new ServiceMonitoringServiceStubSettings(this); + } + } +} diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClientTest.java index 6b1d701f..c77ce7bd 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClientTest.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClientTest.java @@ -55,6 +55,7 @@ public class AlertPolicyServiceClientTest { private static MockGroupService mockGroupService; private static MockMetricService mockMetricService; private static MockNotificationChannelService mockNotificationChannelService; + private static MockServiceMonitoringService mockServiceMonitoringService; private static MockUptimeCheckService mockUptimeCheckService; private static MockServiceHelper serviceHelper; private AlertPolicyServiceClient client; @@ -66,6 +67,7 @@ public static void startStaticServer() { mockGroupService = new MockGroupService(); mockMetricService = new MockMetricService(); mockNotificationChannelService = new MockNotificationChannelService(); + mockServiceMonitoringService = new MockServiceMonitoringService(); mockUptimeCheckService = new MockUptimeCheckService(); serviceHelper = new MockServiceHelper( @@ -75,6 +77,7 @@ public static void startStaticServer() { mockGroupService, mockMetricService, mockNotificationChannelService, + mockServiceMonitoringService, mockUptimeCheckService)); serviceHelper.start(); } diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/GroupServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/GroupServiceClientTest.java index 802f5158..08bd49bb 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/GroupServiceClientTest.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/GroupServiceClientTest.java @@ -58,6 +58,7 @@ public class GroupServiceClientTest { private static MockGroupService mockGroupService; private static MockMetricService mockMetricService; private static MockNotificationChannelService mockNotificationChannelService; + private static MockServiceMonitoringService mockServiceMonitoringService; private static MockUptimeCheckService mockUptimeCheckService; private static MockServiceHelper serviceHelper; private GroupServiceClient client; @@ -69,6 +70,7 @@ public static void startStaticServer() { mockGroupService = new MockGroupService(); mockMetricService = new MockMetricService(); mockNotificationChannelService = new MockNotificationChannelService(); + mockServiceMonitoringService = new MockServiceMonitoringService(); mockUptimeCheckService = new MockUptimeCheckService(); serviceHelper = new MockServiceHelper( @@ -78,6 +80,7 @@ public static void startStaticServer() { mockGroupService, mockMetricService, mockNotificationChannelService, + mockServiceMonitoringService, mockUptimeCheckService)); serviceHelper.start(); } 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 24a9a003..1058ef89 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 @@ -66,6 +66,7 @@ public class MetricServiceClientTest { private static MockGroupService mockGroupService; private static MockMetricService mockMetricService; private static MockNotificationChannelService mockNotificationChannelService; + private static MockServiceMonitoringService mockServiceMonitoringService; private static MockUptimeCheckService mockUptimeCheckService; private static MockServiceHelper serviceHelper; private MetricServiceClient client; @@ -77,6 +78,7 @@ public static void startStaticServer() { mockGroupService = new MockGroupService(); mockMetricService = new MockMetricService(); mockNotificationChannelService = new MockNotificationChannelService(); + mockServiceMonitoringService = new MockServiceMonitoringService(); mockUptimeCheckService = new MockUptimeCheckService(); serviceHelper = new MockServiceHelper( @@ -86,6 +88,7 @@ public static void startStaticServer() { mockGroupService, mockMetricService, mockNotificationChannelService, + mockServiceMonitoringService, mockUptimeCheckService)); serviceHelper.start(); } diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockServiceMonitoringService.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockServiceMonitoringService.java new file mode 100644 index 00000000..c6b5acdb --- /dev/null +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockServiceMonitoringService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 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; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockServiceMonitoringService implements MockGrpcService { + private final MockServiceMonitoringServiceImpl serviceImpl; + + public MockServiceMonitoringService() { + serviceImpl = new MockServiceMonitoringServiceImpl(); + } + + @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/MockServiceMonitoringServiceImpl.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockServiceMonitoringServiceImpl.java new file mode 100644 index 00000000..b71c1cb5 --- /dev/null +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MockServiceMonitoringServiceImpl.java @@ -0,0 +1,225 @@ +/* + * Copyright 2019 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.CreateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.CreateServiceRequest; +import com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest; +import com.google.monitoring.v3.DeleteServiceRequest; +import com.google.monitoring.v3.GetServiceLevelObjectiveRequest; +import com.google.monitoring.v3.GetServiceRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesResponse; +import com.google.monitoring.v3.ListServicesRequest; +import com.google.monitoring.v3.ListServicesResponse; +import com.google.monitoring.v3.Service; +import com.google.monitoring.v3.ServiceLevelObjective; +import com.google.monitoring.v3.ServiceMonitoringServiceGrpc.ServiceMonitoringServiceImplBase; +import com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.UpdateServiceRequest; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockServiceMonitoringServiceImpl extends ServiceMonitoringServiceImplBase { + private List requests; + private Queue responses; + + public MockServiceMonitoringServiceImpl() { + 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 createService( + CreateServiceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Service) { + requests.add(request); + responseObserver.onNext((Service) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getService(GetServiceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Service) { + requests.add(request); + responseObserver.onNext((Service) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listServices( + ListServicesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListServicesResponse) { + requests.add(request); + responseObserver.onNext((ListServicesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateService( + UpdateServiceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Service) { + requests.add(request); + responseObserver.onNext((Service) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteService(DeleteServiceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createServiceLevelObjective( + CreateServiceLevelObjectiveRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ServiceLevelObjective) { + requests.add(request); + responseObserver.onNext((ServiceLevelObjective) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getServiceLevelObjective( + GetServiceLevelObjectiveRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ServiceLevelObjective) { + requests.add(request); + responseObserver.onNext((ServiceLevelObjective) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listServiceLevelObjectives( + ListServiceLevelObjectivesRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListServiceLevelObjectivesResponse) { + requests.add(request); + responseObserver.onNext((ListServiceLevelObjectivesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateServiceLevelObjective( + UpdateServiceLevelObjectiveRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ServiceLevelObjective) { + requests.add(request); + responseObserver.onNext((ServiceLevelObjective) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteServiceLevelObjective( + DeleteServiceLevelObjectiveRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} 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 e6f29121..bcff4cb7 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 @@ -65,6 +65,7 @@ public class NotificationChannelServiceClientTest { private static MockGroupService mockGroupService; private static MockMetricService mockMetricService; private static MockNotificationChannelService mockNotificationChannelService; + private static MockServiceMonitoringService mockServiceMonitoringService; private static MockUptimeCheckService mockUptimeCheckService; private static MockServiceHelper serviceHelper; private NotificationChannelServiceClient client; @@ -76,6 +77,7 @@ public static void startStaticServer() { mockGroupService = new MockGroupService(); mockMetricService = new MockMetricService(); mockNotificationChannelService = new MockNotificationChannelService(); + mockServiceMonitoringService = new MockServiceMonitoringService(); mockUptimeCheckService = new MockUptimeCheckService(); serviceHelper = new MockServiceHelper( @@ -85,6 +87,7 @@ public static void startStaticServer() { mockGroupService, mockMetricService, mockNotificationChannelService, + mockServiceMonitoringService, mockUptimeCheckService)); serviceHelper.start(); } diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClientTest.java new file mode 100644 index 00000000..f9195ba7 --- /dev/null +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClientTest.java @@ -0,0 +1,568 @@ +/* + * Copyright 2019 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.ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse; +import static com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServicesPagedResponse; + +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.CreateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.CreateServiceRequest; +import com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest; +import com.google.monitoring.v3.DeleteServiceRequest; +import com.google.monitoring.v3.GetServiceLevelObjectiveRequest; +import com.google.monitoring.v3.GetServiceRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesRequest; +import com.google.monitoring.v3.ListServiceLevelObjectivesResponse; +import com.google.monitoring.v3.ListServicesRequest; +import com.google.monitoring.v3.ListServicesResponse; +import com.google.monitoring.v3.ProjectName; +import com.google.monitoring.v3.Service; +import com.google.monitoring.v3.ServiceLevelObjective; +import com.google.monitoring.v3.ServiceLevelObjectiveName; +import com.google.monitoring.v3.ServiceName; +import com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest; +import com.google.monitoring.v3.UpdateServiceRequest; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ServiceMonitoringServiceClientTest { + private static MockAlertPolicyService mockAlertPolicyService; + private static MockGroupService mockGroupService; + private static MockMetricService mockMetricService; + private static MockNotificationChannelService mockNotificationChannelService; + private static MockServiceMonitoringService mockServiceMonitoringService; + private static MockUptimeCheckService mockUptimeCheckService; + private static MockServiceHelper serviceHelper; + private ServiceMonitoringServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAlertPolicyService = new MockAlertPolicyService(); + mockGroupService = new MockGroupService(); + mockMetricService = new MockMetricService(); + mockNotificationChannelService = new MockNotificationChannelService(); + mockServiceMonitoringService = new MockServiceMonitoringService(); + mockUptimeCheckService = new MockUptimeCheckService(); + serviceHelper = + new MockServiceHelper( + "in-process-1", + Arrays.asList( + mockAlertPolicyService, + mockGroupService, + mockMetricService, + mockNotificationChannelService, + mockServiceMonitoringService, + mockUptimeCheckService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ServiceMonitoringServiceSettings settings = + ServiceMonitoringServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ServiceMonitoringServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createServiceTest() { + ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]"); + String displayName = "displayName1615086568"; + Service expectedResponse = + Service.newBuilder().setName(name.toString()).setDisplayName(displayName).build(); + mockServiceMonitoringService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + Service service = Service.newBuilder().build(); + + Service actualResponse = client.createService(parent, service); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceMonitoringService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateServiceRequest actualRequest = (CreateServiceRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertEquals(service, actualRequest.getService()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createServiceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockServiceMonitoringService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + Service service = Service.newBuilder().build(); + + client.createService(parent, service); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getServiceTest() { + ServiceName name2 = ServiceName.of("[PROJECT]", "[SERVICE]"); + String displayName = "displayName1615086568"; + Service expectedResponse = + Service.newBuilder().setName(name2.toString()).setDisplayName(displayName).build(); + mockServiceMonitoringService.addResponse(expectedResponse); + + ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]"); + + Service actualResponse = client.getService(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceMonitoringService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetServiceRequest actualRequest = (GetServiceRequest) actualRequests.get(0); + + Assert.assertEquals(name, ServiceName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getServiceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockServiceMonitoringService.addException(exception); + + try { + ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]"); + + client.getService(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listServicesTest() { + String nextPageToken = ""; + Service servicesElement = Service.newBuilder().build(); + List services = Arrays.asList(servicesElement); + ListServicesResponse expectedResponse = + ListServicesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllServices(services) + .build(); + mockServiceMonitoringService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListServicesPagedResponse pagedListResponse = client.listServices(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getServicesList().get(0), resources.get(0)); + + List actualRequests = mockServiceMonitoringService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListServicesRequest actualRequest = (ListServicesRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listServicesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockServiceMonitoringService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + + client.listServices(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateServiceTest() { + ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]"); + String displayName = "displayName1615086568"; + Service expectedResponse = + Service.newBuilder().setName(name.toString()).setDisplayName(displayName).build(); + mockServiceMonitoringService.addResponse(expectedResponse); + + Service service = Service.newBuilder().build(); + + Service actualResponse = client.updateService(service); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceMonitoringService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateServiceRequest actualRequest = (UpdateServiceRequest) actualRequests.get(0); + + Assert.assertEquals(service, actualRequest.getService()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateServiceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockServiceMonitoringService.addException(exception); + + try { + Service service = Service.newBuilder().build(); + + client.updateService(service); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteServiceTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockServiceMonitoringService.addResponse(expectedResponse); + + ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]"); + + client.deleteService(name); + + List actualRequests = mockServiceMonitoringService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteServiceRequest actualRequest = (DeleteServiceRequest) actualRequests.get(0); + + Assert.assertEquals(name, ServiceName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteServiceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockServiceMonitoringService.addException(exception); + + try { + ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]"); + + client.deleteService(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createServiceLevelObjectiveTest() { + ServiceLevelObjectiveName name = + ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]"); + String displayName = "displayName1615086568"; + double goal = 317825.0; + ServiceLevelObjective expectedResponse = + ServiceLevelObjective.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setGoal(goal) + .build(); + mockServiceMonitoringService.addResponse(expectedResponse); + + ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]"); + ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build(); + + ServiceLevelObjective actualResponse = + client.createServiceLevelObjective(parent, serviceLevelObjective); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceMonitoringService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateServiceLevelObjectiveRequest actualRequest = + (CreateServiceLevelObjectiveRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ServiceName.parse(actualRequest.getParent())); + Assert.assertEquals(serviceLevelObjective, actualRequest.getServiceLevelObjective()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createServiceLevelObjectiveExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockServiceMonitoringService.addException(exception); + + try { + ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]"); + ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build(); + + client.createServiceLevelObjective(parent, serviceLevelObjective); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getServiceLevelObjectiveTest() { + ServiceLevelObjectiveName name2 = + ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]"); + String displayName = "displayName1615086568"; + double goal = 317825.0; + ServiceLevelObjective expectedResponse = + ServiceLevelObjective.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .setGoal(goal) + .build(); + mockServiceMonitoringService.addResponse(expectedResponse); + + ServiceLevelObjectiveName name = + ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]"); + + ServiceLevelObjective actualResponse = client.getServiceLevelObjective(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceMonitoringService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetServiceLevelObjectiveRequest actualRequest = + (GetServiceLevelObjectiveRequest) actualRequests.get(0); + + Assert.assertEquals(name, ServiceLevelObjectiveName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getServiceLevelObjectiveExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockServiceMonitoringService.addException(exception); + + try { + ServiceLevelObjectiveName name = + ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]"); + + client.getServiceLevelObjective(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listServiceLevelObjectivesTest() { + String nextPageToken = ""; + ServiceLevelObjective serviceLevelObjectivesElement = + ServiceLevelObjective.newBuilder().build(); + List serviceLevelObjectives = + Arrays.asList(serviceLevelObjectivesElement); + ListServiceLevelObjectivesResponse expectedResponse = + ListServiceLevelObjectivesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllServiceLevelObjectives(serviceLevelObjectives) + .build(); + mockServiceMonitoringService.addResponse(expectedResponse); + + ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]"); + + ListServiceLevelObjectivesPagedResponse pagedListResponse = + client.listServiceLevelObjectives(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getServiceLevelObjectivesList().get(0), resources.get(0)); + + List actualRequests = mockServiceMonitoringService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListServiceLevelObjectivesRequest actualRequest = + (ListServiceLevelObjectivesRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ServiceName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listServiceLevelObjectivesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockServiceMonitoringService.addException(exception); + + try { + ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]"); + + client.listServiceLevelObjectives(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateServiceLevelObjectiveTest() { + ServiceLevelObjectiveName name = + ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]"); + String displayName = "displayName1615086568"; + double goal = 317825.0; + ServiceLevelObjective expectedResponse = + ServiceLevelObjective.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setGoal(goal) + .build(); + mockServiceMonitoringService.addResponse(expectedResponse); + + ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build(); + + ServiceLevelObjective actualResponse = + client.updateServiceLevelObjective(serviceLevelObjective); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceMonitoringService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateServiceLevelObjectiveRequest actualRequest = + (UpdateServiceLevelObjectiveRequest) actualRequests.get(0); + + Assert.assertEquals(serviceLevelObjective, actualRequest.getServiceLevelObjective()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateServiceLevelObjectiveExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockServiceMonitoringService.addException(exception); + + try { + ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build(); + + client.updateServiceLevelObjective(serviceLevelObjective); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteServiceLevelObjectiveTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockServiceMonitoringService.addResponse(expectedResponse); + + ServiceLevelObjectiveName name = + ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]"); + + client.deleteServiceLevelObjective(name); + + List actualRequests = mockServiceMonitoringService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteServiceLevelObjectiveRequest actualRequest = + (DeleteServiceLevelObjectiveRequest) actualRequests.get(0); + + Assert.assertEquals(name, ServiceLevelObjectiveName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteServiceLevelObjectiveExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockServiceMonitoringService.addException(exception); + + try { + ServiceLevelObjectiveName name = + ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]"); + + client.deleteServiceLevelObjective(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java index 425aaf94..47768a8d 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java @@ -54,6 +54,7 @@ public class UptimeCheckServiceClientTest { private static MockGroupService mockGroupService; private static MockMetricService mockMetricService; private static MockNotificationChannelService mockNotificationChannelService; + private static MockServiceMonitoringService mockServiceMonitoringService; private static MockUptimeCheckService mockUptimeCheckService; private static MockServiceHelper serviceHelper; private UptimeCheckServiceClient client; @@ -65,6 +66,7 @@ public static void startStaticServer() { mockGroupService = new MockGroupService(); mockMetricService = new MockMetricService(); mockNotificationChannelService = new MockNotificationChannelService(); + mockServiceMonitoringService = new MockServiceMonitoringService(); mockUptimeCheckService = new MockUptimeCheckService(); serviceHelper = new MockServiceHelper( @@ -74,6 +76,7 @@ public static void startStaticServer() { mockGroupService, mockMetricService, mockNotificationChannelService, + mockServiceMonitoringService, mockUptimeCheckService)); serviceHelper.start(); } 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 18707516..cc517fc9 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 @@ -13,7 +13,6 @@ * 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; diff --git a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GroupServiceGrpc.java b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GroupServiceGrpc.java index 1983f1b0..9bc78c89 100644 --- a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GroupServiceGrpc.java +++ b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GroupServiceGrpc.java @@ -13,7 +13,6 @@ * 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; diff --git a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricServiceGrpc.java b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricServiceGrpc.java index ad1d41c6..ea33cd90 100644 --- a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricServiceGrpc.java +++ b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricServiceGrpc.java @@ -13,7 +13,6 @@ * 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; diff --git a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelServiceGrpc.java b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelServiceGrpc.java index adb16cd2..fb64bff1 100644 --- a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelServiceGrpc.java +++ b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelServiceGrpc.java @@ -13,7 +13,6 @@ * 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; diff --git a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringServiceGrpc.java b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringServiceGrpc.java new file mode 100644 index 00000000..e97f668b --- /dev/null +++ b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringServiceGrpc.java @@ -0,0 +1,1549 @@ +/* + * Copyright 2019 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; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for
+ * managing and querying aspects of a workspace's services. These include the
+ * `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy
+ * of categorized Health Metrics.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/monitoring/v3/service_service.proto") +public final class ServiceMonitoringServiceGrpc { + + private ServiceMonitoringServiceGrpc() {} + + public static final String SERVICE_NAME = "google.monitoring.v3.ServiceMonitoringService"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateServiceMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.monitoring.v3.CreateServiceRequest, com.google.monitoring.v3.Service> + METHOD_CREATE_SERVICE = getCreateServiceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.v3.CreateServiceRequest, com.google.monitoring.v3.Service> + getCreateServiceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.monitoring.v3.CreateServiceRequest, com.google.monitoring.v3.Service> + getCreateServiceMethod() { + return getCreateServiceMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.monitoring.v3.CreateServiceRequest, com.google.monitoring.v3.Service> + getCreateServiceMethodHelper() { + io.grpc.MethodDescriptor< + com.google.monitoring.v3.CreateServiceRequest, com.google.monitoring.v3.Service> + getCreateServiceMethod; + if ((getCreateServiceMethod = ServiceMonitoringServiceGrpc.getCreateServiceMethod) == null) { + synchronized (ServiceMonitoringServiceGrpc.class) { + if ((getCreateServiceMethod = ServiceMonitoringServiceGrpc.getCreateServiceMethod) + == null) { + ServiceMonitoringServiceGrpc.getCreateServiceMethod = + getCreateServiceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.monitoring.v3.ServiceMonitoringService", "CreateService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.CreateServiceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.Service.getDefaultInstance())) + .setSchemaDescriptor( + new ServiceMonitoringServiceMethodDescriptorSupplier("CreateService")) + .build(); + } + } + } + return getCreateServiceMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetServiceMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.monitoring.v3.GetServiceRequest, com.google.monitoring.v3.Service> + METHOD_GET_SERVICE = getGetServiceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.v3.GetServiceRequest, com.google.monitoring.v3.Service> + getGetServiceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.monitoring.v3.GetServiceRequest, com.google.monitoring.v3.Service> + getGetServiceMethod() { + return getGetServiceMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.monitoring.v3.GetServiceRequest, com.google.monitoring.v3.Service> + getGetServiceMethodHelper() { + io.grpc.MethodDescriptor< + com.google.monitoring.v3.GetServiceRequest, com.google.monitoring.v3.Service> + getGetServiceMethod; + if ((getGetServiceMethod = ServiceMonitoringServiceGrpc.getGetServiceMethod) == null) { + synchronized (ServiceMonitoringServiceGrpc.class) { + if ((getGetServiceMethod = ServiceMonitoringServiceGrpc.getGetServiceMethod) == null) { + ServiceMonitoringServiceGrpc.getGetServiceMethod = + getGetServiceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.monitoring.v3.ServiceMonitoringService", "GetService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.GetServiceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.Service.getDefaultInstance())) + .setSchemaDescriptor( + new ServiceMonitoringServiceMethodDescriptorSupplier("GetService")) + .build(); + } + } + } + return getGetServiceMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListServicesMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.monitoring.v3.ListServicesRequest, + com.google.monitoring.v3.ListServicesResponse> + METHOD_LIST_SERVICES = getListServicesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.v3.ListServicesRequest, + com.google.monitoring.v3.ListServicesResponse> + getListServicesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.monitoring.v3.ListServicesRequest, + com.google.monitoring.v3.ListServicesResponse> + getListServicesMethod() { + return getListServicesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.monitoring.v3.ListServicesRequest, + com.google.monitoring.v3.ListServicesResponse> + getListServicesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.monitoring.v3.ListServicesRequest, + com.google.monitoring.v3.ListServicesResponse> + getListServicesMethod; + if ((getListServicesMethod = ServiceMonitoringServiceGrpc.getListServicesMethod) == null) { + synchronized (ServiceMonitoringServiceGrpc.class) { + if ((getListServicesMethod = ServiceMonitoringServiceGrpc.getListServicesMethod) == null) { + ServiceMonitoringServiceGrpc.getListServicesMethod = + getListServicesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.monitoring.v3.ServiceMonitoringService", "ListServices")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.ListServicesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.ListServicesResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ServiceMonitoringServiceMethodDescriptorSupplier("ListServices")) + .build(); + } + } + } + return getListServicesMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateServiceMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.monitoring.v3.UpdateServiceRequest, com.google.monitoring.v3.Service> + METHOD_UPDATE_SERVICE = getUpdateServiceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.v3.UpdateServiceRequest, com.google.monitoring.v3.Service> + getUpdateServiceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.monitoring.v3.UpdateServiceRequest, com.google.monitoring.v3.Service> + getUpdateServiceMethod() { + return getUpdateServiceMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.monitoring.v3.UpdateServiceRequest, com.google.monitoring.v3.Service> + getUpdateServiceMethodHelper() { + io.grpc.MethodDescriptor< + com.google.monitoring.v3.UpdateServiceRequest, com.google.monitoring.v3.Service> + getUpdateServiceMethod; + if ((getUpdateServiceMethod = ServiceMonitoringServiceGrpc.getUpdateServiceMethod) == null) { + synchronized (ServiceMonitoringServiceGrpc.class) { + if ((getUpdateServiceMethod = ServiceMonitoringServiceGrpc.getUpdateServiceMethod) + == null) { + ServiceMonitoringServiceGrpc.getUpdateServiceMethod = + getUpdateServiceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.monitoring.v3.ServiceMonitoringService", "UpdateService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.UpdateServiceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.Service.getDefaultInstance())) + .setSchemaDescriptor( + new ServiceMonitoringServiceMethodDescriptorSupplier("UpdateService")) + .build(); + } + } + } + return getUpdateServiceMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteServiceMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.monitoring.v3.DeleteServiceRequest, com.google.protobuf.Empty> + METHOD_DELETE_SERVICE = getDeleteServiceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.v3.DeleteServiceRequest, com.google.protobuf.Empty> + getDeleteServiceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.monitoring.v3.DeleteServiceRequest, com.google.protobuf.Empty> + getDeleteServiceMethod() { + return getDeleteServiceMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.monitoring.v3.DeleteServiceRequest, com.google.protobuf.Empty> + getDeleteServiceMethodHelper() { + io.grpc.MethodDescriptor< + com.google.monitoring.v3.DeleteServiceRequest, com.google.protobuf.Empty> + getDeleteServiceMethod; + if ((getDeleteServiceMethod = ServiceMonitoringServiceGrpc.getDeleteServiceMethod) == null) { + synchronized (ServiceMonitoringServiceGrpc.class) { + if ((getDeleteServiceMethod = ServiceMonitoringServiceGrpc.getDeleteServiceMethod) + == null) { + ServiceMonitoringServiceGrpc.getDeleteServiceMethod = + getDeleteServiceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.monitoring.v3.ServiceMonitoringService", "DeleteService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.DeleteServiceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ServiceMonitoringServiceMethodDescriptorSupplier("DeleteService")) + .build(); + } + } + } + return getDeleteServiceMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateServiceLevelObjectiveMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + METHOD_CREATE_SERVICE_LEVEL_OBJECTIVE = getCreateServiceLevelObjectiveMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getCreateServiceLevelObjectiveMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getCreateServiceLevelObjectiveMethod() { + return getCreateServiceLevelObjectiveMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getCreateServiceLevelObjectiveMethodHelper() { + io.grpc.MethodDescriptor< + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getCreateServiceLevelObjectiveMethod; + if ((getCreateServiceLevelObjectiveMethod = + ServiceMonitoringServiceGrpc.getCreateServiceLevelObjectiveMethod) + == null) { + synchronized (ServiceMonitoringServiceGrpc.class) { + if ((getCreateServiceLevelObjectiveMethod = + ServiceMonitoringServiceGrpc.getCreateServiceLevelObjectiveMethod) + == null) { + ServiceMonitoringServiceGrpc.getCreateServiceLevelObjectiveMethod = + getCreateServiceLevelObjectiveMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.monitoring.v3.ServiceMonitoringService", + "CreateServiceLevelObjective")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance())) + .setSchemaDescriptor( + new ServiceMonitoringServiceMethodDescriptorSupplier( + "CreateServiceLevelObjective")) + .build(); + } + } + } + return getCreateServiceLevelObjectiveMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetServiceLevelObjectiveMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.monitoring.v3.GetServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + METHOD_GET_SERVICE_LEVEL_OBJECTIVE = getGetServiceLevelObjectiveMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.v3.GetServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getGetServiceLevelObjectiveMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.monitoring.v3.GetServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getGetServiceLevelObjectiveMethod() { + return getGetServiceLevelObjectiveMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.monitoring.v3.GetServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getGetServiceLevelObjectiveMethodHelper() { + io.grpc.MethodDescriptor< + com.google.monitoring.v3.GetServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getGetServiceLevelObjectiveMethod; + if ((getGetServiceLevelObjectiveMethod = + ServiceMonitoringServiceGrpc.getGetServiceLevelObjectiveMethod) + == null) { + synchronized (ServiceMonitoringServiceGrpc.class) { + if ((getGetServiceLevelObjectiveMethod = + ServiceMonitoringServiceGrpc.getGetServiceLevelObjectiveMethod) + == null) { + ServiceMonitoringServiceGrpc.getGetServiceLevelObjectiveMethod = + getGetServiceLevelObjectiveMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.monitoring.v3.ServiceMonitoringService", + "GetServiceLevelObjective")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.GetServiceLevelObjectiveRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance())) + .setSchemaDescriptor( + new ServiceMonitoringServiceMethodDescriptorSupplier( + "GetServiceLevelObjective")) + .build(); + } + } + } + return getGetServiceLevelObjectiveMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListServiceLevelObjectivesMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.monitoring.v3.ListServiceLevelObjectivesRequest, + com.google.monitoring.v3.ListServiceLevelObjectivesResponse> + METHOD_LIST_SERVICE_LEVEL_OBJECTIVES = getListServiceLevelObjectivesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.v3.ListServiceLevelObjectivesRequest, + com.google.monitoring.v3.ListServiceLevelObjectivesResponse> + getListServiceLevelObjectivesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.monitoring.v3.ListServiceLevelObjectivesRequest, + com.google.monitoring.v3.ListServiceLevelObjectivesResponse> + getListServiceLevelObjectivesMethod() { + return getListServiceLevelObjectivesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.monitoring.v3.ListServiceLevelObjectivesRequest, + com.google.monitoring.v3.ListServiceLevelObjectivesResponse> + getListServiceLevelObjectivesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.monitoring.v3.ListServiceLevelObjectivesRequest, + com.google.monitoring.v3.ListServiceLevelObjectivesResponse> + getListServiceLevelObjectivesMethod; + if ((getListServiceLevelObjectivesMethod = + ServiceMonitoringServiceGrpc.getListServiceLevelObjectivesMethod) + == null) { + synchronized (ServiceMonitoringServiceGrpc.class) { + if ((getListServiceLevelObjectivesMethod = + ServiceMonitoringServiceGrpc.getListServiceLevelObjectivesMethod) + == null) { + ServiceMonitoringServiceGrpc.getListServiceLevelObjectivesMethod = + getListServiceLevelObjectivesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.monitoring.v3.ServiceMonitoringService", + "ListServiceLevelObjectives")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.ListServiceLevelObjectivesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.ListServiceLevelObjectivesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ServiceMonitoringServiceMethodDescriptorSupplier( + "ListServiceLevelObjectives")) + .build(); + } + } + } + return getListServiceLevelObjectivesMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateServiceLevelObjectiveMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + METHOD_UPDATE_SERVICE_LEVEL_OBJECTIVE = getUpdateServiceLevelObjectiveMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getUpdateServiceLevelObjectiveMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getUpdateServiceLevelObjectiveMethod() { + return getUpdateServiceLevelObjectiveMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getUpdateServiceLevelObjectiveMethodHelper() { + io.grpc.MethodDescriptor< + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective> + getUpdateServiceLevelObjectiveMethod; + if ((getUpdateServiceLevelObjectiveMethod = + ServiceMonitoringServiceGrpc.getUpdateServiceLevelObjectiveMethod) + == null) { + synchronized (ServiceMonitoringServiceGrpc.class) { + if ((getUpdateServiceLevelObjectiveMethod = + ServiceMonitoringServiceGrpc.getUpdateServiceLevelObjectiveMethod) + == null) { + ServiceMonitoringServiceGrpc.getUpdateServiceLevelObjectiveMethod = + getUpdateServiceLevelObjectiveMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.monitoring.v3.ServiceMonitoringService", + "UpdateServiceLevelObjective")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance())) + .setSchemaDescriptor( + new ServiceMonitoringServiceMethodDescriptorSupplier( + "UpdateServiceLevelObjective")) + .build(); + } + } + } + return getUpdateServiceLevelObjectiveMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteServiceLevelObjectiveMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest, com.google.protobuf.Empty> + METHOD_DELETE_SERVICE_LEVEL_OBJECTIVE = getDeleteServiceLevelObjectiveMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest, com.google.protobuf.Empty> + getDeleteServiceLevelObjectiveMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest, com.google.protobuf.Empty> + getDeleteServiceLevelObjectiveMethod() { + return getDeleteServiceLevelObjectiveMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest, com.google.protobuf.Empty> + getDeleteServiceLevelObjectiveMethodHelper() { + io.grpc.MethodDescriptor< + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest, com.google.protobuf.Empty> + getDeleteServiceLevelObjectiveMethod; + if ((getDeleteServiceLevelObjectiveMethod = + ServiceMonitoringServiceGrpc.getDeleteServiceLevelObjectiveMethod) + == null) { + synchronized (ServiceMonitoringServiceGrpc.class) { + if ((getDeleteServiceLevelObjectiveMethod = + ServiceMonitoringServiceGrpc.getDeleteServiceLevelObjectiveMethod) + == null) { + ServiceMonitoringServiceGrpc.getDeleteServiceLevelObjectiveMethod = + getDeleteServiceLevelObjectiveMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.monitoring.v3.ServiceMonitoringService", + "DeleteServiceLevelObjective")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ServiceMonitoringServiceMethodDescriptorSupplier( + "DeleteServiceLevelObjective")) + .build(); + } + } + } + return getDeleteServiceLevelObjectiveMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ServiceMonitoringServiceStub newStub(io.grpc.Channel channel) { + return new ServiceMonitoringServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ServiceMonitoringServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new ServiceMonitoringServiceBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ServiceMonitoringServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new ServiceMonitoringServiceFutureStub(channel); + } + + /** + * + * + *
+   * The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for
+   * managing and querying aspects of a workspace's services. These include the
+   * `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy
+   * of categorized Health Metrics.
+   * 
+ */ + public abstract static class ServiceMonitoringServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Create a `Service`.
+     * 
+ */ + public void createService( + com.google.monitoring.v3.CreateServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateServiceMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Get the named `Service`.
+     * 
+ */ + public void getService( + com.google.monitoring.v3.GetServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetServiceMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * List `Service`s for this workspace.
+     * 
+ */ + public void listServices( + com.google.monitoring.v3.ListServicesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListServicesMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Update this `Service`.
+     * 
+ */ + public void updateService( + com.google.monitoring.v3.UpdateServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateServiceMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Soft delete this `Service`.
+     * 
+ */ + public void deleteService( + com.google.monitoring.v3.DeleteServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteServiceMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Create a `ServiceLevelObjective` for the given `Service`.
+     * 
+ */ + public void createServiceLevelObjective( + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateServiceLevelObjectiveMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Get a `ServiceLevelObjective` by name.
+     * 
+ */ + public void getServiceLevelObjective( + com.google.monitoring.v3.GetServiceLevelObjectiveRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetServiceLevelObjectiveMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * List the `ServiceLevelObjective`s for the given `Service`.
+     * 
+ */ + public void listServiceLevelObjectives( + com.google.monitoring.v3.ListServiceLevelObjectivesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListServiceLevelObjectivesMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Update the given `ServiceLevelObjective`.
+     * 
+ */ + public void updateServiceLevelObjective( + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateServiceLevelObjectiveMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Delete the given `ServiceLevelObjective`.
+     * 
+ */ + public void deleteServiceLevelObjective( + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteServiceLevelObjectiveMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateServiceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.v3.CreateServiceRequest, + com.google.monitoring.v3.Service>(this, METHODID_CREATE_SERVICE))) + .addMethod( + getGetServiceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.v3.GetServiceRequest, com.google.monitoring.v3.Service>( + this, METHODID_GET_SERVICE))) + .addMethod( + getListServicesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.v3.ListServicesRequest, + com.google.monitoring.v3.ListServicesResponse>(this, METHODID_LIST_SERVICES))) + .addMethod( + getUpdateServiceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.v3.UpdateServiceRequest, + com.google.monitoring.v3.Service>(this, METHODID_UPDATE_SERVICE))) + .addMethod( + getDeleteServiceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.v3.DeleteServiceRequest, com.google.protobuf.Empty>( + this, METHODID_DELETE_SERVICE))) + .addMethod( + getCreateServiceLevelObjectiveMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective>( + this, METHODID_CREATE_SERVICE_LEVEL_OBJECTIVE))) + .addMethod( + getGetServiceLevelObjectiveMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.v3.GetServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective>( + this, METHODID_GET_SERVICE_LEVEL_OBJECTIVE))) + .addMethod( + getListServiceLevelObjectivesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.v3.ListServiceLevelObjectivesRequest, + com.google.monitoring.v3.ListServiceLevelObjectivesResponse>( + this, METHODID_LIST_SERVICE_LEVEL_OBJECTIVES))) + .addMethod( + getUpdateServiceLevelObjectiveMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest, + com.google.monitoring.v3.ServiceLevelObjective>( + this, METHODID_UPDATE_SERVICE_LEVEL_OBJECTIVE))) + .addMethod( + getDeleteServiceLevelObjectiveMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_SERVICE_LEVEL_OBJECTIVE))) + .build(); + } + } + + /** + * + * + *
+   * The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for
+   * managing and querying aspects of a workspace's services. These include the
+   * `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy
+   * of categorized Health Metrics.
+   * 
+ */ + public static final class ServiceMonitoringServiceStub + extends io.grpc.stub.AbstractStub { + private ServiceMonitoringServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private ServiceMonitoringServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceMonitoringServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceMonitoringServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a `Service`.
+     * 
+ */ + public void createService( + com.google.monitoring.v3.CreateServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateServiceMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get the named `Service`.
+     * 
+ */ + public void getService( + com.google.monitoring.v3.GetServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetServiceMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List `Service`s for this workspace.
+     * 
+ */ + public void listServices( + com.google.monitoring.v3.ListServicesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListServicesMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update this `Service`.
+     * 
+ */ + public void updateService( + com.google.monitoring.v3.UpdateServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateServiceMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Soft delete this `Service`.
+     * 
+ */ + public void deleteService( + com.google.monitoring.v3.DeleteServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteServiceMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Create a `ServiceLevelObjective` for the given `Service`.
+     * 
+ */ + public void createServiceLevelObjective( + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateServiceLevelObjectiveMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get a `ServiceLevelObjective` by name.
+     * 
+ */ + public void getServiceLevelObjective( + com.google.monitoring.v3.GetServiceLevelObjectiveRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetServiceLevelObjectiveMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List the `ServiceLevelObjective`s for the given `Service`.
+     * 
+ */ + public void listServiceLevelObjectives( + com.google.monitoring.v3.ListServiceLevelObjectivesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListServiceLevelObjectivesMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update the given `ServiceLevelObjective`.
+     * 
+ */ + public void updateServiceLevelObjective( + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateServiceLevelObjectiveMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete the given `ServiceLevelObjective`.
+     * 
+ */ + public void deleteServiceLevelObjective( + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteServiceLevelObjectiveMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for
+   * managing and querying aspects of a workspace's services. These include the
+   * `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy
+   * of categorized Health Metrics.
+   * 
+ */ + public static final class ServiceMonitoringServiceBlockingStub + extends io.grpc.stub.AbstractStub { + private ServiceMonitoringServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private ServiceMonitoringServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceMonitoringServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceMonitoringServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a `Service`.
+     * 
+ */ + public com.google.monitoring.v3.Service createService( + com.google.monitoring.v3.CreateServiceRequest request) { + return blockingUnaryCall( + getChannel(), getCreateServiceMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get the named `Service`.
+     * 
+ */ + public com.google.monitoring.v3.Service getService( + com.google.monitoring.v3.GetServiceRequest request) { + return blockingUnaryCall( + getChannel(), getGetServiceMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * List `Service`s for this workspace.
+     * 
+ */ + public com.google.monitoring.v3.ListServicesResponse listServices( + com.google.monitoring.v3.ListServicesRequest request) { + return blockingUnaryCall( + getChannel(), getListServicesMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update this `Service`.
+     * 
+ */ + public com.google.monitoring.v3.Service updateService( + com.google.monitoring.v3.UpdateServiceRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateServiceMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Soft delete this `Service`.
+     * 
+ */ + public com.google.protobuf.Empty deleteService( + com.google.monitoring.v3.DeleteServiceRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteServiceMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Create a `ServiceLevelObjective` for the given `Service`.
+     * 
+ */ + public com.google.monitoring.v3.ServiceLevelObjective createServiceLevelObjective( + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest request) { + return blockingUnaryCall( + getChannel(), getCreateServiceLevelObjectiveMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get a `ServiceLevelObjective` by name.
+     * 
+ */ + public com.google.monitoring.v3.ServiceLevelObjective getServiceLevelObjective( + com.google.monitoring.v3.GetServiceLevelObjectiveRequest request) { + return blockingUnaryCall( + getChannel(), getGetServiceLevelObjectiveMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * List the `ServiceLevelObjective`s for the given `Service`.
+     * 
+ */ + public com.google.monitoring.v3.ListServiceLevelObjectivesResponse listServiceLevelObjectives( + com.google.monitoring.v3.ListServiceLevelObjectivesRequest request) { + return blockingUnaryCall( + getChannel(), getListServiceLevelObjectivesMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update the given `ServiceLevelObjective`.
+     * 
+ */ + public com.google.monitoring.v3.ServiceLevelObjective updateServiceLevelObjective( + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateServiceLevelObjectiveMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete the given `ServiceLevelObjective`.
+     * 
+ */ + public com.google.protobuf.Empty deleteServiceLevelObjective( + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteServiceLevelObjectiveMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for
+   * managing and querying aspects of a workspace's services. These include the
+   * `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy
+   * of categorized Health Metrics.
+   * 
+ */ + public static final class ServiceMonitoringServiceFutureStub + extends io.grpc.stub.AbstractStub { + private ServiceMonitoringServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private ServiceMonitoringServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceMonitoringServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceMonitoringServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a `Service`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createService(com.google.monitoring.v3.CreateServiceRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateServiceMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get the named `Service`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getService(com.google.monitoring.v3.GetServiceRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetServiceMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * List `Service`s for this workspace.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.monitoring.v3.ListServicesResponse> + listServices(com.google.monitoring.v3.ListServicesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListServicesMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update this `Service`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateService(com.google.monitoring.v3.UpdateServiceRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateServiceMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Soft delete this `Service`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteService(com.google.monitoring.v3.DeleteServiceRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteServiceMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Create a `ServiceLevelObjective` for the given `Service`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.monitoring.v3.ServiceLevelObjective> + createServiceLevelObjective( + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateServiceLevelObjectiveMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Get a `ServiceLevelObjective` by name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.monitoring.v3.ServiceLevelObjective> + getServiceLevelObjective(com.google.monitoring.v3.GetServiceLevelObjectiveRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetServiceLevelObjectiveMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * List the `ServiceLevelObjective`s for the given `Service`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.monitoring.v3.ListServiceLevelObjectivesResponse> + listServiceLevelObjectives( + com.google.monitoring.v3.ListServiceLevelObjectivesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListServiceLevelObjectivesMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Update the given `ServiceLevelObjective`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.monitoring.v3.ServiceLevelObjective> + updateServiceLevelObjective( + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateServiceLevelObjectiveMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Delete the given `ServiceLevelObjective`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteServiceLevelObjective( + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteServiceLevelObjectiveMethodHelper(), getCallOptions()), + request); + } + } + + private static final int METHODID_CREATE_SERVICE = 0; + private static final int METHODID_GET_SERVICE = 1; + private static final int METHODID_LIST_SERVICES = 2; + private static final int METHODID_UPDATE_SERVICE = 3; + private static final int METHODID_DELETE_SERVICE = 4; + private static final int METHODID_CREATE_SERVICE_LEVEL_OBJECTIVE = 5; + private static final int METHODID_GET_SERVICE_LEVEL_OBJECTIVE = 6; + private static final int METHODID_LIST_SERVICE_LEVEL_OBJECTIVES = 7; + private static final int METHODID_UPDATE_SERVICE_LEVEL_OBJECTIVE = 8; + private static final int METHODID_DELETE_SERVICE_LEVEL_OBJECTIVE = 9; + + 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 ServiceMonitoringServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ServiceMonitoringServiceImplBase 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_CREATE_SERVICE: + serviceImpl.createService( + (com.google.monitoring.v3.CreateServiceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SERVICE: + serviceImpl.getService( + (com.google.monitoring.v3.GetServiceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SERVICES: + serviceImpl.listServices( + (com.google.monitoring.v3.ListServicesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_SERVICE: + serviceImpl.updateService( + (com.google.monitoring.v3.UpdateServiceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SERVICE: + serviceImpl.deleteService( + (com.google.monitoring.v3.DeleteServiceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SERVICE_LEVEL_OBJECTIVE: + serviceImpl.createServiceLevelObjective( + (com.google.monitoring.v3.CreateServiceLevelObjectiveRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SERVICE_LEVEL_OBJECTIVE: + serviceImpl.getServiceLevelObjective( + (com.google.monitoring.v3.GetServiceLevelObjectiveRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SERVICE_LEVEL_OBJECTIVES: + serviceImpl.listServiceLevelObjectives( + (com.google.monitoring.v3.ListServiceLevelObjectivesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.monitoring.v3.ListServiceLevelObjectivesResponse>) + responseObserver); + break; + case METHODID_UPDATE_SERVICE_LEVEL_OBJECTIVE: + serviceImpl.updateServiceLevelObjective( + (com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SERVICE_LEVEL_OBJECTIVE: + serviceImpl.deleteServiceLevelObjective( + (com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest) 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 ServiceMonitoringServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ServiceMonitoringServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ServiceMonitoringService"); + } + } + + private static final class ServiceMonitoringServiceFileDescriptorSupplier + extends ServiceMonitoringServiceBaseDescriptorSupplier { + ServiceMonitoringServiceFileDescriptorSupplier() {} + } + + private static final class ServiceMonitoringServiceMethodDescriptorSupplier + extends ServiceMonitoringServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ServiceMonitoringServiceMethodDescriptorSupplier(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 (ServiceMonitoringServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ServiceMonitoringServiceFileDescriptorSupplier()) + .addMethod(getCreateServiceMethodHelper()) + .addMethod(getGetServiceMethodHelper()) + .addMethod(getListServicesMethodHelper()) + .addMethod(getUpdateServiceMethodHelper()) + .addMethod(getDeleteServiceMethodHelper()) + .addMethod(getCreateServiceLevelObjectiveMethodHelper()) + .addMethod(getGetServiceLevelObjectiveMethodHelper()) + .addMethod(getListServiceLevelObjectivesMethodHelper()) + .addMethod(getUpdateServiceLevelObjectiveMethodHelper()) + .addMethod(getDeleteServiceLevelObjectiveMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckServiceGrpc.java b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckServiceGrpc.java index bc44ede8..053cb929 100644 --- a/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckServiceGrpc.java +++ b/grpc-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckServiceGrpc.java @@ -13,7 +13,6 @@ * 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; 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 358514af..7e5c1a49 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 @@ -2352,7 +2352,7 @@ public interface MetricThresholdOrBuilder * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -2370,7 +2370,7 @@ public interface MetricThresholdOrBuilder * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -2392,8 +2392,7 @@ public interface MetricThresholdOrBuilder * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -2412,8 +2411,7 @@ public interface MetricThresholdOrBuilder * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -2432,8 +2430,7 @@ public interface MetricThresholdOrBuilder * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -2452,8 +2449,7 @@ public interface MetricThresholdOrBuilder * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -2473,8 +2469,7 @@ public interface MetricThresholdOrBuilder * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -2940,7 +2935,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -2968,7 +2963,7 @@ public java.lang.String getFilter() { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -3002,8 +2997,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -3024,8 +3018,7 @@ public java.util.List getAggregationsList( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -3047,8 +3040,7 @@ public java.util.List getAggregationsList( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -3069,8 +3061,7 @@ public int getAggregationsCount() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -3091,8 +3082,7 @@ public com.google.monitoring.v3.Aggregation getAggregations(int index) { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4008,7 +3998,7 @@ public Builder mergeFrom( * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -4036,7 +4026,7 @@ public java.lang.String getFilter() { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -4064,7 +4054,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -4090,7 +4080,7 @@ public Builder setFilter(java.lang.String value) { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -4113,7 +4103,7 @@ public Builder clearFilter() { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -4161,8 +4151,7 @@ private void ensureAggregationsIsMutable() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4187,8 +4176,7 @@ public java.util.List getAggregationsList( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4213,8 +4201,7 @@ public int getAggregationsCount() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4239,8 +4226,7 @@ public com.google.monitoring.v3.Aggregation getAggregations(int index) { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4271,8 +4257,7 @@ public Builder setAggregations(int index, com.google.monitoring.v3.Aggregation v * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4301,8 +4286,7 @@ public Builder setAggregations( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4333,8 +4317,7 @@ public Builder addAggregations(com.google.monitoring.v3.Aggregation value) { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4365,8 +4348,7 @@ public Builder addAggregations(int index, com.google.monitoring.v3.Aggregation v * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4395,8 +4377,7 @@ public Builder addAggregations( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4425,8 +4406,7 @@ public Builder addAggregations( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4455,8 +4435,7 @@ public Builder addAllAggregations( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4484,8 +4463,7 @@ public Builder clearAggregations() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4513,8 +4491,7 @@ public Builder removeAggregations(int index) { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4535,8 +4512,7 @@ public com.google.monitoring.v3.Aggregation.Builder getAggregationsBuilder(int i * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4561,8 +4537,7 @@ public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(in * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4588,8 +4563,7 @@ public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(in * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4611,8 +4585,7 @@ public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -4634,8 +4607,7 @@ public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder(int i * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the one in the - * [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -6000,7 +5972,7 @@ public interface MetricAbsenceOrBuilder * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -6018,7 +5990,7 @@ public interface MetricAbsenceOrBuilder * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -6040,8 +6012,7 @@ public interface MetricAbsenceOrBuilder * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -6060,8 +6031,7 @@ public interface MetricAbsenceOrBuilder * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -6080,8 +6050,7 @@ public interface MetricAbsenceOrBuilder * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -6100,8 +6069,7 @@ public interface MetricAbsenceOrBuilder * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -6121,8 +6089,7 @@ public interface MetricAbsenceOrBuilder * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -6368,7 +6335,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -6396,7 +6363,7 @@ public java.lang.String getFilter() { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -6430,8 +6397,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -6452,8 +6418,7 @@ public java.util.List getAggregationsList( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -6475,8 +6440,7 @@ public java.util.List getAggregationsList( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -6497,8 +6461,7 @@ public int getAggregationsCount() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -6519,8 +6482,7 @@ public com.google.monitoring.v3.Aggregation getAggregations(int index) { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7091,7 +7053,7 @@ public Builder mergeFrom( * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -7119,7 +7081,7 @@ public java.lang.String getFilter() { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -7147,7 +7109,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -7173,7 +7135,7 @@ public Builder setFilter(java.lang.String value) { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -7196,7 +7158,7 @@ public Builder clearFilter() { * A [filter](/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 - * [`MetricService.ListTimeSeries` + * [`ListTimeSeries` * request](/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 @@ -7244,8 +7206,7 @@ private void ensureAggregationsIsMutable() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7270,8 +7231,7 @@ public java.util.List getAggregationsList( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7296,8 +7256,7 @@ public int getAggregationsCount() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7322,8 +7281,7 @@ public com.google.monitoring.v3.Aggregation getAggregations(int index) { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7354,8 +7312,7 @@ public Builder setAggregations(int index, com.google.monitoring.v3.Aggregation v * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7384,8 +7341,7 @@ public Builder setAggregations( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7416,8 +7372,7 @@ public Builder addAggregations(com.google.monitoring.v3.Aggregation value) { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7448,8 +7403,7 @@ public Builder addAggregations(int index, com.google.monitoring.v3.Aggregation v * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7478,8 +7432,7 @@ public Builder addAggregations( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7508,8 +7461,7 @@ public Builder addAggregations( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7538,8 +7490,7 @@ public Builder addAllAggregations( * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7567,8 +7518,7 @@ public Builder clearAggregations() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7596,8 +7546,7 @@ public Builder removeAggregations(int index) { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7618,8 +7567,7 @@ public com.google.monitoring.v3.Aggregation.Builder getAggregationsBuilder(int i * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7644,8 +7592,7 @@ public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(in * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7671,8 +7618,7 @@ public com.google.monitoring.v3.AggregationOrBuilder getAggregationsOrBuilder(in * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7694,8 +7640,7 @@ public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder() { * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. @@ -7717,8 +7662,7 @@ public com.google.monitoring.v3.Aggregation.Builder addAggregationsBuilder(int i * stream for each resource or when aggregating streams across all * members of a group of resrouces). Multiple aggregations * are applied in the order specified. - * This field is similar to the - * one in the [`MetricService.ListTimeSeries` + * This field is similar to the one in the [`ListTimeSeries` * request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It * is advisable to use the `ListTimeSeries` method when debugging this * field. diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/BasicSli.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/BasicSli.java new file mode 100644 index 00000000..04fc3d0c --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/BasicSli.java @@ -0,0 +1,3218 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * An SLI measuring performance on a well-known service type. Performance will
+ * be computed on the basis of pre-defined metrics. The type of the
+ * `service_resource` determines the metrics to use and the
+ * `service_resource.labels` and `metric_labels` are used to construct a
+ * monitoring filter to filter that metric down to just the data relevant to
+ * this service.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.BasicSli} + */ +public final class BasicSli extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.BasicSli) + BasicSliOrBuilder { + private static final long serialVersionUID = 0L; + // Use BasicSli.newBuilder() to construct. + private BasicSli(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BasicSli() { + method_ = com.google.protobuf.LazyStringArrayList.EMPTY; + location_ = com.google.protobuf.LazyStringArrayList.EMPTY; + version_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BasicSli( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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 18: + { + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.Builder subBuilder = null; + if (sliCriteriaCase_ == 2) { + subBuilder = + ((com.google.monitoring.v3.BasicSli.AvailabilityCriteria) sliCriteria_) + .toBuilder(); + } + sliCriteria_ = + input.readMessage( + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.v3.BasicSli.AvailabilityCriteria) sliCriteria_); + sliCriteria_ = subBuilder.buildPartial(); + } + sliCriteriaCase_ = 2; + break; + } + case 26: + { + com.google.monitoring.v3.BasicSli.LatencyCriteria.Builder subBuilder = null; + if (sliCriteriaCase_ == 3) { + subBuilder = + ((com.google.monitoring.v3.BasicSli.LatencyCriteria) sliCriteria_).toBuilder(); + } + sliCriteria_ = + input.readMessage( + com.google.monitoring.v3.BasicSli.LatencyCriteria.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.v3.BasicSli.LatencyCriteria) sliCriteria_); + sliCriteria_ = subBuilder.buildPartial(); + } + sliCriteriaCase_ = 3; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + method_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + method_.add(s); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + location_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + location_.add(s); + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + version_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + version_.add(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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + method_ = method_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + location_ = location_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + version_ = version_.getUnmodifiableView(); + } + 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_BasicSli_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.BasicSli.class, + com.google.monitoring.v3.BasicSli.Builder.class); + } + + public interface AvailabilityCriteriaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.BasicSli.AvailabilityCriteria) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Future parameters for the availability SLI.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.BasicSli.AvailabilityCriteria} + */ + public static final class AvailabilityCriteria extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.BasicSli.AvailabilityCriteria) + AvailabilityCriteriaOrBuilder { + private static final long serialVersionUID = 0L; + // Use AvailabilityCriteria.newBuilder() to construct. + private AvailabilityCriteria(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AvailabilityCriteria() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AvailabilityCriteria( + 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; + 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_BasicSli_AvailabilityCriteria_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_AvailabilityCriteria_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.class, + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.BasicSli.AvailabilityCriteria)) { + return super.equals(obj); + } + com.google.monitoring.v3.BasicSli.AvailabilityCriteria other = + (com.google.monitoring.v3.BasicSli.AvailabilityCriteria) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.BasicSli.AvailabilityCriteria parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.BasicSli.AvailabilityCriteria 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.BasicSli.AvailabilityCriteria parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.BasicSli.AvailabilityCriteria 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.BasicSli.AvailabilityCriteria parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.BasicSli.AvailabilityCriteria parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.BasicSli.AvailabilityCriteria parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.BasicSli.AvailabilityCriteria 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.BasicSli.AvailabilityCriteria parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.BasicSli.AvailabilityCriteria 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.BasicSli.AvailabilityCriteria parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.BasicSli.AvailabilityCriteria 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.BasicSli.AvailabilityCriteria 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; + } + /** + * + * + *
+     * Future parameters for the availability SLI.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.BasicSli.AvailabilityCriteria} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.BasicSli.AvailabilityCriteria) + com.google.monitoring.v3.BasicSli.AvailabilityCriteriaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_AvailabilityCriteria_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_AvailabilityCriteria_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.class, + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.Builder.class); + } + + // Construct using com.google.monitoring.v3.BasicSli.AvailabilityCriteria.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_AvailabilityCriteria_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.BasicSli.AvailabilityCriteria getDefaultInstanceForType() { + return com.google.monitoring.v3.BasicSli.AvailabilityCriteria.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.BasicSli.AvailabilityCriteria build() { + com.google.monitoring.v3.BasicSli.AvailabilityCriteria result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.BasicSli.AvailabilityCriteria buildPartial() { + com.google.monitoring.v3.BasicSli.AvailabilityCriteria result = + new com.google.monitoring.v3.BasicSli.AvailabilityCriteria(this); + 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.BasicSli.AvailabilityCriteria) { + return mergeFrom((com.google.monitoring.v3.BasicSli.AvailabilityCriteria) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.BasicSli.AvailabilityCriteria other) { + if (other == com.google.monitoring.v3.BasicSli.AvailabilityCriteria.getDefaultInstance()) + return this; + 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.BasicSli.AvailabilityCriteria parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.BasicSli.AvailabilityCriteria) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.BasicSli.AvailabilityCriteria) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.BasicSli.AvailabilityCriteria) + private static final com.google.monitoring.v3.BasicSli.AvailabilityCriteria DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.BasicSli.AvailabilityCriteria(); + } + + public static com.google.monitoring.v3.BasicSli.AvailabilityCriteria getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AvailabilityCriteria parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AvailabilityCriteria(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.BasicSli.AvailabilityCriteria getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface LatencyCriteriaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.BasicSli.LatencyCriteria) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return in no more than `threshold`.
+     * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + boolean hasThreshold(); + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return in no more than `threshold`.
+     * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + com.google.protobuf.Duration getThreshold(); + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return in no more than `threshold`.
+     * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + com.google.protobuf.DurationOrBuilder getThresholdOrBuilder(); + } + /** + * + * + *
+   * Parameters for a latency threshold SLI.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.BasicSli.LatencyCriteria} + */ + public static final class LatencyCriteria extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.BasicSli.LatencyCriteria) + LatencyCriteriaOrBuilder { + private static final long serialVersionUID = 0L; + // Use LatencyCriteria.newBuilder() to construct. + private LatencyCriteria(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LatencyCriteria() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LatencyCriteria( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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 26: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (threshold_ != null) { + subBuilder = threshold_.toBuilder(); + } + threshold_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(threshold_); + threshold_ = 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.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_LatencyCriteria_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_LatencyCriteria_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.BasicSli.LatencyCriteria.class, + com.google.monitoring.v3.BasicSli.LatencyCriteria.Builder.class); + } + + public static final int THRESHOLD_FIELD_NUMBER = 3; + private com.google.protobuf.Duration threshold_; + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return in no more than `threshold`.
+     * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + public boolean hasThreshold() { + return threshold_ != null; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return in no more than `threshold`.
+     * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + public com.google.protobuf.Duration getThreshold() { + return threshold_ == null ? com.google.protobuf.Duration.getDefaultInstance() : threshold_; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return in no more than `threshold`.
+     * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + public com.google.protobuf.DurationOrBuilder getThresholdOrBuilder() { + return getThreshold(); + } + + 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 (threshold_ != null) { + output.writeMessage(3, getThreshold()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (threshold_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getThreshold()); + } + 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.BasicSli.LatencyCriteria)) { + return super.equals(obj); + } + com.google.monitoring.v3.BasicSli.LatencyCriteria other = + (com.google.monitoring.v3.BasicSli.LatencyCriteria) obj; + + if (hasThreshold() != other.hasThreshold()) return false; + if (hasThreshold()) { + if (!getThreshold().equals(other.getThreshold())) 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(); + if (hasThreshold()) { + hash = (37 * hash) + THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getThreshold().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.BasicSli.LatencyCriteria parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.BasicSli.LatencyCriteria 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.BasicSli.LatencyCriteria parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.BasicSli.LatencyCriteria 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.BasicSli.LatencyCriteria parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.BasicSli.LatencyCriteria parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.BasicSli.LatencyCriteria parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.BasicSli.LatencyCriteria 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.BasicSli.LatencyCriteria parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.BasicSli.LatencyCriteria 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.BasicSli.LatencyCriteria parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.BasicSli.LatencyCriteria 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.BasicSli.LatencyCriteria 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; + } + /** + * + * + *
+     * Parameters for a latency threshold SLI.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.BasicSli.LatencyCriteria} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.BasicSli.LatencyCriteria) + com.google.monitoring.v3.BasicSli.LatencyCriteriaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_LatencyCriteria_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_LatencyCriteria_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.BasicSli.LatencyCriteria.class, + com.google.monitoring.v3.BasicSli.LatencyCriteria.Builder.class); + } + + // Construct using com.google.monitoring.v3.BasicSli.LatencyCriteria.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(); + if (thresholdBuilder_ == null) { + threshold_ = null; + } else { + threshold_ = null; + thresholdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_LatencyCriteria_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.BasicSli.LatencyCriteria getDefaultInstanceForType() { + return com.google.monitoring.v3.BasicSli.LatencyCriteria.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.BasicSli.LatencyCriteria build() { + com.google.monitoring.v3.BasicSli.LatencyCriteria result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.BasicSli.LatencyCriteria buildPartial() { + com.google.monitoring.v3.BasicSli.LatencyCriteria result = + new com.google.monitoring.v3.BasicSli.LatencyCriteria(this); + if (thresholdBuilder_ == null) { + result.threshold_ = threshold_; + } else { + result.threshold_ = thresholdBuilder_.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.BasicSli.LatencyCriteria) { + return mergeFrom((com.google.monitoring.v3.BasicSli.LatencyCriteria) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.BasicSli.LatencyCriteria other) { + if (other == com.google.monitoring.v3.BasicSli.LatencyCriteria.getDefaultInstance()) + return this; + if (other.hasThreshold()) { + mergeThreshold(other.getThreshold()); + } + 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.BasicSli.LatencyCriteria parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.BasicSli.LatencyCriteria) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Duration threshold_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + thresholdBuilder_; + /** + * + * + *
+       * Good service is defined to be the count of requests made to this service
+       * that return in no more than `threshold`.
+       * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + public boolean hasThreshold() { + return thresholdBuilder_ != null || threshold_ != null; + } + /** + * + * + *
+       * Good service is defined to be the count of requests made to this service
+       * that return in no more than `threshold`.
+       * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + public com.google.protobuf.Duration getThreshold() { + if (thresholdBuilder_ == null) { + return threshold_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : threshold_; + } else { + return thresholdBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Good service is defined to be the count of requests made to this service
+       * that return in no more than `threshold`.
+       * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + public Builder setThreshold(com.google.protobuf.Duration value) { + if (thresholdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + threshold_ = value; + onChanged(); + } else { + thresholdBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Good service is defined to be the count of requests made to this service
+       * that return in no more than `threshold`.
+       * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + public Builder setThreshold(com.google.protobuf.Duration.Builder builderForValue) { + if (thresholdBuilder_ == null) { + threshold_ = builderForValue.build(); + onChanged(); + } else { + thresholdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Good service is defined to be the count of requests made to this service
+       * that return in no more than `threshold`.
+       * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + public Builder mergeThreshold(com.google.protobuf.Duration value) { + if (thresholdBuilder_ == null) { + if (threshold_ != null) { + threshold_ = + com.google.protobuf.Duration.newBuilder(threshold_).mergeFrom(value).buildPartial(); + } else { + threshold_ = value; + } + onChanged(); + } else { + thresholdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Good service is defined to be the count of requests made to this service
+       * that return in no more than `threshold`.
+       * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + public Builder clearThreshold() { + if (thresholdBuilder_ == null) { + threshold_ = null; + onChanged(); + } else { + threshold_ = null; + thresholdBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Good service is defined to be the count of requests made to this service
+       * that return in no more than `threshold`.
+       * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + public com.google.protobuf.Duration.Builder getThresholdBuilder() { + + onChanged(); + return getThresholdFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Good service is defined to be the count of requests made to this service
+       * that return in no more than `threshold`.
+       * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + public com.google.protobuf.DurationOrBuilder getThresholdOrBuilder() { + if (thresholdBuilder_ != null) { + return thresholdBuilder_.getMessageOrBuilder(); + } else { + return threshold_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : threshold_; + } + } + /** + * + * + *
+       * Good service is defined to be the count of requests made to this service
+       * that return in no more than `threshold`.
+       * 
+ * + * .google.protobuf.Duration threshold = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getThresholdFieldBuilder() { + if (thresholdBuilder_ == null) { + thresholdBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getThreshold(), getParentForChildren(), isClean()); + threshold_ = null; + } + return thresholdBuilder_; + } + + @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.BasicSli.LatencyCriteria) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.BasicSli.LatencyCriteria) + private static final com.google.monitoring.v3.BasicSli.LatencyCriteria DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.BasicSli.LatencyCriteria(); + } + + public static com.google.monitoring.v3.BasicSli.LatencyCriteria getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LatencyCriteria parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LatencyCriteria(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.BasicSli.LatencyCriteria getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int sliCriteriaCase_ = 0; + private java.lang.Object sliCriteria_; + + public enum SliCriteriaCase implements com.google.protobuf.Internal.EnumLite { + AVAILABILITY(2), + LATENCY(3), + SLICRITERIA_NOT_SET(0); + private final int value; + + private SliCriteriaCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static SliCriteriaCase valueOf(int value) { + return forNumber(value); + } + + public static SliCriteriaCase forNumber(int value) { + switch (value) { + case 2: + return AVAILABILITY; + case 3: + return LATENCY; + case 0: + return SLICRITERIA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SliCriteriaCase getSliCriteriaCase() { + return SliCriteriaCase.forNumber(sliCriteriaCase_); + } + + public static final int METHOD_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList method_; + /** + * + * + *
+   * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+   * other methods will not be used to calculate performance for this SLI. If
+   * omitted, this SLI applies to all the Service's methods. For service types
+   * that don't support breaking down by method, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string method = 7; + */ + public com.google.protobuf.ProtocolStringList getMethodList() { + return method_; + } + /** + * + * + *
+   * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+   * other methods will not be used to calculate performance for this SLI. If
+   * omitted, this SLI applies to all the Service's methods. For service types
+   * that don't support breaking down by method, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string method = 7; + */ + public int getMethodCount() { + return method_.size(); + } + /** + * + * + *
+   * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+   * other methods will not be used to calculate performance for this SLI. If
+   * omitted, this SLI applies to all the Service's methods. For service types
+   * that don't support breaking down by method, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string method = 7; + */ + public java.lang.String getMethod(int index) { + return method_.get(index); + } + /** + * + * + *
+   * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+   * other methods will not be used to calculate performance for this SLI. If
+   * omitted, this SLI applies to all the Service's methods. For service types
+   * that don't support breaking down by method, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string method = 7; + */ + public com.google.protobuf.ByteString getMethodBytes(int index) { + return method_.getByteString(index); + } + + public static final int LOCATION_FIELD_NUMBER = 8; + private com.google.protobuf.LazyStringList location_; + /** + * + * + *
+   * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+   * from other locations will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all locations in which the Service has
+   * activity. For service types that don't support breaking down by location,
+   * setting this field will result in an error.
+   * 
+ * + * repeated string location = 8; + */ + public com.google.protobuf.ProtocolStringList getLocationList() { + return location_; + } + /** + * + * + *
+   * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+   * from other locations will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all locations in which the Service has
+   * activity. For service types that don't support breaking down by location,
+   * setting this field will result in an error.
+   * 
+ * + * repeated string location = 8; + */ + public int getLocationCount() { + return location_.size(); + } + /** + * + * + *
+   * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+   * from other locations will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all locations in which the Service has
+   * activity. For service types that don't support breaking down by location,
+   * setting this field will result in an error.
+   * 
+ * + * repeated string location = 8; + */ + public java.lang.String getLocation(int index) { + return location_.get(index); + } + /** + * + * + *
+   * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+   * from other locations will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all locations in which the Service has
+   * activity. For service types that don't support breaking down by location,
+   * setting this field will result in an error.
+   * 
+ * + * repeated string location = 8; + */ + public com.google.protobuf.ByteString getLocationBytes(int index) { + return location_.getByteString(index); + } + + public static final int VERSION_FIELD_NUMBER = 9; + private com.google.protobuf.LazyStringList version_; + /** + * + * + *
+   * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+   * from other API versions will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all API versions. For service types
+   * that don't support breaking down by version, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string version = 9; + */ + public com.google.protobuf.ProtocolStringList getVersionList() { + return version_; + } + /** + * + * + *
+   * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+   * from other API versions will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all API versions. For service types
+   * that don't support breaking down by version, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string version = 9; + */ + public int getVersionCount() { + return version_.size(); + } + /** + * + * + *
+   * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+   * from other API versions will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all API versions. For service types
+   * that don't support breaking down by version, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string version = 9; + */ + public java.lang.String getVersion(int index) { + return version_.get(index); + } + /** + * + * + *
+   * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+   * from other API versions will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all API versions. For service types
+   * that don't support breaking down by version, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string version = 9; + */ + public com.google.protobuf.ByteString getVersionBytes(int index) { + return version_.getByteString(index); + } + + public static final int AVAILABILITY_FIELD_NUMBER = 2; + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that return successfully.
+   * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + public boolean hasAvailability() { + return sliCriteriaCase_ == 2; + } + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that return successfully.
+   * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + public com.google.monitoring.v3.BasicSli.AvailabilityCriteria getAvailability() { + if (sliCriteriaCase_ == 2) { + return (com.google.monitoring.v3.BasicSli.AvailabilityCriteria) sliCriteria_; + } + return com.google.monitoring.v3.BasicSli.AvailabilityCriteria.getDefaultInstance(); + } + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that return successfully.
+   * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + public com.google.monitoring.v3.BasicSli.AvailabilityCriteriaOrBuilder + getAvailabilityOrBuilder() { + if (sliCriteriaCase_ == 2) { + return (com.google.monitoring.v3.BasicSli.AvailabilityCriteria) sliCriteria_; + } + return com.google.monitoring.v3.BasicSli.AvailabilityCriteria.getDefaultInstance(); + } + + public static final int LATENCY_FIELD_NUMBER = 3; + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that are fast enough with respect to `latency.threshold`.
+   * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + public boolean hasLatency() { + return sliCriteriaCase_ == 3; + } + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that are fast enough with respect to `latency.threshold`.
+   * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + public com.google.monitoring.v3.BasicSli.LatencyCriteria getLatency() { + if (sliCriteriaCase_ == 3) { + return (com.google.monitoring.v3.BasicSli.LatencyCriteria) sliCriteria_; + } + return com.google.monitoring.v3.BasicSli.LatencyCriteria.getDefaultInstance(); + } + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that are fast enough with respect to `latency.threshold`.
+   * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + public com.google.monitoring.v3.BasicSli.LatencyCriteriaOrBuilder getLatencyOrBuilder() { + if (sliCriteriaCase_ == 3) { + return (com.google.monitoring.v3.BasicSli.LatencyCriteria) sliCriteria_; + } + return com.google.monitoring.v3.BasicSli.LatencyCriteria.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sliCriteriaCase_ == 2) { + output.writeMessage(2, (com.google.monitoring.v3.BasicSli.AvailabilityCriteria) sliCriteria_); + } + if (sliCriteriaCase_ == 3) { + output.writeMessage(3, (com.google.monitoring.v3.BasicSli.LatencyCriteria) sliCriteria_); + } + for (int i = 0; i < method_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, method_.getRaw(i)); + } + for (int i = 0; i < location_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, location_.getRaw(i)); + } + for (int i = 0; i < version_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, version_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sliCriteriaCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.monitoring.v3.BasicSli.AvailabilityCriteria) sliCriteria_); + } + if (sliCriteriaCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.monitoring.v3.BasicSli.LatencyCriteria) sliCriteria_); + } + { + int dataSize = 0; + for (int i = 0; i < method_.size(); i++) { + dataSize += computeStringSizeNoTag(method_.getRaw(i)); + } + size += dataSize; + size += 1 * getMethodList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < location_.size(); i++) { + dataSize += computeStringSizeNoTag(location_.getRaw(i)); + } + size += dataSize; + size += 1 * getLocationList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < version_.size(); i++) { + dataSize += computeStringSizeNoTag(version_.getRaw(i)); + } + size += dataSize; + size += 1 * getVersionList().size(); + } + 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.BasicSli)) { + return super.equals(obj); + } + com.google.monitoring.v3.BasicSli other = (com.google.monitoring.v3.BasicSli) obj; + + if (!getMethodList().equals(other.getMethodList())) return false; + if (!getLocationList().equals(other.getLocationList())) return false; + if (!getVersionList().equals(other.getVersionList())) return false; + if (!getSliCriteriaCase().equals(other.getSliCriteriaCase())) return false; + switch (sliCriteriaCase_) { + case 2: + if (!getAvailability().equals(other.getAvailability())) return false; + break; + case 3: + if (!getLatency().equals(other.getLatency())) return false; + break; + case 0: + default: + } + 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(); + if (getMethodCount() > 0) { + hash = (37 * hash) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + getMethodList().hashCode(); + } + if (getLocationCount() > 0) { + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocationList().hashCode(); + } + if (getVersionCount() > 0) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersionList().hashCode(); + } + switch (sliCriteriaCase_) { + case 2: + hash = (37 * hash) + AVAILABILITY_FIELD_NUMBER; + hash = (53 * hash) + getAvailability().hashCode(); + break; + case 3: + hash = (37 * hash) + LATENCY_FIELD_NUMBER; + hash = (53 * hash) + getLatency().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.BasicSli parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.BasicSli 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.BasicSli parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.BasicSli 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.BasicSli parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.BasicSli parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.BasicSli parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.BasicSli 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.BasicSli parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.BasicSli 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.BasicSli parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.BasicSli 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.BasicSli 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; + } + /** + * + * + *
+   * An SLI measuring performance on a well-known service type. Performance will
+   * be computed on the basis of pre-defined metrics. The type of the
+   * `service_resource` determines the metrics to use and the
+   * `service_resource.labels` and `metric_labels` are used to construct a
+   * monitoring filter to filter that metric down to just the data relevant to
+   * this service.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.BasicSli} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.BasicSli) + com.google.monitoring.v3.BasicSliOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.BasicSli.class, + com.google.monitoring.v3.BasicSli.Builder.class); + } + + // Construct using com.google.monitoring.v3.BasicSli.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(); + method_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + location_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + version_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + sliCriteriaCase_ = 0; + sliCriteria_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_BasicSli_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.BasicSli getDefaultInstanceForType() { + return com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.BasicSli build() { + com.google.monitoring.v3.BasicSli result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.BasicSli buildPartial() { + com.google.monitoring.v3.BasicSli result = new com.google.monitoring.v3.BasicSli(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) != 0)) { + method_ = method_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.method_ = method_; + if (((bitField0_ & 0x00000002) != 0)) { + location_ = location_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.location_ = location_; + if (((bitField0_ & 0x00000004) != 0)) { + version_ = version_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.version_ = version_; + if (sliCriteriaCase_ == 2) { + if (availabilityBuilder_ == null) { + result.sliCriteria_ = sliCriteria_; + } else { + result.sliCriteria_ = availabilityBuilder_.build(); + } + } + if (sliCriteriaCase_ == 3) { + if (latencyBuilder_ == null) { + result.sliCriteria_ = sliCriteria_; + } else { + result.sliCriteria_ = latencyBuilder_.build(); + } + } + result.bitField0_ = to_bitField0_; + result.sliCriteriaCase_ = sliCriteriaCase_; + 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.BasicSli) { + return mergeFrom((com.google.monitoring.v3.BasicSli) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.BasicSli other) { + if (other == com.google.monitoring.v3.BasicSli.getDefaultInstance()) return this; + if (!other.method_.isEmpty()) { + if (method_.isEmpty()) { + method_ = other.method_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMethodIsMutable(); + method_.addAll(other.method_); + } + onChanged(); + } + if (!other.location_.isEmpty()) { + if (location_.isEmpty()) { + location_ = other.location_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLocationIsMutable(); + location_.addAll(other.location_); + } + onChanged(); + } + if (!other.version_.isEmpty()) { + if (version_.isEmpty()) { + version_ = other.version_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureVersionIsMutable(); + version_.addAll(other.version_); + } + onChanged(); + } + switch (other.getSliCriteriaCase()) { + case AVAILABILITY: + { + mergeAvailability(other.getAvailability()); + break; + } + case LATENCY: + { + mergeLatency(other.getLatency()); + break; + } + case SLICRITERIA_NOT_SET: + { + break; + } + } + 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.BasicSli parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.BasicSli) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sliCriteriaCase_ = 0; + private java.lang.Object sliCriteria_; + + public SliCriteriaCase getSliCriteriaCase() { + return SliCriteriaCase.forNumber(sliCriteriaCase_); + } + + public Builder clearSliCriteria() { + sliCriteriaCase_ = 0; + sliCriteria_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList method_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMethodIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + method_ = new com.google.protobuf.LazyStringArrayList(method_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+     * other methods will not be used to calculate performance for this SLI. If
+     * omitted, this SLI applies to all the Service's methods. For service types
+     * that don't support breaking down by method, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string method = 7; + */ + public com.google.protobuf.ProtocolStringList getMethodList() { + return method_.getUnmodifiableView(); + } + /** + * + * + *
+     * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+     * other methods will not be used to calculate performance for this SLI. If
+     * omitted, this SLI applies to all the Service's methods. For service types
+     * that don't support breaking down by method, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string method = 7; + */ + public int getMethodCount() { + return method_.size(); + } + /** + * + * + *
+     * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+     * other methods will not be used to calculate performance for this SLI. If
+     * omitted, this SLI applies to all the Service's methods. For service types
+     * that don't support breaking down by method, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string method = 7; + */ + public java.lang.String getMethod(int index) { + return method_.get(index); + } + /** + * + * + *
+     * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+     * other methods will not be used to calculate performance for this SLI. If
+     * omitted, this SLI applies to all the Service's methods. For service types
+     * that don't support breaking down by method, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string method = 7; + */ + public com.google.protobuf.ByteString getMethodBytes(int index) { + return method_.getByteString(index); + } + /** + * + * + *
+     * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+     * other methods will not be used to calculate performance for this SLI. If
+     * omitted, this SLI applies to all the Service's methods. For service types
+     * that don't support breaking down by method, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string method = 7; + */ + public Builder setMethod(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodIsMutable(); + method_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+     * other methods will not be used to calculate performance for this SLI. If
+     * omitted, this SLI applies to all the Service's methods. For service types
+     * that don't support breaking down by method, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string method = 7; + */ + public Builder addMethod(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodIsMutable(); + method_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+     * other methods will not be used to calculate performance for this SLI. If
+     * omitted, this SLI applies to all the Service's methods. For service types
+     * that don't support breaking down by method, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string method = 7; + */ + public Builder addAllMethod(java.lang.Iterable values) { + ensureMethodIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, method_); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+     * other methods will not be used to calculate performance for this SLI. If
+     * omitted, this SLI applies to all the Service's methods. For service types
+     * that don't support breaking down by method, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string method = 7; + */ + public Builder clearMethod() { + method_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+     * other methods will not be used to calculate performance for this SLI. If
+     * omitted, this SLI applies to all the Service's methods. For service types
+     * that don't support breaking down by method, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string method = 7; + */ + public Builder addMethodBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMethodIsMutable(); + method_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList location_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureLocationIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + location_ = new com.google.protobuf.LazyStringArrayList(location_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+     * from other locations will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all locations in which the Service has
+     * activity. For service types that don't support breaking down by location,
+     * setting this field will result in an error.
+     * 
+ * + * repeated string location = 8; + */ + public com.google.protobuf.ProtocolStringList getLocationList() { + return location_.getUnmodifiableView(); + } + /** + * + * + *
+     * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+     * from other locations will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all locations in which the Service has
+     * activity. For service types that don't support breaking down by location,
+     * setting this field will result in an error.
+     * 
+ * + * repeated string location = 8; + */ + public int getLocationCount() { + return location_.size(); + } + /** + * + * + *
+     * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+     * from other locations will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all locations in which the Service has
+     * activity. For service types that don't support breaking down by location,
+     * setting this field will result in an error.
+     * 
+ * + * repeated string location = 8; + */ + public java.lang.String getLocation(int index) { + return location_.get(index); + } + /** + * + * + *
+     * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+     * from other locations will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all locations in which the Service has
+     * activity. For service types that don't support breaking down by location,
+     * setting this field will result in an error.
+     * 
+ * + * repeated string location = 8; + */ + public com.google.protobuf.ByteString getLocationBytes(int index) { + return location_.getByteString(index); + } + /** + * + * + *
+     * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+     * from other locations will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all locations in which the Service has
+     * activity. For service types that don't support breaking down by location,
+     * setting this field will result in an error.
+     * 
+ * + * repeated string location = 8; + */ + public Builder setLocation(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationIsMutable(); + location_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+     * from other locations will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all locations in which the Service has
+     * activity. For service types that don't support breaking down by location,
+     * setting this field will result in an error.
+     * 
+ * + * repeated string location = 8; + */ + public Builder addLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationIsMutable(); + location_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+     * from other locations will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all locations in which the Service has
+     * activity. For service types that don't support breaking down by location,
+     * setting this field will result in an error.
+     * 
+ * + * repeated string location = 8; + */ + public Builder addAllLocation(java.lang.Iterable values) { + ensureLocationIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, location_); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+     * from other locations will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all locations in which the Service has
+     * activity. For service types that don't support breaking down by location,
+     * setting this field will result in an error.
+     * 
+ * + * repeated string location = 8; + */ + public Builder clearLocation() { + location_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+     * from other locations will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all locations in which the Service has
+     * activity. For service types that don't support breaking down by location,
+     * setting this field will result in an error.
+     * 
+ * + * repeated string location = 8; + */ + public Builder addLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLocationIsMutable(); + location_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList version_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureVersionIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + version_ = new com.google.protobuf.LazyStringArrayList(version_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+     * from other API versions will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all API versions. For service types
+     * that don't support breaking down by version, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string version = 9; + */ + public com.google.protobuf.ProtocolStringList getVersionList() { + return version_.getUnmodifiableView(); + } + /** + * + * + *
+     * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+     * from other API versions will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all API versions. For service types
+     * that don't support breaking down by version, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string version = 9; + */ + public int getVersionCount() { + return version_.size(); + } + /** + * + * + *
+     * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+     * from other API versions will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all API versions. For service types
+     * that don't support breaking down by version, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string version = 9; + */ + public java.lang.String getVersion(int index) { + return version_.get(index); + } + /** + * + * + *
+     * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+     * from other API versions will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all API versions. For service types
+     * that don't support breaking down by version, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string version = 9; + */ + public com.google.protobuf.ByteString getVersionBytes(int index) { + return version_.getByteString(index); + } + /** + * + * + *
+     * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+     * from other API versions will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all API versions. For service types
+     * that don't support breaking down by version, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string version = 9; + */ + public Builder setVersion(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionIsMutable(); + version_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+     * from other API versions will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all API versions. For service types
+     * that don't support breaking down by version, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string version = 9; + */ + public Builder addVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionIsMutable(); + version_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+     * from other API versions will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all API versions. For service types
+     * that don't support breaking down by version, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string version = 9; + */ + public Builder addAllVersion(java.lang.Iterable values) { + ensureVersionIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, version_); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+     * from other API versions will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all API versions. For service types
+     * that don't support breaking down by version, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string version = 9; + */ + public Builder clearVersion() { + version_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+     * from other API versions will not be used to calculate performance for this
+     * SLI. If omitted, this SLI applies to all API versions. For service types
+     * that don't support breaking down by version, setting this field will result
+     * in an error.
+     * 
+ * + * repeated string version = 9; + */ + public Builder addVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureVersionIsMutable(); + version_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli.AvailabilityCriteria, + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.Builder, + com.google.monitoring.v3.BasicSli.AvailabilityCriteriaOrBuilder> + availabilityBuilder_; + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return successfully.
+     * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + public boolean hasAvailability() { + return sliCriteriaCase_ == 2; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return successfully.
+     * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + public com.google.monitoring.v3.BasicSli.AvailabilityCriteria getAvailability() { + if (availabilityBuilder_ == null) { + if (sliCriteriaCase_ == 2) { + return (com.google.monitoring.v3.BasicSli.AvailabilityCriteria) sliCriteria_; + } + return com.google.monitoring.v3.BasicSli.AvailabilityCriteria.getDefaultInstance(); + } else { + if (sliCriteriaCase_ == 2) { + return availabilityBuilder_.getMessage(); + } + return com.google.monitoring.v3.BasicSli.AvailabilityCriteria.getDefaultInstance(); + } + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return successfully.
+     * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + public Builder setAvailability(com.google.monitoring.v3.BasicSli.AvailabilityCriteria value) { + if (availabilityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliCriteria_ = value; + onChanged(); + } else { + availabilityBuilder_.setMessage(value); + } + sliCriteriaCase_ = 2; + return this; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return successfully.
+     * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + public Builder setAvailability( + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.Builder builderForValue) { + if (availabilityBuilder_ == null) { + sliCriteria_ = builderForValue.build(); + onChanged(); + } else { + availabilityBuilder_.setMessage(builderForValue.build()); + } + sliCriteriaCase_ = 2; + return this; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return successfully.
+     * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + public Builder mergeAvailability(com.google.monitoring.v3.BasicSli.AvailabilityCriteria value) { + if (availabilityBuilder_ == null) { + if (sliCriteriaCase_ == 2 + && sliCriteria_ + != com.google.monitoring.v3.BasicSli.AvailabilityCriteria.getDefaultInstance()) { + sliCriteria_ = + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.newBuilder( + (com.google.monitoring.v3.BasicSli.AvailabilityCriteria) sliCriteria_) + .mergeFrom(value) + .buildPartial(); + } else { + sliCriteria_ = value; + } + onChanged(); + } else { + if (sliCriteriaCase_ == 2) { + availabilityBuilder_.mergeFrom(value); + } + availabilityBuilder_.setMessage(value); + } + sliCriteriaCase_ = 2; + return this; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return successfully.
+     * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + public Builder clearAvailability() { + if (availabilityBuilder_ == null) { + if (sliCriteriaCase_ == 2) { + sliCriteriaCase_ = 0; + sliCriteria_ = null; + onChanged(); + } + } else { + if (sliCriteriaCase_ == 2) { + sliCriteriaCase_ = 0; + sliCriteria_ = null; + } + availabilityBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return successfully.
+     * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + public com.google.monitoring.v3.BasicSli.AvailabilityCriteria.Builder getAvailabilityBuilder() { + return getAvailabilityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return successfully.
+     * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + public com.google.monitoring.v3.BasicSli.AvailabilityCriteriaOrBuilder + getAvailabilityOrBuilder() { + if ((sliCriteriaCase_ == 2) && (availabilityBuilder_ != null)) { + return availabilityBuilder_.getMessageOrBuilder(); + } else { + if (sliCriteriaCase_ == 2) { + return (com.google.monitoring.v3.BasicSli.AvailabilityCriteria) sliCriteria_; + } + return com.google.monitoring.v3.BasicSli.AvailabilityCriteria.getDefaultInstance(); + } + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that return successfully.
+     * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli.AvailabilityCriteria, + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.Builder, + com.google.monitoring.v3.BasicSli.AvailabilityCriteriaOrBuilder> + getAvailabilityFieldBuilder() { + if (availabilityBuilder_ == null) { + if (!(sliCriteriaCase_ == 2)) { + sliCriteria_ = + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.getDefaultInstance(); + } + availabilityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli.AvailabilityCriteria, + com.google.monitoring.v3.BasicSli.AvailabilityCriteria.Builder, + com.google.monitoring.v3.BasicSli.AvailabilityCriteriaOrBuilder>( + (com.google.monitoring.v3.BasicSli.AvailabilityCriteria) sliCriteria_, + getParentForChildren(), + isClean()); + sliCriteria_ = null; + } + sliCriteriaCase_ = 2; + onChanged(); + ; + return availabilityBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli.LatencyCriteria, + com.google.monitoring.v3.BasicSli.LatencyCriteria.Builder, + com.google.monitoring.v3.BasicSli.LatencyCriteriaOrBuilder> + latencyBuilder_; + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that are fast enough with respect to `latency.threshold`.
+     * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + public boolean hasLatency() { + return sliCriteriaCase_ == 3; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that are fast enough with respect to `latency.threshold`.
+     * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + public com.google.monitoring.v3.BasicSli.LatencyCriteria getLatency() { + if (latencyBuilder_ == null) { + if (sliCriteriaCase_ == 3) { + return (com.google.monitoring.v3.BasicSli.LatencyCriteria) sliCriteria_; + } + return com.google.monitoring.v3.BasicSli.LatencyCriteria.getDefaultInstance(); + } else { + if (sliCriteriaCase_ == 3) { + return latencyBuilder_.getMessage(); + } + return com.google.monitoring.v3.BasicSli.LatencyCriteria.getDefaultInstance(); + } + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that are fast enough with respect to `latency.threshold`.
+     * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + public Builder setLatency(com.google.monitoring.v3.BasicSli.LatencyCriteria value) { + if (latencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliCriteria_ = value; + onChanged(); + } else { + latencyBuilder_.setMessage(value); + } + sliCriteriaCase_ = 3; + return this; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that are fast enough with respect to `latency.threshold`.
+     * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + public Builder setLatency( + com.google.monitoring.v3.BasicSli.LatencyCriteria.Builder builderForValue) { + if (latencyBuilder_ == null) { + sliCriteria_ = builderForValue.build(); + onChanged(); + } else { + latencyBuilder_.setMessage(builderForValue.build()); + } + sliCriteriaCase_ = 3; + return this; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that are fast enough with respect to `latency.threshold`.
+     * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + public Builder mergeLatency(com.google.monitoring.v3.BasicSli.LatencyCriteria value) { + if (latencyBuilder_ == null) { + if (sliCriteriaCase_ == 3 + && sliCriteria_ + != com.google.monitoring.v3.BasicSli.LatencyCriteria.getDefaultInstance()) { + sliCriteria_ = + com.google.monitoring.v3.BasicSli.LatencyCriteria.newBuilder( + (com.google.monitoring.v3.BasicSli.LatencyCriteria) sliCriteria_) + .mergeFrom(value) + .buildPartial(); + } else { + sliCriteria_ = value; + } + onChanged(); + } else { + if (sliCriteriaCase_ == 3) { + latencyBuilder_.mergeFrom(value); + } + latencyBuilder_.setMessage(value); + } + sliCriteriaCase_ = 3; + return this; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that are fast enough with respect to `latency.threshold`.
+     * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + public Builder clearLatency() { + if (latencyBuilder_ == null) { + if (sliCriteriaCase_ == 3) { + sliCriteriaCase_ = 0; + sliCriteria_ = null; + onChanged(); + } + } else { + if (sliCriteriaCase_ == 3) { + sliCriteriaCase_ = 0; + sliCriteria_ = null; + } + latencyBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that are fast enough with respect to `latency.threshold`.
+     * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + public com.google.monitoring.v3.BasicSli.LatencyCriteria.Builder getLatencyBuilder() { + return getLatencyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that are fast enough with respect to `latency.threshold`.
+     * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + public com.google.monitoring.v3.BasicSli.LatencyCriteriaOrBuilder getLatencyOrBuilder() { + if ((sliCriteriaCase_ == 3) && (latencyBuilder_ != null)) { + return latencyBuilder_.getMessageOrBuilder(); + } else { + if (sliCriteriaCase_ == 3) { + return (com.google.monitoring.v3.BasicSli.LatencyCriteria) sliCriteria_; + } + return com.google.monitoring.v3.BasicSli.LatencyCriteria.getDefaultInstance(); + } + } + /** + * + * + *
+     * Good service is defined to be the count of requests made to this service
+     * that are fast enough with respect to `latency.threshold`.
+     * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli.LatencyCriteria, + com.google.monitoring.v3.BasicSli.LatencyCriteria.Builder, + com.google.monitoring.v3.BasicSli.LatencyCriteriaOrBuilder> + getLatencyFieldBuilder() { + if (latencyBuilder_ == null) { + if (!(sliCriteriaCase_ == 3)) { + sliCriteria_ = com.google.monitoring.v3.BasicSli.LatencyCriteria.getDefaultInstance(); + } + latencyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli.LatencyCriteria, + com.google.monitoring.v3.BasicSli.LatencyCriteria.Builder, + com.google.monitoring.v3.BasicSli.LatencyCriteriaOrBuilder>( + (com.google.monitoring.v3.BasicSli.LatencyCriteria) sliCriteria_, + getParentForChildren(), + isClean()); + sliCriteria_ = null; + } + sliCriteriaCase_ = 3; + onChanged(); + ; + return latencyBuilder_; + } + + @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.BasicSli) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.BasicSli) + private static final com.google.monitoring.v3.BasicSli DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.BasicSli(); + } + + public static com.google.monitoring.v3.BasicSli getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BasicSli parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BasicSli(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.BasicSli getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/BasicSliOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/BasicSliOrBuilder.java new file mode 100644 index 00000000..aaeb503e --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/BasicSliOrBuilder.java @@ -0,0 +1,266 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +public interface BasicSliOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.BasicSli) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+   * other methods will not be used to calculate performance for this SLI. If
+   * omitted, this SLI applies to all the Service's methods. For service types
+   * that don't support breaking down by method, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string method = 7; + */ + java.util.List getMethodList(); + /** + * + * + *
+   * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+   * other methods will not be used to calculate performance for this SLI. If
+   * omitted, this SLI applies to all the Service's methods. For service types
+   * that don't support breaking down by method, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string method = 7; + */ + int getMethodCount(); + /** + * + * + *
+   * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+   * other methods will not be used to calculate performance for this SLI. If
+   * omitted, this SLI applies to all the Service's methods. For service types
+   * that don't support breaking down by method, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string method = 7; + */ + java.lang.String getMethod(int index); + /** + * + * + *
+   * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
+   * other methods will not be used to calculate performance for this SLI. If
+   * omitted, this SLI applies to all the Service's methods. For service types
+   * that don't support breaking down by method, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string method = 7; + */ + com.google.protobuf.ByteString getMethodBytes(int index); + + /** + * + * + *
+   * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+   * from other locations will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all locations in which the Service has
+   * activity. For service types that don't support breaking down by location,
+   * setting this field will result in an error.
+   * 
+ * + * repeated string location = 8; + */ + java.util.List getLocationList(); + /** + * + * + *
+   * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+   * from other locations will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all locations in which the Service has
+   * activity. For service types that don't support breaking down by location,
+   * setting this field will result in an error.
+   * 
+ * + * repeated string location = 8; + */ + int getLocationCount(); + /** + * + * + *
+   * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+   * from other locations will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all locations in which the Service has
+   * activity. For service types that don't support breaking down by location,
+   * setting this field will result in an error.
+   * 
+ * + * repeated string location = 8; + */ + java.lang.String getLocation(int index); + /** + * + * + *
+   * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
+   * from other locations will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all locations in which the Service has
+   * activity. For service types that don't support breaking down by location,
+   * setting this field will result in an error.
+   * 
+ * + * repeated string location = 8; + */ + com.google.protobuf.ByteString getLocationBytes(int index); + + /** + * + * + *
+   * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+   * from other API versions will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all API versions. For service types
+   * that don't support breaking down by version, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string version = 9; + */ + java.util.List getVersionList(); + /** + * + * + *
+   * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+   * from other API versions will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all API versions. For service types
+   * that don't support breaking down by version, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string version = 9; + */ + int getVersionCount(); + /** + * + * + *
+   * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+   * from other API versions will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all API versions. For service types
+   * that don't support breaking down by version, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string version = 9; + */ + java.lang.String getVersion(int index); + /** + * + * + *
+   * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
+   * from other API versions will not be used to calculate performance for this
+   * SLI. If omitted, this SLI applies to all API versions. For service types
+   * that don't support breaking down by version, setting this field will result
+   * in an error.
+   * 
+ * + * repeated string version = 9; + */ + com.google.protobuf.ByteString getVersionBytes(int index); + + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that return successfully.
+   * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + boolean hasAvailability(); + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that return successfully.
+   * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + com.google.monitoring.v3.BasicSli.AvailabilityCriteria getAvailability(); + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that return successfully.
+   * 
+ * + * .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + */ + com.google.monitoring.v3.BasicSli.AvailabilityCriteriaOrBuilder getAvailabilityOrBuilder(); + + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that are fast enough with respect to `latency.threshold`.
+   * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + boolean hasLatency(); + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that are fast enough with respect to `latency.threshold`.
+   * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + com.google.monitoring.v3.BasicSli.LatencyCriteria getLatency(); + /** + * + * + *
+   * Good service is defined to be the count of requests made to this service
+   * that are fast enough with respect to `latency.threshold`.
+   * 
+ * + * .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + */ + com.google.monitoring.v3.BasicSli.LatencyCriteriaOrBuilder getLatencyOrBuilder(); + + public com.google.monitoring.v3.BasicSli.SliCriteriaCase getSliCriteriaCase(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceLevelObjectiveRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceLevelObjectiveRequest.java new file mode 100644 index 00000000..32342236 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceLevelObjectiveRequest.java @@ -0,0 +1,1093 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `CreateServiceLevelObjective` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.CreateServiceLevelObjectiveRequest} + */ +public final class CreateServiceLevelObjectiveRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.CreateServiceLevelObjectiveRequest) + CreateServiceLevelObjectiveRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateServiceLevelObjectiveRequest.newBuilder() to construct. + private CreateServiceLevelObjectiveRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateServiceLevelObjectiveRequest() { + parent_ = ""; + serviceLevelObjectiveId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateServiceLevelObjectiveRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + parent_ = s; + break; + } + case 18: + { + com.google.monitoring.v3.ServiceLevelObjective.Builder subBuilder = null; + if (serviceLevelObjective_ != null) { + subBuilder = serviceLevelObjective_.toBuilder(); + } + serviceLevelObjective_ = + input.readMessage( + com.google.monitoring.v3.ServiceLevelObjective.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceLevelObjective_); + serviceLevelObjective_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceLevelObjectiveId_ = 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.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_CreateServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_CreateServiceLevelObjectiveRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest.class, + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Resource name of the parent `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the parent `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_LEVEL_OBJECTIVE_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object serviceLevelObjectiveId_; + /** + * + * + *
+   * Optional. The ServiceLevelObjective id to use for this
+   * ServiceLevelObjective. If omitted, an id will be generated instead. Must
+   * match the pattern [a-z0-9\-]+
+   * 
+ * + * string service_level_objective_id = 3; + */ + public java.lang.String getServiceLevelObjectiveId() { + java.lang.Object ref = serviceLevelObjectiveId_; + 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(); + serviceLevelObjectiveId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The ServiceLevelObjective id to use for this
+   * ServiceLevelObjective. If omitted, an id will be generated instead. Must
+   * match the pattern [a-z0-9\-]+
+   * 
+ * + * string service_level_objective_id = 3; + */ + public com.google.protobuf.ByteString getServiceLevelObjectiveIdBytes() { + java.lang.Object ref = serviceLevelObjectiveId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceLevelObjectiveId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_LEVEL_OBJECTIVE_FIELD_NUMBER = 2; + private com.google.monitoring.v3.ServiceLevelObjective serviceLevelObjective_; + /** + * + * + *
+   * The `ServiceLevelObjective` to create.
+   * The provided `name` will be respected if no `ServiceLevelObjective` exists
+   * with this name.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + public boolean hasServiceLevelObjective() { + return serviceLevelObjective_ != null; + } + /** + * + * + *
+   * The `ServiceLevelObjective` to create.
+   * The provided `name` will be respected if no `ServiceLevelObjective` exists
+   * with this name.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + public com.google.monitoring.v3.ServiceLevelObjective getServiceLevelObjective() { + return serviceLevelObjective_ == null + ? com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance() + : serviceLevelObjective_; + } + /** + * + * + *
+   * The `ServiceLevelObjective` to create.
+   * The provided `name` will be respected if no `ServiceLevelObjective` exists
+   * with this name.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + public com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder + getServiceLevelObjectiveOrBuilder() { + return getServiceLevelObjective(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (serviceLevelObjective_ != null) { + output.writeMessage(2, getServiceLevelObjective()); + } + if (!getServiceLevelObjectiveIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, serviceLevelObjectiveId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (serviceLevelObjective_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getServiceLevelObjective()); + } + if (!getServiceLevelObjectiveIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, serviceLevelObjectiveId_); + } + 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.CreateServiceLevelObjectiveRequest)) { + return super.equals(obj); + } + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest other = + (com.google.monitoring.v3.CreateServiceLevelObjectiveRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getServiceLevelObjectiveId().equals(other.getServiceLevelObjectiveId())) return false; + if (hasServiceLevelObjective() != other.hasServiceLevelObjective()) return false; + if (hasServiceLevelObjective()) { + if (!getServiceLevelObjective().equals(other.getServiceLevelObjective())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + SERVICE_LEVEL_OBJECTIVE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceLevelObjectiveId().hashCode(); + if (hasServiceLevelObjective()) { + hash = (37 * hash) + SERVICE_LEVEL_OBJECTIVE_FIELD_NUMBER; + hash = (53 * hash) + getServiceLevelObjective().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.CreateServiceLevelObjectiveRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateServiceLevelObjectiveRequest 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.CreateServiceLevelObjectiveRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateServiceLevelObjectiveRequest 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.CreateServiceLevelObjectiveRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateServiceLevelObjectiveRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.CreateServiceLevelObjectiveRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateServiceLevelObjectiveRequest 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.CreateServiceLevelObjectiveRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateServiceLevelObjectiveRequest 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.CreateServiceLevelObjectiveRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateServiceLevelObjectiveRequest 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.CreateServiceLevelObjectiveRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `CreateServiceLevelObjective` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.CreateServiceLevelObjectiveRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.CreateServiceLevelObjectiveRequest) + com.google.monitoring.v3.CreateServiceLevelObjectiveRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_CreateServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_CreateServiceLevelObjectiveRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest.class, + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest.Builder.class); + } + + // Construct using com.google.monitoring.v3.CreateServiceLevelObjectiveRequest.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(); + parent_ = ""; + + serviceLevelObjectiveId_ = ""; + + if (serviceLevelObjectiveBuilder_ == null) { + serviceLevelObjective_ = null; + } else { + serviceLevelObjective_ = null; + serviceLevelObjectiveBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_CreateServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.CreateServiceLevelObjectiveRequest getDefaultInstanceForType() { + return com.google.monitoring.v3.CreateServiceLevelObjectiveRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.CreateServiceLevelObjectiveRequest build() { + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.CreateServiceLevelObjectiveRequest buildPartial() { + com.google.monitoring.v3.CreateServiceLevelObjectiveRequest result = + new com.google.monitoring.v3.CreateServiceLevelObjectiveRequest(this); + result.parent_ = parent_; + result.serviceLevelObjectiveId_ = serviceLevelObjectiveId_; + if (serviceLevelObjectiveBuilder_ == null) { + result.serviceLevelObjective_ = serviceLevelObjective_; + } else { + result.serviceLevelObjective_ = serviceLevelObjectiveBuilder_.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.CreateServiceLevelObjectiveRequest) { + return mergeFrom((com.google.monitoring.v3.CreateServiceLevelObjectiveRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.CreateServiceLevelObjectiveRequest other) { + if (other == com.google.monitoring.v3.CreateServiceLevelObjectiveRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getServiceLevelObjectiveId().isEmpty()) { + serviceLevelObjectiveId_ = other.serviceLevelObjectiveId_; + onChanged(); + } + if (other.hasServiceLevelObjective()) { + mergeServiceLevelObjective(other.getServiceLevelObjective()); + } + 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.CreateServiceLevelObjectiveRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.CreateServiceLevelObjectiveRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Resource name of the parent `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the parent `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the parent `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceLevelObjectiveId_ = ""; + /** + * + * + *
+     * Optional. The ServiceLevelObjective id to use for this
+     * ServiceLevelObjective. If omitted, an id will be generated instead. Must
+     * match the pattern [a-z0-9\-]+
+     * 
+ * + * string service_level_objective_id = 3; + */ + public java.lang.String getServiceLevelObjectiveId() { + java.lang.Object ref = serviceLevelObjectiveId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceLevelObjectiveId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The ServiceLevelObjective id to use for this
+     * ServiceLevelObjective. If omitted, an id will be generated instead. Must
+     * match the pattern [a-z0-9\-]+
+     * 
+ * + * string service_level_objective_id = 3; + */ + public com.google.protobuf.ByteString getServiceLevelObjectiveIdBytes() { + java.lang.Object ref = serviceLevelObjectiveId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceLevelObjectiveId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The ServiceLevelObjective id to use for this
+     * ServiceLevelObjective. If omitted, an id will be generated instead. Must
+     * match the pattern [a-z0-9\-]+
+     * 
+ * + * string service_level_objective_id = 3; + */ + public Builder setServiceLevelObjectiveId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceLevelObjectiveId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ServiceLevelObjective id to use for this
+     * ServiceLevelObjective. If omitted, an id will be generated instead. Must
+     * match the pattern [a-z0-9\-]+
+     * 
+ * + * string service_level_objective_id = 3; + */ + public Builder clearServiceLevelObjectiveId() { + + serviceLevelObjectiveId_ = getDefaultInstance().getServiceLevelObjectiveId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ServiceLevelObjective id to use for this
+     * ServiceLevelObjective. If omitted, an id will be generated instead. Must
+     * match the pattern [a-z0-9\-]+
+     * 
+ * + * string service_level_objective_id = 3; + */ + public Builder setServiceLevelObjectiveIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceLevelObjectiveId_ = value; + onChanged(); + return this; + } + + private com.google.monitoring.v3.ServiceLevelObjective serviceLevelObjective_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelObjective, + com.google.monitoring.v3.ServiceLevelObjective.Builder, + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder> + serviceLevelObjectiveBuilder_; + /** + * + * + *
+     * The `ServiceLevelObjective` to create.
+     * The provided `name` will be respected if no `ServiceLevelObjective` exists
+     * with this name.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + public boolean hasServiceLevelObjective() { + return serviceLevelObjectiveBuilder_ != null || serviceLevelObjective_ != null; + } + /** + * + * + *
+     * The `ServiceLevelObjective` to create.
+     * The provided `name` will be respected if no `ServiceLevelObjective` exists
+     * with this name.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + public com.google.monitoring.v3.ServiceLevelObjective getServiceLevelObjective() { + if (serviceLevelObjectiveBuilder_ == null) { + return serviceLevelObjective_ == null + ? com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance() + : serviceLevelObjective_; + } else { + return serviceLevelObjectiveBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The `ServiceLevelObjective` to create.
+     * The provided `name` will be respected if no `ServiceLevelObjective` exists
+     * with this name.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + public Builder setServiceLevelObjective(com.google.monitoring.v3.ServiceLevelObjective value) { + if (serviceLevelObjectiveBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceLevelObjective_ = value; + onChanged(); + } else { + serviceLevelObjectiveBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective` to create.
+     * The provided `name` will be respected if no `ServiceLevelObjective` exists
+     * with this name.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + public Builder setServiceLevelObjective( + com.google.monitoring.v3.ServiceLevelObjective.Builder builderForValue) { + if (serviceLevelObjectiveBuilder_ == null) { + serviceLevelObjective_ = builderForValue.build(); + onChanged(); + } else { + serviceLevelObjectiveBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective` to create.
+     * The provided `name` will be respected if no `ServiceLevelObjective` exists
+     * with this name.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + public Builder mergeServiceLevelObjective( + com.google.monitoring.v3.ServiceLevelObjective value) { + if (serviceLevelObjectiveBuilder_ == null) { + if (serviceLevelObjective_ != null) { + serviceLevelObjective_ = + com.google.monitoring.v3.ServiceLevelObjective.newBuilder(serviceLevelObjective_) + .mergeFrom(value) + .buildPartial(); + } else { + serviceLevelObjective_ = value; + } + onChanged(); + } else { + serviceLevelObjectiveBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective` to create.
+     * The provided `name` will be respected if no `ServiceLevelObjective` exists
+     * with this name.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + public Builder clearServiceLevelObjective() { + if (serviceLevelObjectiveBuilder_ == null) { + serviceLevelObjective_ = null; + onChanged(); + } else { + serviceLevelObjective_ = null; + serviceLevelObjectiveBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective` to create.
+     * The provided `name` will be respected if no `ServiceLevelObjective` exists
+     * with this name.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + public com.google.monitoring.v3.ServiceLevelObjective.Builder + getServiceLevelObjectiveBuilder() { + + onChanged(); + return getServiceLevelObjectiveFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The `ServiceLevelObjective` to create.
+     * The provided `name` will be respected if no `ServiceLevelObjective` exists
+     * with this name.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + public com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder + getServiceLevelObjectiveOrBuilder() { + if (serviceLevelObjectiveBuilder_ != null) { + return serviceLevelObjectiveBuilder_.getMessageOrBuilder(); + } else { + return serviceLevelObjective_ == null + ? com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance() + : serviceLevelObjective_; + } + } + /** + * + * + *
+     * The `ServiceLevelObjective` to create.
+     * The provided `name` will be respected if no `ServiceLevelObjective` exists
+     * with this name.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelObjective, + com.google.monitoring.v3.ServiceLevelObjective.Builder, + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder> + getServiceLevelObjectiveFieldBuilder() { + if (serviceLevelObjectiveBuilder_ == null) { + serviceLevelObjectiveBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelObjective, + com.google.monitoring.v3.ServiceLevelObjective.Builder, + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder>( + getServiceLevelObjective(), getParentForChildren(), isClean()); + serviceLevelObjective_ = null; + } + return serviceLevelObjectiveBuilder_; + } + + @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.CreateServiceLevelObjectiveRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.CreateServiceLevelObjectiveRequest) + private static final com.google.monitoring.v3.CreateServiceLevelObjectiveRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.CreateServiceLevelObjectiveRequest(); + } + + public static com.google.monitoring.v3.CreateServiceLevelObjectiveRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateServiceLevelObjectiveRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateServiceLevelObjectiveRequest(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.CreateServiceLevelObjectiveRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceLevelObjectiveRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceLevelObjectiveRequestOrBuilder.java new file mode 100644 index 00000000..8c9a1314 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceLevelObjectiveRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface CreateServiceLevelObjectiveRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.CreateServiceLevelObjectiveRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the parent `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Resource name of the parent `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The ServiceLevelObjective id to use for this
+   * ServiceLevelObjective. If omitted, an id will be generated instead. Must
+   * match the pattern [a-z0-9\-]+
+   * 
+ * + * string service_level_objective_id = 3; + */ + java.lang.String getServiceLevelObjectiveId(); + /** + * + * + *
+   * Optional. The ServiceLevelObjective id to use for this
+   * ServiceLevelObjective. If omitted, an id will be generated instead. Must
+   * match the pattern [a-z0-9\-]+
+   * 
+ * + * string service_level_objective_id = 3; + */ + com.google.protobuf.ByteString getServiceLevelObjectiveIdBytes(); + + /** + * + * + *
+   * The `ServiceLevelObjective` to create.
+   * The provided `name` will be respected if no `ServiceLevelObjective` exists
+   * with this name.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + boolean hasServiceLevelObjective(); + /** + * + * + *
+   * The `ServiceLevelObjective` to create.
+   * The provided `name` will be respected if no `ServiceLevelObjective` exists
+   * with this name.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + com.google.monitoring.v3.ServiceLevelObjective getServiceLevelObjective(); + /** + * + * + *
+   * The `ServiceLevelObjective` to create.
+   * The provided `name` will be respected if no `ServiceLevelObjective` exists
+   * with this name.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2; + */ + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder getServiceLevelObjectiveOrBuilder(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceRequest.java new file mode 100644 index 00000000..4adf8f19 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceRequest.java @@ -0,0 +1,1043 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `CreateService` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.CreateServiceRequest} + */ +public final class CreateServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.CreateServiceRequest) + CreateServiceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateServiceRequest.newBuilder() to construct. + private CreateServiceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateServiceRequest() { + parent_ = ""; + serviceId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateServiceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + parent_ = s; + break; + } + case 18: + { + com.google.monitoring.v3.Service.Builder subBuilder = null; + if (service_ != null) { + subBuilder = service_.toBuilder(); + } + service_ = + input.readMessage(com.google.monitoring.v3.Service.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(service_); + service_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceId_ = 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.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_CreateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_CreateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.CreateServiceRequest.class, + com.google.monitoring.v3.CreateServiceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Resource name of the parent workspace.
+   * Of the form `projects/{project_id}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the parent workspace.
+   * Of the form `projects/{project_id}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object serviceId_; + /** + * + * + *
+   * Optional. The Service id to use for this Service. If omitted, an id will be
+   * generated instead. Must match the pattern [a-z0-9\-]+
+   * 
+ * + * string service_id = 3; + */ + public java.lang.String getServiceId() { + java.lang.Object ref = serviceId_; + 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(); + serviceId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The Service id to use for this Service. If omitted, an id will be
+   * generated instead. Must match the pattern [a-z0-9\-]+
+   * 
+ * + * string service_id = 3; + */ + public com.google.protobuf.ByteString getServiceIdBytes() { + java.lang.Object ref = serviceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_FIELD_NUMBER = 2; + private com.google.monitoring.v3.Service service_; + /** + * + * + *
+   * The `Service` to create.
+   * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + public boolean hasService() { + return service_ != null; + } + /** + * + * + *
+   * The `Service` to create.
+   * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + public com.google.monitoring.v3.Service getService() { + return service_ == null ? com.google.monitoring.v3.Service.getDefaultInstance() : service_; + } + /** + * + * + *
+   * The `Service` to create.
+   * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + public com.google.monitoring.v3.ServiceOrBuilder getServiceOrBuilder() { + return getService(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (service_ != null) { + output.writeMessage(2, getService()); + } + if (!getServiceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, serviceId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (service_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getService()); + } + if (!getServiceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, serviceId_); + } + 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.CreateServiceRequest)) { + return super.equals(obj); + } + com.google.monitoring.v3.CreateServiceRequest other = + (com.google.monitoring.v3.CreateServiceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getServiceId().equals(other.getServiceId())) return false; + if (hasService() != other.hasService()) return false; + if (hasService()) { + if (!getService().equals(other.getService())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + if (hasService()) { + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.CreateServiceRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateServiceRequest 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.CreateServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateServiceRequest 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.CreateServiceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateServiceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.CreateServiceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateServiceRequest 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.CreateServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateServiceRequest 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.CreateServiceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateServiceRequest 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.CreateServiceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `CreateService` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.CreateServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.CreateServiceRequest) + com.google.monitoring.v3.CreateServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_CreateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_CreateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.CreateServiceRequest.class, + com.google.monitoring.v3.CreateServiceRequest.Builder.class); + } + + // Construct using com.google.monitoring.v3.CreateServiceRequest.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(); + parent_ = ""; + + serviceId_ = ""; + + if (serviceBuilder_ == null) { + service_ = null; + } else { + service_ = null; + serviceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_CreateServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.CreateServiceRequest getDefaultInstanceForType() { + return com.google.monitoring.v3.CreateServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.CreateServiceRequest build() { + com.google.monitoring.v3.CreateServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.CreateServiceRequest buildPartial() { + com.google.monitoring.v3.CreateServiceRequest result = + new com.google.monitoring.v3.CreateServiceRequest(this); + result.parent_ = parent_; + result.serviceId_ = serviceId_; + if (serviceBuilder_ == null) { + result.service_ = service_; + } else { + result.service_ = serviceBuilder_.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.CreateServiceRequest) { + return mergeFrom((com.google.monitoring.v3.CreateServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.CreateServiceRequest other) { + if (other == com.google.monitoring.v3.CreateServiceRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getServiceId().isEmpty()) { + serviceId_ = other.serviceId_; + onChanged(); + } + if (other.hasService()) { + mergeService(other.getService()); + } + 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.CreateServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.CreateServiceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Resource name of the parent workspace.
+     * Of the form `projects/{project_id}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the parent workspace.
+     * Of the form `projects/{project_id}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the parent workspace.
+     * Of the form `projects/{project_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent workspace.
+     * Of the form `projects/{project_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent workspace.
+     * Of the form `projects/{project_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceId_ = ""; + /** + * + * + *
+     * Optional. The Service id to use for this Service. If omitted, an id will be
+     * generated instead. Must match the pattern [a-z0-9\-]+
+     * 
+ * + * string service_id = 3; + */ + public java.lang.String getServiceId() { + java.lang.Object ref = serviceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The Service id to use for this Service. If omitted, an id will be
+     * generated instead. Must match the pattern [a-z0-9\-]+
+     * 
+ * + * string service_id = 3; + */ + public com.google.protobuf.ByteString getServiceIdBytes() { + java.lang.Object ref = serviceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The Service id to use for this Service. If omitted, an id will be
+     * generated instead. Must match the pattern [a-z0-9\-]+
+     * 
+ * + * string service_id = 3; + */ + public Builder setServiceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The Service id to use for this Service. If omitted, an id will be
+     * generated instead. Must match the pattern [a-z0-9\-]+
+     * 
+ * + * string service_id = 3; + */ + public Builder clearServiceId() { + + serviceId_ = getDefaultInstance().getServiceId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The Service id to use for this Service. If omitted, an id will be
+     * generated instead. Must match the pattern [a-z0-9\-]+
+     * 
+ * + * string service_id = 3; + */ + public Builder setServiceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceId_ = value; + onChanged(); + return this; + } + + private com.google.monitoring.v3.Service service_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service, + com.google.monitoring.v3.Service.Builder, + com.google.monitoring.v3.ServiceOrBuilder> + serviceBuilder_; + /** + * + * + *
+     * The `Service` to create.
+     * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + public boolean hasService() { + return serviceBuilder_ != null || service_ != null; + } + /** + * + * + *
+     * The `Service` to create.
+     * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + public com.google.monitoring.v3.Service getService() { + if (serviceBuilder_ == null) { + return service_ == null ? com.google.monitoring.v3.Service.getDefaultInstance() : service_; + } else { + return serviceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The `Service` to create.
+     * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + public Builder setService(com.google.monitoring.v3.Service value) { + if (serviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + onChanged(); + } else { + serviceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The `Service` to create.
+     * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + public Builder setService(com.google.monitoring.v3.Service.Builder builderForValue) { + if (serviceBuilder_ == null) { + service_ = builderForValue.build(); + onChanged(); + } else { + serviceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The `Service` to create.
+     * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + public Builder mergeService(com.google.monitoring.v3.Service value) { + if (serviceBuilder_ == null) { + if (service_ != null) { + service_ = + com.google.monitoring.v3.Service.newBuilder(service_).mergeFrom(value).buildPartial(); + } else { + service_ = value; + } + onChanged(); + } else { + serviceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The `Service` to create.
+     * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + public Builder clearService() { + if (serviceBuilder_ == null) { + service_ = null; + onChanged(); + } else { + service_ = null; + serviceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The `Service` to create.
+     * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + public com.google.monitoring.v3.Service.Builder getServiceBuilder() { + + onChanged(); + return getServiceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The `Service` to create.
+     * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + public com.google.monitoring.v3.ServiceOrBuilder getServiceOrBuilder() { + if (serviceBuilder_ != null) { + return serviceBuilder_.getMessageOrBuilder(); + } else { + return service_ == null ? com.google.monitoring.v3.Service.getDefaultInstance() : service_; + } + } + /** + * + * + *
+     * The `Service` to create.
+     * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service, + com.google.monitoring.v3.Service.Builder, + com.google.monitoring.v3.ServiceOrBuilder> + getServiceFieldBuilder() { + if (serviceBuilder_ == null) { + serviceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service, + com.google.monitoring.v3.Service.Builder, + com.google.monitoring.v3.ServiceOrBuilder>( + getService(), getParentForChildren(), isClean()); + service_ = null; + } + return serviceBuilder_; + } + + @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.CreateServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.CreateServiceRequest) + private static final com.google.monitoring.v3.CreateServiceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.CreateServiceRequest(); + } + + public static com.google.monitoring.v3.CreateServiceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateServiceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateServiceRequest(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.CreateServiceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceRequestOrBuilder.java new file mode 100644 index 00000000..3057d6cf --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateServiceRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface CreateServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.CreateServiceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the parent workspace.
+   * Of the form `projects/{project_id}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Resource name of the parent workspace.
+   * Of the form `projects/{project_id}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The Service id to use for this Service. If omitted, an id will be
+   * generated instead. Must match the pattern [a-z0-9\-]+
+   * 
+ * + * string service_id = 3; + */ + java.lang.String getServiceId(); + /** + * + * + *
+   * Optional. The Service id to use for this Service. If omitted, an id will be
+   * generated instead. Must match the pattern [a-z0-9\-]+
+   * 
+ * + * string service_id = 3; + */ + com.google.protobuf.ByteString getServiceIdBytes(); + + /** + * + * + *
+   * The `Service` to create.
+   * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + boolean hasService(); + /** + * + * + *
+   * The `Service` to create.
+   * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + com.google.monitoring.v3.Service getService(); + /** + * + * + *
+   * The `Service` to create.
+   * 
+ * + * .google.monitoring.v3.Service service = 2; + */ + com.google.monitoring.v3.ServiceOrBuilder getServiceOrBuilder(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesError.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesError.java index fd92a664..4d15c554 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesError.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesError.java @@ -22,7 +22,7 @@ * * *
- * Describes the result of a failed request to write data to a time series.
+ * DEPRECATED. Used to hold per-time-series error status.
  * 
* * Protobuf type {@code google.monitoring.v3.CreateTimeSeriesError} @@ -133,14 +133,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * The time series, including the `Metric`, `MonitoredResource`,
-   * and `Point`s (including timestamp and value) that resulted
-   * in the error. This field provides all of the context that
-   * would be needed to retry the operation.
+   * DEPRECATED. Time series ID that resulted in the `status` error.
    * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated public boolean hasTimeSeries() { return timeSeries_ != null; } @@ -148,14 +146,12 @@ public boolean hasTimeSeries() { * * *
-   * The time series, including the `Metric`, `MonitoredResource`,
-   * and `Point`s (including timestamp and value) that resulted
-   * in the error. This field provides all of the context that
-   * would be needed to retry the operation.
+   * DEPRECATED. Time series ID that resulted in the `status` error.
    * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated public com.google.monitoring.v3.TimeSeries getTimeSeries() { return timeSeries_ == null ? com.google.monitoring.v3.TimeSeries.getDefaultInstance() @@ -165,14 +161,12 @@ public com.google.monitoring.v3.TimeSeries getTimeSeries() { * * *
-   * The time series, including the `Metric`, `MonitoredResource`,
-   * and `Point`s (including timestamp and value) that resulted
-   * in the error. This field provides all of the context that
-   * would be needed to retry the operation.
+   * DEPRECATED. Time series ID that resulted in the `status` error.
    * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated public com.google.monitoring.v3.TimeSeriesOrBuilder getTimeSeriesOrBuilder() { return getTimeSeries(); } @@ -183,11 +177,12 @@ public com.google.monitoring.v3.TimeSeriesOrBuilder getTimeSeriesOrBuilder() { * * *
-   * The status of the requested write operation.
+   * DEPRECATED. The status of the requested write operation for `time_series`.
    * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated public boolean hasStatus() { return status_ != null; } @@ -195,11 +190,12 @@ public boolean hasStatus() { * * *
-   * The status of the requested write operation.
+   * DEPRECATED. The status of the requested write operation for `time_series`.
    * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated public com.google.rpc.Status getStatus() { return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; } @@ -207,11 +203,12 @@ public com.google.rpc.Status getStatus() { * * *
-   * The status of the requested write operation.
+   * DEPRECATED. The status of the requested write operation for `time_series`.
    * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { return getStatus(); } @@ -398,7 +395,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Describes the result of a failed request to write data to a time series.
+   * DEPRECATED. Used to hold per-time-series error status.
    * 
* * Protobuf type {@code google.monitoring.v3.CreateTimeSeriesError} @@ -582,14 +579,12 @@ public Builder mergeFrom( * * *
-     * The time series, including the `Metric`, `MonitoredResource`,
-     * and `Point`s (including timestamp and value) that resulted
-     * in the error. This field provides all of the context that
-     * would be needed to retry the operation.
+     * DEPRECATED. Time series ID that resulted in the `status` error.
      * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated public boolean hasTimeSeries() { return timeSeriesBuilder_ != null || timeSeries_ != null; } @@ -597,14 +592,12 @@ public boolean hasTimeSeries() { * * *
-     * The time series, including the `Metric`, `MonitoredResource`,
-     * and `Point`s (including timestamp and value) that resulted
-     * in the error. This field provides all of the context that
-     * would be needed to retry the operation.
+     * DEPRECATED. Time series ID that resulted in the `status` error.
      * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated public com.google.monitoring.v3.TimeSeries getTimeSeries() { if (timeSeriesBuilder_ == null) { return timeSeries_ == null @@ -618,14 +611,12 @@ public com.google.monitoring.v3.TimeSeries getTimeSeries() { * * *
-     * The time series, including the `Metric`, `MonitoredResource`,
-     * and `Point`s (including timestamp and value) that resulted
-     * in the error. This field provides all of the context that
-     * would be needed to retry the operation.
+     * DEPRECATED. Time series ID that resulted in the `status` error.
      * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated public Builder setTimeSeries(com.google.monitoring.v3.TimeSeries value) { if (timeSeriesBuilder_ == null) { if (value == null) { @@ -643,14 +634,12 @@ public Builder setTimeSeries(com.google.monitoring.v3.TimeSeries value) { * * *
-     * The time series, including the `Metric`, `MonitoredResource`,
-     * and `Point`s (including timestamp and value) that resulted
-     * in the error. This field provides all of the context that
-     * would be needed to retry the operation.
+     * DEPRECATED. Time series ID that resulted in the `status` error.
      * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated public Builder setTimeSeries(com.google.monitoring.v3.TimeSeries.Builder builderForValue) { if (timeSeriesBuilder_ == null) { timeSeries_ = builderForValue.build(); @@ -665,14 +654,12 @@ public Builder setTimeSeries(com.google.monitoring.v3.TimeSeries.Builder builder * * *
-     * The time series, including the `Metric`, `MonitoredResource`,
-     * and `Point`s (including timestamp and value) that resulted
-     * in the error. This field provides all of the context that
-     * would be needed to retry the operation.
+     * DEPRECATED. Time series ID that resulted in the `status` error.
      * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated public Builder mergeTimeSeries(com.google.monitoring.v3.TimeSeries value) { if (timeSeriesBuilder_ == null) { if (timeSeries_ != null) { @@ -694,14 +681,12 @@ public Builder mergeTimeSeries(com.google.monitoring.v3.TimeSeries value) { * * *
-     * The time series, including the `Metric`, `MonitoredResource`,
-     * and `Point`s (including timestamp and value) that resulted
-     * in the error. This field provides all of the context that
-     * would be needed to retry the operation.
+     * DEPRECATED. Time series ID that resulted in the `status` error.
      * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated public Builder clearTimeSeries() { if (timeSeriesBuilder_ == null) { timeSeries_ = null; @@ -717,14 +702,12 @@ public Builder clearTimeSeries() { * * *
-     * The time series, including the `Metric`, `MonitoredResource`,
-     * and `Point`s (including timestamp and value) that resulted
-     * in the error. This field provides all of the context that
-     * would be needed to retry the operation.
+     * DEPRECATED. Time series ID that resulted in the `status` error.
      * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated public com.google.monitoring.v3.TimeSeries.Builder getTimeSeriesBuilder() { onChanged(); @@ -734,14 +717,12 @@ public com.google.monitoring.v3.TimeSeries.Builder getTimeSeriesBuilder() { * * *
-     * The time series, including the `Metric`, `MonitoredResource`,
-     * and `Point`s (including timestamp and value) that resulted
-     * in the error. This field provides all of the context that
-     * would be needed to retry the operation.
+     * DEPRECATED. Time series ID that resulted in the `status` error.
      * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated public com.google.monitoring.v3.TimeSeriesOrBuilder getTimeSeriesOrBuilder() { if (timeSeriesBuilder_ != null) { return timeSeriesBuilder_.getMessageOrBuilder(); @@ -755,13 +736,10 @@ public com.google.monitoring.v3.TimeSeriesOrBuilder getTimeSeriesOrBuilder() { * * *
-     * The time series, including the `Metric`, `MonitoredResource`,
-     * and `Point`s (including timestamp and value) that resulted
-     * in the error. This field provides all of the context that
-     * would be needed to retry the operation.
+     * DEPRECATED. Time series ID that resulted in the `status` error.
      * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.monitoring.v3.TimeSeries, @@ -788,11 +766,12 @@ public com.google.monitoring.v3.TimeSeriesOrBuilder getTimeSeriesOrBuilder() { * * *
-     * The status of the requested write operation.
+     * DEPRECATED. The status of the requested write operation for `time_series`.
      * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated public boolean hasStatus() { return statusBuilder_ != null || status_ != null; } @@ -800,11 +779,12 @@ public boolean hasStatus() { * * *
-     * The status of the requested write operation.
+     * DEPRECATED. The status of the requested write operation for `time_series`.
      * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated public com.google.rpc.Status getStatus() { if (statusBuilder_ == null) { return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; @@ -816,11 +796,12 @@ public com.google.rpc.Status getStatus() { * * *
-     * The status of the requested write operation.
+     * DEPRECATED. The status of the requested write operation for `time_series`.
      * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated public Builder setStatus(com.google.rpc.Status value) { if (statusBuilder_ == null) { if (value == null) { @@ -838,11 +819,12 @@ public Builder setStatus(com.google.rpc.Status value) { * * *
-     * The status of the requested write operation.
+     * DEPRECATED. The status of the requested write operation for `time_series`.
      * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { if (statusBuilder_ == null) { status_ = builderForValue.build(); @@ -857,11 +839,12 @@ public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { * * *
-     * The status of the requested write operation.
+     * DEPRECATED. The status of the requested write operation for `time_series`.
      * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated public Builder mergeStatus(com.google.rpc.Status value) { if (statusBuilder_ == null) { if (status_ != null) { @@ -880,11 +863,12 @@ public Builder mergeStatus(com.google.rpc.Status value) { * * *
-     * The status of the requested write operation.
+     * DEPRECATED. The status of the requested write operation for `time_series`.
      * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated public Builder clearStatus() { if (statusBuilder_ == null) { status_ = null; @@ -900,11 +884,12 @@ public Builder clearStatus() { * * *
-     * The status of the requested write operation.
+     * DEPRECATED. The status of the requested write operation for `time_series`.
      * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated public com.google.rpc.Status.Builder getStatusBuilder() { onChanged(); @@ -914,11 +899,12 @@ public com.google.rpc.Status.Builder getStatusBuilder() { * * *
-     * The status of the requested write operation.
+     * DEPRECATED. The status of the requested write operation for `time_series`.
      * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { if (statusBuilder_ != null) { return statusBuilder_.getMessageOrBuilder(); @@ -930,10 +916,10 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { * * *
-     * The status of the requested write operation.
+     * DEPRECATED. The status of the requested write operation for `time_series`.
      * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesErrorOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesErrorOrBuilder.java index 15aca424..7516a116 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesErrorOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesErrorOrBuilder.java @@ -27,70 +27,67 @@ public interface CreateTimeSeriesErrorOrBuilder * * *
-   * The time series, including the `Metric`, `MonitoredResource`,
-   * and `Point`s (including timestamp and value) that resulted
-   * in the error. This field provides all of the context that
-   * would be needed to retry the operation.
+   * DEPRECATED. Time series ID that resulted in the `status` error.
    * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated boolean hasTimeSeries(); /** * * *
-   * The time series, including the `Metric`, `MonitoredResource`,
-   * and `Point`s (including timestamp and value) that resulted
-   * in the error. This field provides all of the context that
-   * would be needed to retry the operation.
+   * DEPRECATED. Time series ID that resulted in the `status` error.
    * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated com.google.monitoring.v3.TimeSeries getTimeSeries(); /** * * *
-   * The time series, including the `Metric`, `MonitoredResource`,
-   * and `Point`s (including timestamp and value) that resulted
-   * in the error. This field provides all of the context that
-   * would be needed to retry the operation.
+   * DEPRECATED. Time series ID that resulted in the `status` error.
    * 
* - * .google.monitoring.v3.TimeSeries time_series = 1; + * .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; */ + @java.lang.Deprecated com.google.monitoring.v3.TimeSeriesOrBuilder getTimeSeriesOrBuilder(); /** * * *
-   * The status of the requested write operation.
+   * DEPRECATED. The status of the requested write operation for `time_series`.
    * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated boolean hasStatus(); /** * * *
-   * The status of the requested write operation.
+   * DEPRECATED. The status of the requested write operation for `time_series`.
    * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated com.google.rpc.Status getStatus(); /** * * *
-   * The status of the requested write operation.
+   * DEPRECATED. The status of the requested write operation for `time_series`.
    * 
* - * .google.rpc.Status status = 2; + * .google.rpc.Status status = 2 [deprecated = true]; */ + @java.lang.Deprecated com.google.rpc.StatusOrBuilder getStatusOrBuilder(); } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesSummary.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesSummary.java new file mode 100644 index 00000000..3e925e0e --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesSummary.java @@ -0,0 +1,1926 @@ +/* + * Copyright 2019 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/metric_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * Summary of the result of a failed request to write data to a time series.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.CreateTimeSeriesSummary} + */ +public final class CreateTimeSeriesSummary extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.CreateTimeSeriesSummary) + CreateTimeSeriesSummaryOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateTimeSeriesSummary.newBuilder() to construct. + private CreateTimeSeriesSummary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateTimeSeriesSummary() { + errors_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateTimeSeriesSummary( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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 8: + { + totalPointCount_ = input.readInt32(); + break; + } + case 16: + { + successPointCount_ = input.readInt32(); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + errors_ = + new java.util.ArrayList< + com.google.monitoring.v3.CreateTimeSeriesSummary.Error>(); + mutable_bitField0_ |= 0x00000004; + } + errors_.add( + input.readMessage( + com.google.monitoring.v3.CreateTimeSeriesSummary.Error.parser(), + extensionRegistry)); + 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 { + if (((mutable_bitField0_ & 0x00000004) != 0)) { + errors_ = java.util.Collections.unmodifiableList(errors_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.MetricServiceProto + .internal_static_google_monitoring_v3_CreateTimeSeriesSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.MetricServiceProto + .internal_static_google_monitoring_v3_CreateTimeSeriesSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.CreateTimeSeriesSummary.class, + com.google.monitoring.v3.CreateTimeSeriesSummary.Builder.class); + } + + public interface ErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.CreateTimeSeriesSummary.Error) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The status of the requested write operation.
+     * 
+ * + * .google.rpc.Status status = 1; + */ + boolean hasStatus(); + /** + * + * + *
+     * The status of the requested write operation.
+     * 
+ * + * .google.rpc.Status status = 1; + */ + com.google.rpc.Status getStatus(); + /** + * + * + *
+     * The status of the requested write operation.
+     * 
+ * + * .google.rpc.Status status = 1; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
+     * The number of points that couldn't be written because of `status`.
+     * 
+ * + * int32 point_count = 2; + */ + int getPointCount(); + } + /** + * + * + *
+   * Detailed information about an error category.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.CreateTimeSeriesSummary.Error} + */ + public static final class Error extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.CreateTimeSeriesSummary.Error) + ErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use Error.newBuilder() to construct. + private Error(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Error() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Error( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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: + { + com.google.rpc.Status.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + pointCount_ = input.readInt32(); + 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.MetricServiceProto + .internal_static_google_monitoring_v3_CreateTimeSeriesSummary_Error_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.MetricServiceProto + .internal_static_google_monitoring_v3_CreateTimeSeriesSummary_Error_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.CreateTimeSeriesSummary.Error.class, + com.google.monitoring.v3.CreateTimeSeriesSummary.Error.Builder.class); + } + + public static final int STATUS_FIELD_NUMBER = 1; + private com.google.rpc.Status status_; + /** + * + * + *
+     * The status of the requested write operation.
+     * 
+ * + * .google.rpc.Status status = 1; + */ + public boolean hasStatus() { + return status_ != null; + } + /** + * + * + *
+     * The status of the requested write operation.
+     * 
+ * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + /** + * + * + *
+     * The status of the requested write operation.
+     * 
+ * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + public static final int POINT_COUNT_FIELD_NUMBER = 2; + private int pointCount_; + /** + * + * + *
+     * The number of points that couldn't be written because of `status`.
+     * 
+ * + * int32 point_count = 2; + */ + public int getPointCount() { + return pointCount_; + } + + 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 (status_ != null) { + output.writeMessage(1, getStatus()); + } + if (pointCount_ != 0) { + output.writeInt32(2, pointCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStatus()); + } + if (pointCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pointCount_); + } + 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.CreateTimeSeriesSummary.Error)) { + return super.equals(obj); + } + com.google.monitoring.v3.CreateTimeSeriesSummary.Error other = + (com.google.monitoring.v3.CreateTimeSeriesSummary.Error) obj; + + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (getPointCount() != other.getPointCount()) 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(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (37 * hash) + POINT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPointCount(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary.Error parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary.Error 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.CreateTimeSeriesSummary.Error parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary.Error 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.CreateTimeSeriesSummary.Error parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary.Error parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary.Error parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary.Error 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.CreateTimeSeriesSummary.Error parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary.Error 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.CreateTimeSeriesSummary.Error parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary.Error 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.CreateTimeSeriesSummary.Error 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; + } + /** + * + * + *
+     * Detailed information about an error category.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.CreateTimeSeriesSummary.Error} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.CreateTimeSeriesSummary.Error) + com.google.monitoring.v3.CreateTimeSeriesSummary.ErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.MetricServiceProto + .internal_static_google_monitoring_v3_CreateTimeSeriesSummary_Error_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.MetricServiceProto + .internal_static_google_monitoring_v3_CreateTimeSeriesSummary_Error_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.CreateTimeSeriesSummary.Error.class, + com.google.monitoring.v3.CreateTimeSeriesSummary.Error.Builder.class); + } + + // Construct using com.google.monitoring.v3.CreateTimeSeriesSummary.Error.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(); + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + pointCount_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.MetricServiceProto + .internal_static_google_monitoring_v3_CreateTimeSeriesSummary_Error_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.CreateTimeSeriesSummary.Error getDefaultInstanceForType() { + return com.google.monitoring.v3.CreateTimeSeriesSummary.Error.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.CreateTimeSeriesSummary.Error build() { + com.google.monitoring.v3.CreateTimeSeriesSummary.Error result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.CreateTimeSeriesSummary.Error buildPartial() { + com.google.monitoring.v3.CreateTimeSeriesSummary.Error result = + new com.google.monitoring.v3.CreateTimeSeriesSummary.Error(this); + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + result.pointCount_ = pointCount_; + 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.CreateTimeSeriesSummary.Error) { + return mergeFrom((com.google.monitoring.v3.CreateTimeSeriesSummary.Error) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.CreateTimeSeriesSummary.Error other) { + if (other == com.google.monitoring.v3.CreateTimeSeriesSummary.Error.getDefaultInstance()) + return this; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.getPointCount() != 0) { + setPointCount(other.getPointCount()); + } + 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.CreateTimeSeriesSummary.Error parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.CreateTimeSeriesSummary.Error) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + /** + * + * + *
+       * The status of the requested write operation.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + /** + * + * + *
+       * The status of the requested write operation.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The status of the requested write operation.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The status of the requested write operation.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The status of the requested write operation.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The status of the requested write operation.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The status of the requested write operation.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The status of the requested write operation.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + /** + * + * + *
+       * The status of the requested write operation.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private int pointCount_; + /** + * + * + *
+       * The number of points that couldn't be written because of `status`.
+       * 
+ * + * int32 point_count = 2; + */ + public int getPointCount() { + return pointCount_; + } + /** + * + * + *
+       * The number of points that couldn't be written because of `status`.
+       * 
+ * + * int32 point_count = 2; + */ + public Builder setPointCount(int value) { + + pointCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of points that couldn't be written because of `status`.
+       * 
+ * + * int32 point_count = 2; + */ + public Builder clearPointCount() { + + pointCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.CreateTimeSeriesSummary.Error) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.CreateTimeSeriesSummary.Error) + private static final com.google.monitoring.v3.CreateTimeSeriesSummary.Error DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.CreateTimeSeriesSummary.Error(); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary.Error getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Error parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Error(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.CreateTimeSeriesSummary.Error getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int TOTAL_POINT_COUNT_FIELD_NUMBER = 1; + private int totalPointCount_; + /** + * + * + *
+   * The number of points in the request.
+   * 
+ * + * int32 total_point_count = 1; + */ + public int getTotalPointCount() { + return totalPointCount_; + } + + public static final int SUCCESS_POINT_COUNT_FIELD_NUMBER = 2; + private int successPointCount_; + /** + * + * + *
+   * The number of points that were successfully written.
+   * 
+ * + * int32 success_point_count = 2; + */ + public int getSuccessPointCount() { + return successPointCount_; + } + + public static final int ERRORS_FIELD_NUMBER = 3; + private java.util.List errors_; + /** + * + * + *
+   * The number of points that failed to be written. Order is not guaranteed.
+   * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public java.util.List getErrorsList() { + return errors_; + } + /** + * + * + *
+   * The number of points that failed to be written. Order is not guaranteed.
+   * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public java.util.List + getErrorsOrBuilderList() { + return errors_; + } + /** + * + * + *
+   * The number of points that failed to be written. Order is not guaranteed.
+   * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public int getErrorsCount() { + return errors_.size(); + } + /** + * + * + *
+   * The number of points that failed to be written. Order is not guaranteed.
+   * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public com.google.monitoring.v3.CreateTimeSeriesSummary.Error getErrors(int index) { + return errors_.get(index); + } + /** + * + * + *
+   * The number of points that failed to be written. Order is not guaranteed.
+   * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public com.google.monitoring.v3.CreateTimeSeriesSummary.ErrorOrBuilder getErrorsOrBuilder( + int index) { + return errors_.get(index); + } + + 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 (totalPointCount_ != 0) { + output.writeInt32(1, totalPointCount_); + } + if (successPointCount_ != 0) { + output.writeInt32(2, successPointCount_); + } + for (int i = 0; i < errors_.size(); i++) { + output.writeMessage(3, errors_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (totalPointCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, totalPointCount_); + } + if (successPointCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, successPointCount_); + } + for (int i = 0; i < errors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, errors_.get(i)); + } + 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.CreateTimeSeriesSummary)) { + return super.equals(obj); + } + com.google.monitoring.v3.CreateTimeSeriesSummary other = + (com.google.monitoring.v3.CreateTimeSeriesSummary) obj; + + if (getTotalPointCount() != other.getTotalPointCount()) return false; + if (getSuccessPointCount() != other.getSuccessPointCount()) return false; + if (!getErrorsList().equals(other.getErrorsList())) 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) + TOTAL_POINT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getTotalPointCount(); + hash = (37 * hash) + SUCCESS_POINT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getSuccessPointCount(); + if (getErrorsCount() > 0) { + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrorsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary 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.CreateTimeSeriesSummary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary 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.CreateTimeSeriesSummary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary 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.CreateTimeSeriesSummary parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary 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.CreateTimeSeriesSummary parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary 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.CreateTimeSeriesSummary 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; + } + /** + * + * + *
+   * Summary of the result of a failed request to write data to a time series.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.CreateTimeSeriesSummary} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.CreateTimeSeriesSummary) + com.google.monitoring.v3.CreateTimeSeriesSummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.MetricServiceProto + .internal_static_google_monitoring_v3_CreateTimeSeriesSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.MetricServiceProto + .internal_static_google_monitoring_v3_CreateTimeSeriesSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.CreateTimeSeriesSummary.class, + com.google.monitoring.v3.CreateTimeSeriesSummary.Builder.class); + } + + // Construct using com.google.monitoring.v3.CreateTimeSeriesSummary.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + totalPointCount_ = 0; + + successPointCount_ = 0; + + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + errorsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.MetricServiceProto + .internal_static_google_monitoring_v3_CreateTimeSeriesSummary_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.CreateTimeSeriesSummary getDefaultInstanceForType() { + return com.google.monitoring.v3.CreateTimeSeriesSummary.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.CreateTimeSeriesSummary build() { + com.google.monitoring.v3.CreateTimeSeriesSummary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.CreateTimeSeriesSummary buildPartial() { + com.google.monitoring.v3.CreateTimeSeriesSummary result = + new com.google.monitoring.v3.CreateTimeSeriesSummary(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.totalPointCount_ = totalPointCount_; + result.successPointCount_ = successPointCount_; + if (errorsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + errors_ = java.util.Collections.unmodifiableList(errors_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.errors_ = errors_; + } else { + result.errors_ = errorsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + 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.CreateTimeSeriesSummary) { + return mergeFrom((com.google.monitoring.v3.CreateTimeSeriesSummary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.CreateTimeSeriesSummary other) { + if (other == com.google.monitoring.v3.CreateTimeSeriesSummary.getDefaultInstance()) + return this; + if (other.getTotalPointCount() != 0) { + setTotalPointCount(other.getTotalPointCount()); + } + if (other.getSuccessPointCount() != 0) { + setSuccessPointCount(other.getSuccessPointCount()); + } + if (errorsBuilder_ == null) { + if (!other.errors_.isEmpty()) { + if (errors_.isEmpty()) { + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureErrorsIsMutable(); + errors_.addAll(other.errors_); + } + onChanged(); + } + } else { + if (!other.errors_.isEmpty()) { + if (errorsBuilder_.isEmpty()) { + errorsBuilder_.dispose(); + errorsBuilder_ = null; + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000004); + errorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorsFieldBuilder() + : null; + } else { + errorsBuilder_.addAllMessages(other.errors_); + } + } + } + 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.CreateTimeSeriesSummary parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.CreateTimeSeriesSummary) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int totalPointCount_; + /** + * + * + *
+     * The number of points in the request.
+     * 
+ * + * int32 total_point_count = 1; + */ + public int getTotalPointCount() { + return totalPointCount_; + } + /** + * + * + *
+     * The number of points in the request.
+     * 
+ * + * int32 total_point_count = 1; + */ + public Builder setTotalPointCount(int value) { + + totalPointCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of points in the request.
+     * 
+ * + * int32 total_point_count = 1; + */ + public Builder clearTotalPointCount() { + + totalPointCount_ = 0; + onChanged(); + return this; + } + + private int successPointCount_; + /** + * + * + *
+     * The number of points that were successfully written.
+     * 
+ * + * int32 success_point_count = 2; + */ + public int getSuccessPointCount() { + return successPointCount_; + } + /** + * + * + *
+     * The number of points that were successfully written.
+     * 
+ * + * int32 success_point_count = 2; + */ + public Builder setSuccessPointCount(int value) { + + successPointCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of points that were successfully written.
+     * 
+ * + * int32 success_point_count = 2; + */ + public Builder clearSuccessPointCount() { + + successPointCount_ = 0; + onChanged(); + return this; + } + + private java.util.List errors_ = + java.util.Collections.emptyList(); + + private void ensureErrorsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + errors_ = + new java.util.ArrayList( + errors_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.CreateTimeSeriesSummary.Error, + com.google.monitoring.v3.CreateTimeSeriesSummary.Error.Builder, + com.google.monitoring.v3.CreateTimeSeriesSummary.ErrorOrBuilder> + errorsBuilder_; + + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public java.util.List getErrorsList() { + if (errorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(errors_); + } else { + return errorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public int getErrorsCount() { + if (errorsBuilder_ == null) { + return errors_.size(); + } else { + return errorsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public com.google.monitoring.v3.CreateTimeSeriesSummary.Error getErrors(int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); + } else { + return errorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public Builder setErrors( + int index, com.google.monitoring.v3.CreateTimeSeriesSummary.Error value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.set(index, value); + onChanged(); + } else { + errorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public Builder setErrors( + int index, com.google.monitoring.v3.CreateTimeSeriesSummary.Error.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.set(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public Builder addErrors(com.google.monitoring.v3.CreateTimeSeriesSummary.Error value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(value); + onChanged(); + } else { + errorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public Builder addErrors( + int index, com.google.monitoring.v3.CreateTimeSeriesSummary.Error value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(index, value); + onChanged(); + } else { + errorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public Builder addErrors( + com.google.monitoring.v3.CreateTimeSeriesSummary.Error.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public Builder addErrors( + int index, com.google.monitoring.v3.CreateTimeSeriesSummary.Error.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public Builder addAllErrors( + java.lang.Iterable + values) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errors_); + onChanged(); + } else { + errorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public Builder clearErrors() { + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + errorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public Builder removeErrors(int index) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.remove(index); + onChanged(); + } else { + errorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public com.google.monitoring.v3.CreateTimeSeriesSummary.Error.Builder getErrorsBuilder( + int index) { + return getErrorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public com.google.monitoring.v3.CreateTimeSeriesSummary.ErrorOrBuilder getErrorsOrBuilder( + int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); + } else { + return errorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public java.util.List + getErrorsOrBuilderList() { + if (errorsBuilder_ != null) { + return errorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errors_); + } + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public com.google.monitoring.v3.CreateTimeSeriesSummary.Error.Builder addErrorsBuilder() { + return getErrorsFieldBuilder() + .addBuilder(com.google.monitoring.v3.CreateTimeSeriesSummary.Error.getDefaultInstance()); + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public com.google.monitoring.v3.CreateTimeSeriesSummary.Error.Builder addErrorsBuilder( + int index) { + return getErrorsFieldBuilder() + .addBuilder( + index, com.google.monitoring.v3.CreateTimeSeriesSummary.Error.getDefaultInstance()); + } + /** + * + * + *
+     * The number of points that failed to be written. Order is not guaranteed.
+     * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + public java.util.List + getErrorsBuilderList() { + return getErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.CreateTimeSeriesSummary.Error, + com.google.monitoring.v3.CreateTimeSeriesSummary.Error.Builder, + com.google.monitoring.v3.CreateTimeSeriesSummary.ErrorOrBuilder> + getErrorsFieldBuilder() { + if (errorsBuilder_ == null) { + errorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.CreateTimeSeriesSummary.Error, + com.google.monitoring.v3.CreateTimeSeriesSummary.Error.Builder, + com.google.monitoring.v3.CreateTimeSeriesSummary.ErrorOrBuilder>( + errors_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + errors_ = null; + } + return errorsBuilder_; + } + + @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.CreateTimeSeriesSummary) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.CreateTimeSeriesSummary) + private static final com.google.monitoring.v3.CreateTimeSeriesSummary DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.CreateTimeSeriesSummary(); + } + + public static com.google.monitoring.v3.CreateTimeSeriesSummary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTimeSeriesSummary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateTimeSeriesSummary(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.CreateTimeSeriesSummary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesSummaryOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesSummaryOrBuilder.java new file mode 100644 index 00000000..5602c0fd --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/CreateTimeSeriesSummaryOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2019 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/metric_service.proto + +package com.google.monitoring.v3; + +public interface CreateTimeSeriesSummaryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.CreateTimeSeriesSummary) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The number of points in the request.
+   * 
+ * + * int32 total_point_count = 1; + */ + int getTotalPointCount(); + + /** + * + * + *
+   * The number of points that were successfully written.
+   * 
+ * + * int32 success_point_count = 2; + */ + int getSuccessPointCount(); + + /** + * + * + *
+   * The number of points that failed to be written. Order is not guaranteed.
+   * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + java.util.List getErrorsList(); + /** + * + * + *
+   * The number of points that failed to be written. Order is not guaranteed.
+   * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + com.google.monitoring.v3.CreateTimeSeriesSummary.Error getErrors(int index); + /** + * + * + *
+   * The number of points that failed to be written. Order is not guaranteed.
+   * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + int getErrorsCount(); + /** + * + * + *
+   * The number of points that failed to be written. Order is not guaranteed.
+   * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + java.util.List + getErrorsOrBuilderList(); + /** + * + * + *
+   * The number of points that failed to be written. Order is not guaranteed.
+   * 
+ * + * repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + com.google.monitoring.v3.CreateTimeSeriesSummary.ErrorOrBuilder getErrorsOrBuilder(int index); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceLevelObjectiveRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceLevelObjectiveRequest.java new file mode 100644 index 00000000..09489f0b --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceLevelObjectiveRequest.java @@ -0,0 +1,629 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `DeleteServiceLevelObjective` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.DeleteServiceLevelObjectiveRequest} + */ +public final class DeleteServiceLevelObjectiveRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.DeleteServiceLevelObjectiveRequest) + DeleteServiceLevelObjectiveRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteServiceLevelObjectiveRequest.newBuilder() to construct. + private DeleteServiceLevelObjectiveRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteServiceLevelObjectiveRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteServiceLevelObjectiveRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + name_ = 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.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_DeleteServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_DeleteServiceLevelObjectiveRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.class, + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name of the `ServiceLevelObjective` to delete.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the `ServiceLevelObjective` to delete.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.DeleteServiceLevelObjectiveRequest)) { + return super.equals(obj); + } + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest other = + (com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest 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.DeleteServiceLevelObjectiveRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest 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.DeleteServiceLevelObjectiveRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest 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.DeleteServiceLevelObjectiveRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest 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.DeleteServiceLevelObjectiveRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest 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.DeleteServiceLevelObjectiveRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `DeleteServiceLevelObjective` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.DeleteServiceLevelObjectiveRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.DeleteServiceLevelObjectiveRequest) + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_DeleteServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_DeleteServiceLevelObjectiveRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.class, + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.Builder.class); + } + + // Construct using com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.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(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_DeleteServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest getDefaultInstanceForType() { + return com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest build() { + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest buildPartial() { + com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest result = + new com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest(this); + result.name_ = name_; + 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.DeleteServiceLevelObjectiveRequest) { + return mergeFrom((com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest other) { + if (other == com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.DeleteServiceLevelObjectiveRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name of the `ServiceLevelObjective` to delete.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the `ServiceLevelObjective` to delete.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the `ServiceLevelObjective` to delete.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the `ServiceLevelObjective` to delete.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the `ServiceLevelObjective` to delete.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.DeleteServiceLevelObjectiveRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.DeleteServiceLevelObjectiveRequest) + private static final com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest(); + } + + public static com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteServiceLevelObjectiveRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteServiceLevelObjectiveRequest(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.DeleteServiceLevelObjectiveRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceLevelObjectiveRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceLevelObjectiveRequestOrBuilder.java new file mode 100644 index 00000000..4567aca9 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceLevelObjectiveRequestOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface DeleteServiceLevelObjectiveRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.DeleteServiceLevelObjectiveRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the `ServiceLevelObjective` to delete.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name of the `ServiceLevelObjective` to delete.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceRequest.java new file mode 100644 index 00000000..dfd193f2 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceRequest.java @@ -0,0 +1,618 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `DeleteService` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.DeleteServiceRequest} + */ +public final class DeleteServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.DeleteServiceRequest) + DeleteServiceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteServiceRequest.newBuilder() to construct. + private DeleteServiceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteServiceRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteServiceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + name_ = 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.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_DeleteServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_DeleteServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.DeleteServiceRequest.class, + com.google.monitoring.v3.DeleteServiceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name of the `Service` to delete.
+   * Of the form `projects/{project_id}/service/{service_id}`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the `Service` to delete.
+   * Of the form `projects/{project_id}/service/{service_id}`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.DeleteServiceRequest)) { + return super.equals(obj); + } + com.google.monitoring.v3.DeleteServiceRequest other = + (com.google.monitoring.v3.DeleteServiceRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.DeleteServiceRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DeleteServiceRequest 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.DeleteServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DeleteServiceRequest 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.DeleteServiceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DeleteServiceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.DeleteServiceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DeleteServiceRequest 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.DeleteServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DeleteServiceRequest 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.DeleteServiceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DeleteServiceRequest 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.DeleteServiceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `DeleteService` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.DeleteServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.DeleteServiceRequest) + com.google.monitoring.v3.DeleteServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_DeleteServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_DeleteServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.DeleteServiceRequest.class, + com.google.monitoring.v3.DeleteServiceRequest.Builder.class); + } + + // Construct using com.google.monitoring.v3.DeleteServiceRequest.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(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_DeleteServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.DeleteServiceRequest getDefaultInstanceForType() { + return com.google.monitoring.v3.DeleteServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.DeleteServiceRequest build() { + com.google.monitoring.v3.DeleteServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.DeleteServiceRequest buildPartial() { + com.google.monitoring.v3.DeleteServiceRequest result = + new com.google.monitoring.v3.DeleteServiceRequest(this); + result.name_ = name_; + 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.DeleteServiceRequest) { + return mergeFrom((com.google.monitoring.v3.DeleteServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.DeleteServiceRequest other) { + if (other == com.google.monitoring.v3.DeleteServiceRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.DeleteServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.DeleteServiceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name of the `Service` to delete.
+     * Of the form `projects/{project_id}/service/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the `Service` to delete.
+     * Of the form `projects/{project_id}/service/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the `Service` to delete.
+     * Of the form `projects/{project_id}/service/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the `Service` to delete.
+     * Of the form `projects/{project_id}/service/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the `Service` to delete.
+     * Of the form `projects/{project_id}/service/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.DeleteServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.DeleteServiceRequest) + private static final com.google.monitoring.v3.DeleteServiceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.DeleteServiceRequest(); + } + + public static com.google.monitoring.v3.DeleteServiceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteServiceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteServiceRequest(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.DeleteServiceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceRequestOrBuilder.java new file mode 100644 index 00000000..439d670b --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DeleteServiceRequestOrBuilder.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface DeleteServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.DeleteServiceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the `Service` to delete.
+   * Of the form `projects/{project_id}/service/{service_id}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name of the `Service` to delete.
+   * Of the form `projects/{project_id}/service/{service_id}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DistributionCut.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DistributionCut.java new file mode 100644 index 00000000..60b8960f --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DistributionCut.java @@ -0,0 +1,901 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * A `DistributionCut` defines a `TimeSeries` and thresholds used for measuring
+ * good service and total service. The `TimeSeries` must have `ValueType =
+ * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. The
+ * computed `good_service` will be the count of values x in the `Distribution`
+ * such that `range.min <= x < range.max`.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.DistributionCut} + */ +public final class DistributionCut extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.DistributionCut) + DistributionCutOrBuilder { + private static final long serialVersionUID = 0L; + // Use DistributionCut.newBuilder() to construct. + private DistributionCut(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DistributionCut() { + distributionFilter_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DistributionCut( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + distributionFilter_ = s; + break; + } + case 42: + { + com.google.monitoring.v3.Range.Builder subBuilder = null; + if (range_ != null) { + subBuilder = range_.toBuilder(); + } + range_ = + input.readMessage(com.google.monitoring.v3.Range.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(range_); + range_ = 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.ServiceMonitoringProto + .internal_static_google_monitoring_v3_DistributionCut_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_DistributionCut_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.DistributionCut.class, + com.google.monitoring.v3.DistributionCut.Builder.class); + } + + public static final int DISTRIBUTION_FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object distributionFilter_; + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` aggregating values. Must have `ValueType =
+   * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string distribution_filter = 4; + */ + public java.lang.String getDistributionFilter() { + java.lang.Object ref = distributionFilter_; + 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(); + distributionFilter_ = s; + return s; + } + } + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` aggregating values. Must have `ValueType =
+   * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string distribution_filter = 4; + */ + public com.google.protobuf.ByteString getDistributionFilterBytes() { + java.lang.Object ref = distributionFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + distributionFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RANGE_FIELD_NUMBER = 5; + private com.google.monitoring.v3.Range range_; + /** + * + * + *
+   * Range of values considered "good." For a one-sided range, set one bound to
+   * an infinite value.
+   * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + public boolean hasRange() { + return range_ != null; + } + /** + * + * + *
+   * Range of values considered "good." For a one-sided range, set one bound to
+   * an infinite value.
+   * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + public com.google.monitoring.v3.Range getRange() { + return range_ == null ? com.google.monitoring.v3.Range.getDefaultInstance() : range_; + } + /** + * + * + *
+   * Range of values considered "good." For a one-sided range, set one bound to
+   * an infinite value.
+   * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + public com.google.monitoring.v3.RangeOrBuilder getRangeOrBuilder() { + return getRange(); + } + + 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 (!getDistributionFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, distributionFilter_); + } + if (range_ != null) { + output.writeMessage(5, getRange()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDistributionFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, distributionFilter_); + } + if (range_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getRange()); + } + 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.DistributionCut)) { + return super.equals(obj); + } + com.google.monitoring.v3.DistributionCut other = (com.google.monitoring.v3.DistributionCut) obj; + + if (!getDistributionFilter().equals(other.getDistributionFilter())) return false; + if (hasRange() != other.hasRange()) return false; + if (hasRange()) { + if (!getRange().equals(other.getRange())) 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) + DISTRIBUTION_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getDistributionFilter().hashCode(); + if (hasRange()) { + hash = (37 * hash) + RANGE_FIELD_NUMBER; + hash = (53 * hash) + getRange().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.DistributionCut parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DistributionCut 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.DistributionCut parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DistributionCut 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.DistributionCut parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DistributionCut parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.DistributionCut parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DistributionCut 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.DistributionCut parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DistributionCut 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.DistributionCut parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DistributionCut 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.DistributionCut 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 `DistributionCut` defines a `TimeSeries` and thresholds used for measuring
+   * good service and total service. The `TimeSeries` must have `ValueType =
+   * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. The
+   * computed `good_service` will be the count of values x in the `Distribution`
+   * such that `range.min <= x < range.max`.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.DistributionCut} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.DistributionCut) + com.google.monitoring.v3.DistributionCutOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_DistributionCut_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_DistributionCut_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.DistributionCut.class, + com.google.monitoring.v3.DistributionCut.Builder.class); + } + + // Construct using com.google.monitoring.v3.DistributionCut.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(); + distributionFilter_ = ""; + + if (rangeBuilder_ == null) { + range_ = null; + } else { + range_ = null; + rangeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_DistributionCut_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.DistributionCut getDefaultInstanceForType() { + return com.google.monitoring.v3.DistributionCut.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.DistributionCut build() { + com.google.monitoring.v3.DistributionCut result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.DistributionCut buildPartial() { + com.google.monitoring.v3.DistributionCut result = + new com.google.monitoring.v3.DistributionCut(this); + result.distributionFilter_ = distributionFilter_; + if (rangeBuilder_ == null) { + result.range_ = range_; + } else { + result.range_ = rangeBuilder_.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.DistributionCut) { + return mergeFrom((com.google.monitoring.v3.DistributionCut) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.DistributionCut other) { + if (other == com.google.monitoring.v3.DistributionCut.getDefaultInstance()) return this; + if (!other.getDistributionFilter().isEmpty()) { + distributionFilter_ = other.distributionFilter_; + onChanged(); + } + if (other.hasRange()) { + mergeRange(other.getRange()); + } + 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.DistributionCut parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.DistributionCut) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object distributionFilter_ = ""; + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` aggregating values. Must have `ValueType =
+     * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string distribution_filter = 4; + */ + public java.lang.String getDistributionFilter() { + java.lang.Object ref = distributionFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + distributionFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` aggregating values. Must have `ValueType =
+     * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string distribution_filter = 4; + */ + public com.google.protobuf.ByteString getDistributionFilterBytes() { + java.lang.Object ref = distributionFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + distributionFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` aggregating values. Must have `ValueType =
+     * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string distribution_filter = 4; + */ + public Builder setDistributionFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + distributionFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` aggregating values. Must have `ValueType =
+     * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string distribution_filter = 4; + */ + public Builder clearDistributionFilter() { + + distributionFilter_ = getDefaultInstance().getDistributionFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` aggregating values. Must have `ValueType =
+     * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string distribution_filter = 4; + */ + public Builder setDistributionFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + distributionFilter_ = value; + onChanged(); + return this; + } + + private com.google.monitoring.v3.Range range_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Range, + com.google.monitoring.v3.Range.Builder, + com.google.monitoring.v3.RangeOrBuilder> + rangeBuilder_; + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound to
+     * an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + public boolean hasRange() { + return rangeBuilder_ != null || range_ != null; + } + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound to
+     * an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + public com.google.monitoring.v3.Range getRange() { + if (rangeBuilder_ == null) { + return range_ == null ? com.google.monitoring.v3.Range.getDefaultInstance() : range_; + } else { + return rangeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound to
+     * an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + public Builder setRange(com.google.monitoring.v3.Range value) { + if (rangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + range_ = value; + onChanged(); + } else { + rangeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound to
+     * an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + public Builder setRange(com.google.monitoring.v3.Range.Builder builderForValue) { + if (rangeBuilder_ == null) { + range_ = builderForValue.build(); + onChanged(); + } else { + rangeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound to
+     * an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + public Builder mergeRange(com.google.monitoring.v3.Range value) { + if (rangeBuilder_ == null) { + if (range_ != null) { + range_ = + com.google.monitoring.v3.Range.newBuilder(range_).mergeFrom(value).buildPartial(); + } else { + range_ = value; + } + onChanged(); + } else { + rangeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound to
+     * an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + public Builder clearRange() { + if (rangeBuilder_ == null) { + range_ = null; + onChanged(); + } else { + range_ = null; + rangeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound to
+     * an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + public com.google.monitoring.v3.Range.Builder getRangeBuilder() { + + onChanged(); + return getRangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound to
+     * an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + public com.google.monitoring.v3.RangeOrBuilder getRangeOrBuilder() { + if (rangeBuilder_ != null) { + return rangeBuilder_.getMessageOrBuilder(); + } else { + return range_ == null ? com.google.monitoring.v3.Range.getDefaultInstance() : range_; + } + } + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound to
+     * an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Range, + com.google.monitoring.v3.Range.Builder, + com.google.monitoring.v3.RangeOrBuilder> + getRangeFieldBuilder() { + if (rangeBuilder_ == null) { + rangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Range, + com.google.monitoring.v3.Range.Builder, + com.google.monitoring.v3.RangeOrBuilder>( + getRange(), getParentForChildren(), isClean()); + range_ = null; + } + return rangeBuilder_; + } + + @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.DistributionCut) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.DistributionCut) + private static final com.google.monitoring.v3.DistributionCut DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.DistributionCut(); + } + + public static com.google.monitoring.v3.DistributionCut getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DistributionCut parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DistributionCut(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.DistributionCut getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DistributionCutOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DistributionCutOrBuilder.java new file mode 100644 index 00000000..7758f2ec --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DistributionCutOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +public interface DistributionCutOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.DistributionCut) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` aggregating values. Must have `ValueType =
+   * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string distribution_filter = 4; + */ + java.lang.String getDistributionFilter(); + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` aggregating values. Must have `ValueType =
+   * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string distribution_filter = 4; + */ + com.google.protobuf.ByteString getDistributionFilterBytes(); + + /** + * + * + *
+   * Range of values considered "good." For a one-sided range, set one bound to
+   * an infinite value.
+   * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + boolean hasRange(); + /** + * + * + *
+   * Range of values considered "good." For a one-sided range, set one bound to
+   * an infinite value.
+   * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + com.google.monitoring.v3.Range getRange(); + /** + * + * + *
+   * Range of values considered "good." For a one-sided range, set one bound to
+   * an infinite value.
+   * 
+ * + * .google.monitoring.v3.Range range = 5; + */ + com.google.monitoring.v3.RangeOrBuilder getRangeOrBuilder(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceLevelObjectiveRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceLevelObjectiveRequest.java new file mode 100644 index 00000000..0f0319a4 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceLevelObjectiveRequest.java @@ -0,0 +1,783 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `GetServiceLevelObjective` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.GetServiceLevelObjectiveRequest} + */ +public final class GetServiceLevelObjectiveRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.GetServiceLevelObjectiveRequest) + GetServiceLevelObjectiveRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetServiceLevelObjectiveRequest.newBuilder() to construct. + private GetServiceLevelObjectiveRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetServiceLevelObjectiveRequest() { + name_ = ""; + view_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetServiceLevelObjectiveRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + view_ = rawValue; + 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.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_GetServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_GetServiceLevelObjectiveRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.GetServiceLevelObjectiveRequest.class, + com.google.monitoring.v3.GetServiceLevelObjectiveRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name of the `ServiceLevelObjective` to get.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the `ServiceLevelObjective` to get.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 2; + private int view_; + /** + * + * + *
+   * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the
+   * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+   * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+   * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 2; + */ + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the
+   * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+   * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+   * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 2; + */ + public com.google.monitoring.v3.ServiceLevelObjective.View getView() { + @SuppressWarnings("deprecation") + com.google.monitoring.v3.ServiceLevelObjective.View result = + com.google.monitoring.v3.ServiceLevelObjective.View.valueOf(view_); + return result == null + ? com.google.monitoring.v3.ServiceLevelObjective.View.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (view_ != com.google.monitoring.v3.ServiceLevelObjective.View.VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (view_ != com.google.monitoring.v3.ServiceLevelObjective.View.VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + 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.GetServiceLevelObjectiveRequest)) { + return super.equals(obj); + } + com.google.monitoring.v3.GetServiceLevelObjectiveRequest other = + (com.google.monitoring.v3.GetServiceLevelObjectiveRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.GetServiceLevelObjectiveRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.GetServiceLevelObjectiveRequest 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.GetServiceLevelObjectiveRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.GetServiceLevelObjectiveRequest 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.GetServiceLevelObjectiveRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.GetServiceLevelObjectiveRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.GetServiceLevelObjectiveRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.GetServiceLevelObjectiveRequest 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.GetServiceLevelObjectiveRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.GetServiceLevelObjectiveRequest 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.GetServiceLevelObjectiveRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.GetServiceLevelObjectiveRequest 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.GetServiceLevelObjectiveRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `GetServiceLevelObjective` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.GetServiceLevelObjectiveRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.GetServiceLevelObjectiveRequest) + com.google.monitoring.v3.GetServiceLevelObjectiveRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_GetServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_GetServiceLevelObjectiveRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.GetServiceLevelObjectiveRequest.class, + com.google.monitoring.v3.GetServiceLevelObjectiveRequest.Builder.class); + } + + // Construct using com.google.monitoring.v3.GetServiceLevelObjectiveRequest.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(); + name_ = ""; + + view_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_GetServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.GetServiceLevelObjectiveRequest getDefaultInstanceForType() { + return com.google.monitoring.v3.GetServiceLevelObjectiveRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.GetServiceLevelObjectiveRequest build() { + com.google.monitoring.v3.GetServiceLevelObjectiveRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.GetServiceLevelObjectiveRequest buildPartial() { + com.google.monitoring.v3.GetServiceLevelObjectiveRequest result = + new com.google.monitoring.v3.GetServiceLevelObjectiveRequest(this); + result.name_ = name_; + result.view_ = view_; + 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.GetServiceLevelObjectiveRequest) { + return mergeFrom((com.google.monitoring.v3.GetServiceLevelObjectiveRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.GetServiceLevelObjectiveRequest other) { + if (other == com.google.monitoring.v3.GetServiceLevelObjectiveRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + 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.GetServiceLevelObjectiveRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.GetServiceLevelObjectiveRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name of the `ServiceLevelObjective` to get.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the `ServiceLevelObjective` to get.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the `ServiceLevelObjective` to get.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the `ServiceLevelObjective` to get.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the `ServiceLevelObjective` to get.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the
+     * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+     * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+     * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 2; + */ + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the
+     * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+     * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+     * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 2; + */ + public Builder setViewValue(int value) { + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the
+     * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+     * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+     * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 2; + */ + public com.google.monitoring.v3.ServiceLevelObjective.View getView() { + @SuppressWarnings("deprecation") + com.google.monitoring.v3.ServiceLevelObjective.View result = + com.google.monitoring.v3.ServiceLevelObjective.View.valueOf(view_); + return result == null + ? com.google.monitoring.v3.ServiceLevelObjective.View.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the
+     * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+     * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+     * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 2; + */ + public Builder setView(com.google.monitoring.v3.ServiceLevelObjective.View value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the
+     * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+     * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+     * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 2; + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.GetServiceLevelObjectiveRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.GetServiceLevelObjectiveRequest) + private static final com.google.monitoring.v3.GetServiceLevelObjectiveRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.GetServiceLevelObjectiveRequest(); + } + + public static com.google.monitoring.v3.GetServiceLevelObjectiveRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetServiceLevelObjectiveRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetServiceLevelObjectiveRequest(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.GetServiceLevelObjectiveRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceLevelObjectiveRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceLevelObjectiveRequestOrBuilder.java new file mode 100644 index 00000000..db24b3a0 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceLevelObjectiveRequestOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface GetServiceLevelObjectiveRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.GetServiceLevelObjectiveRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the `ServiceLevelObjective` to get.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name of the `ServiceLevelObjective` to get.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the
+   * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+   * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+   * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 2; + */ + int getViewValue(); + /** + * + * + *
+   * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the
+   * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+   * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+   * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 2; + */ + com.google.monitoring.v3.ServiceLevelObjective.View getView(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceRequest.java new file mode 100644 index 00000000..9a491278 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceRequest.java @@ -0,0 +1,618 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `GetService` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.GetServiceRequest} + */ +public final class GetServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.GetServiceRequest) + GetServiceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetServiceRequest.newBuilder() to construct. + private GetServiceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetServiceRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetServiceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + name_ = 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.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_GetServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_GetServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.GetServiceRequest.class, + com.google.monitoring.v3.GetServiceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name of the `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.GetServiceRequest)) { + return super.equals(obj); + } + com.google.monitoring.v3.GetServiceRequest other = + (com.google.monitoring.v3.GetServiceRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.GetServiceRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.GetServiceRequest 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.GetServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.GetServiceRequest 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.GetServiceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.GetServiceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.GetServiceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.GetServiceRequest 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.GetServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.GetServiceRequest 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.GetServiceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.GetServiceRequest 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.GetServiceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `GetService` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.GetServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.GetServiceRequest) + com.google.monitoring.v3.GetServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_GetServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_GetServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.GetServiceRequest.class, + com.google.monitoring.v3.GetServiceRequest.Builder.class); + } + + // Construct using com.google.monitoring.v3.GetServiceRequest.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(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_GetServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.GetServiceRequest getDefaultInstanceForType() { + return com.google.monitoring.v3.GetServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.GetServiceRequest build() { + com.google.monitoring.v3.GetServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.GetServiceRequest buildPartial() { + com.google.monitoring.v3.GetServiceRequest result = + new com.google.monitoring.v3.GetServiceRequest(this); + result.name_ = name_; + 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.GetServiceRequest) { + return mergeFrom((com.google.monitoring.v3.GetServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.GetServiceRequest other) { + if (other == com.google.monitoring.v3.GetServiceRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.GetServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.GetServiceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name of the `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.GetServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.GetServiceRequest) + private static final com.google.monitoring.v3.GetServiceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.GetServiceRequest(); + } + + public static com.google.monitoring.v3.GetServiceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetServiceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetServiceRequest(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.GetServiceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceRequestOrBuilder.java new file mode 100644 index 00000000..c51f6712 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GetServiceRequestOrBuilder.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface GetServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.GetServiceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name of the `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesRequest.java new file mode 100644 index 00000000..eb2484a0 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesRequest.java @@ -0,0 +1,1195 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `ListServiceLevelObjectives` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.ListServiceLevelObjectivesRequest} + */ +public final class ListServiceLevelObjectivesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.ListServiceLevelObjectivesRequest) + ListServiceLevelObjectivesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServiceLevelObjectivesRequest.newBuilder() to construct. + private ListServiceLevelObjectivesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServiceLevelObjectivesRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + view_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServiceLevelObjectivesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 40: + { + int rawValue = input.readEnum(); + + view_ = rawValue; + 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.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServiceLevelObjectivesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServiceLevelObjectivesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ListServiceLevelObjectivesRequest.class, + com.google.monitoring.v3.ListServiceLevelObjectivesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Resource name of the parent `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the parent `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * A filter specifying what `ServiceLevelObjective`s to return.
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filter specifying what `ServiceLevelObjective`s to return.
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * A non-negative number that is the maximum number of results to return.
+   * When 0, use default page size.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 5; + private int view_; + /** + * + * + *
+   * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each
+   * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+   * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+   * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 5; + */ + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each
+   * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+   * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+   * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 5; + */ + public com.google.monitoring.v3.ServiceLevelObjective.View getView() { + @SuppressWarnings("deprecation") + com.google.monitoring.v3.ServiceLevelObjective.View result = + com.google.monitoring.v3.ServiceLevelObjective.View.valueOf(view_); + return result == null + ? com.google.monitoring.v3.ServiceLevelObjective.View.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + if (view_ != com.google.monitoring.v3.ServiceLevelObjective.View.VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(5, view_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + if (view_ != com.google.monitoring.v3.ServiceLevelObjective.View.VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, view_); + } + 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.ListServiceLevelObjectivesRequest)) { + return super.equals(obj); + } + com.google.monitoring.v3.ListServiceLevelObjectivesRequest other = + (com.google.monitoring.v3.ListServiceLevelObjectivesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (view_ != other.view_) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesRequest 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.ListServiceLevelObjectivesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesRequest 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.ListServiceLevelObjectivesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesRequest 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.ListServiceLevelObjectivesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesRequest 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.ListServiceLevelObjectivesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesRequest 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.ListServiceLevelObjectivesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `ListServiceLevelObjectives` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.ListServiceLevelObjectivesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.ListServiceLevelObjectivesRequest) + com.google.monitoring.v3.ListServiceLevelObjectivesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServiceLevelObjectivesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServiceLevelObjectivesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ListServiceLevelObjectivesRequest.class, + com.google.monitoring.v3.ListServiceLevelObjectivesRequest.Builder.class); + } + + // Construct using com.google.monitoring.v3.ListServiceLevelObjectivesRequest.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(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + view_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServiceLevelObjectivesRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.ListServiceLevelObjectivesRequest getDefaultInstanceForType() { + return com.google.monitoring.v3.ListServiceLevelObjectivesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.ListServiceLevelObjectivesRequest build() { + com.google.monitoring.v3.ListServiceLevelObjectivesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.ListServiceLevelObjectivesRequest buildPartial() { + com.google.monitoring.v3.ListServiceLevelObjectivesRequest result = + new com.google.monitoring.v3.ListServiceLevelObjectivesRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.view_ = view_; + 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.ListServiceLevelObjectivesRequest) { + return mergeFrom((com.google.monitoring.v3.ListServiceLevelObjectivesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.ListServiceLevelObjectivesRequest other) { + if (other == com.google.monitoring.v3.ListServiceLevelObjectivesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + 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.ListServiceLevelObjectivesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.ListServiceLevelObjectivesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Resource name of the parent `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the parent `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the parent `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent `Service`.
+     * Of the form `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filter specifying what `ServiceLevelObjective`s to return.
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filter specifying what `ServiceLevelObjective`s to return.
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filter specifying what `ServiceLevelObjective`s to return.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A filter specifying what `ServiceLevelObjective`s to return.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A filter specifying what `ServiceLevelObjective`s to return.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * A non-negative number that is the maximum number of results to return.
+     * When 0, use default page size.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * A non-negative number that is the maximum number of results to return.
+     * When 0, use default page size.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A non-negative number that is the maximum number of results to return.
+     * When 0, use default page size.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 4; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each
+     * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+     * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+     * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 5; + */ + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each
+     * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+     * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+     * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 5; + */ + public Builder setViewValue(int value) { + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each
+     * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+     * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+     * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 5; + */ + public com.google.monitoring.v3.ServiceLevelObjective.View getView() { + @SuppressWarnings("deprecation") + com.google.monitoring.v3.ServiceLevelObjective.View result = + com.google.monitoring.v3.ServiceLevelObjective.View.valueOf(view_); + return result == null + ? com.google.monitoring.v3.ServiceLevelObjective.View.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each
+     * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+     * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+     * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 5; + */ + public Builder setView(com.google.monitoring.v3.ServiceLevelObjective.View value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each
+     * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+     * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+     * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 5; + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.ListServiceLevelObjectivesRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.ListServiceLevelObjectivesRequest) + private static final com.google.monitoring.v3.ListServiceLevelObjectivesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.ListServiceLevelObjectivesRequest(); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServiceLevelObjectivesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServiceLevelObjectivesRequest(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.ListServiceLevelObjectivesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesRequestOrBuilder.java new file mode 100644 index 00000000..c4239913 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesRequestOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface ListServiceLevelObjectivesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.ListServiceLevelObjectivesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the parent `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Resource name of the parent `Service`.
+   * Of the form `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * A filter specifying what `ServiceLevelObjective`s to return.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filter specifying what `ServiceLevelObjective`s to return.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * A non-negative number that is the maximum number of results to return.
+   * When 0, use default page size.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); + + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 4; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 4; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each
+   * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+   * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+   * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 5; + */ + int getViewValue(); + /** + * + * + *
+   * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each
+   * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
+   * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
+   * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective.View view = 5; + */ + com.google.monitoring.v3.ServiceLevelObjective.View getView(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesResponse.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesResponse.java new file mode 100644 index 00000000..7fe405e1 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesResponse.java @@ -0,0 +1,1155 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `ListServiceLevelObjectives` response.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.ListServiceLevelObjectivesResponse} + */ +public final class ListServiceLevelObjectivesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.ListServiceLevelObjectivesResponse) + ListServiceLevelObjectivesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServiceLevelObjectivesResponse.newBuilder() to construct. + private ListServiceLevelObjectivesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServiceLevelObjectivesResponse() { + serviceLevelObjectives_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServiceLevelObjectivesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + serviceLevelObjectives_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + serviceLevelObjectives_.add( + input.readMessage( + com.google.monitoring.v3.ServiceLevelObjective.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + serviceLevelObjectives_ = java.util.Collections.unmodifiableList(serviceLevelObjectives_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServiceLevelObjectivesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServiceLevelObjectivesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ListServiceLevelObjectivesResponse.class, + com.google.monitoring.v3.ListServiceLevelObjectivesResponse.Builder.class); + } + + private int bitField0_; + public static final int SERVICE_LEVEL_OBJECTIVES_FIELD_NUMBER = 1; + private java.util.List serviceLevelObjectives_; + /** + * + * + *
+   * The `ServiceLevelObjective`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + */ + public java.util.List + getServiceLevelObjectivesList() { + return serviceLevelObjectives_; + } + /** + * + * + *
+   * The `ServiceLevelObjective`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + */ + public java.util.List + getServiceLevelObjectivesOrBuilderList() { + return serviceLevelObjectives_; + } + /** + * + * + *
+   * The `ServiceLevelObjective`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + */ + public int getServiceLevelObjectivesCount() { + return serviceLevelObjectives_.size(); + } + /** + * + * + *
+   * The `ServiceLevelObjective`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + */ + public com.google.monitoring.v3.ServiceLevelObjective getServiceLevelObjectives(int index) { + return serviceLevelObjectives_.get(index); + } + /** + * + * + *
+   * The `ServiceLevelObjective`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + */ + public com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder getServiceLevelObjectivesOrBuilder( + int index) { + return serviceLevelObjectives_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < serviceLevelObjectives_.size(); i++) { + output.writeMessage(1, serviceLevelObjectives_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < serviceLevelObjectives_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, serviceLevelObjectives_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + 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.ListServiceLevelObjectivesResponse)) { + return super.equals(obj); + } + com.google.monitoring.v3.ListServiceLevelObjectivesResponse other = + (com.google.monitoring.v3.ListServiceLevelObjectivesResponse) obj; + + if (!getServiceLevelObjectivesList().equals(other.getServiceLevelObjectivesList())) + return false; + if (!getNextPageToken().equals(other.getNextPageToken())) 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(); + if (getServiceLevelObjectivesCount() > 0) { + hash = (37 * hash) + SERVICE_LEVEL_OBJECTIVES_FIELD_NUMBER; + hash = (53 * hash) + getServiceLevelObjectivesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesResponse 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.ListServiceLevelObjectivesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesResponse 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.ListServiceLevelObjectivesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesResponse 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.ListServiceLevelObjectivesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesResponse 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.ListServiceLevelObjectivesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesResponse 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.ListServiceLevelObjectivesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `ListServiceLevelObjectives` response.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.ListServiceLevelObjectivesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.ListServiceLevelObjectivesResponse) + com.google.monitoring.v3.ListServiceLevelObjectivesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServiceLevelObjectivesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServiceLevelObjectivesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ListServiceLevelObjectivesResponse.class, + com.google.monitoring.v3.ListServiceLevelObjectivesResponse.Builder.class); + } + + // Construct using com.google.monitoring.v3.ListServiceLevelObjectivesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getServiceLevelObjectivesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (serviceLevelObjectivesBuilder_ == null) { + serviceLevelObjectives_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + serviceLevelObjectivesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServiceLevelObjectivesResponse_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.ListServiceLevelObjectivesResponse getDefaultInstanceForType() { + return com.google.monitoring.v3.ListServiceLevelObjectivesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.ListServiceLevelObjectivesResponse build() { + com.google.monitoring.v3.ListServiceLevelObjectivesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.ListServiceLevelObjectivesResponse buildPartial() { + com.google.monitoring.v3.ListServiceLevelObjectivesResponse result = + new com.google.monitoring.v3.ListServiceLevelObjectivesResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (serviceLevelObjectivesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + serviceLevelObjectives_ = java.util.Collections.unmodifiableList(serviceLevelObjectives_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.serviceLevelObjectives_ = serviceLevelObjectives_; + } else { + result.serviceLevelObjectives_ = serviceLevelObjectivesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + 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.ListServiceLevelObjectivesResponse) { + return mergeFrom((com.google.monitoring.v3.ListServiceLevelObjectivesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.ListServiceLevelObjectivesResponse other) { + if (other == com.google.monitoring.v3.ListServiceLevelObjectivesResponse.getDefaultInstance()) + return this; + if (serviceLevelObjectivesBuilder_ == null) { + if (!other.serviceLevelObjectives_.isEmpty()) { + if (serviceLevelObjectives_.isEmpty()) { + serviceLevelObjectives_ = other.serviceLevelObjectives_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServiceLevelObjectivesIsMutable(); + serviceLevelObjectives_.addAll(other.serviceLevelObjectives_); + } + onChanged(); + } + } else { + if (!other.serviceLevelObjectives_.isEmpty()) { + if (serviceLevelObjectivesBuilder_.isEmpty()) { + serviceLevelObjectivesBuilder_.dispose(); + serviceLevelObjectivesBuilder_ = null; + serviceLevelObjectives_ = other.serviceLevelObjectives_; + bitField0_ = (bitField0_ & ~0x00000001); + serviceLevelObjectivesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getServiceLevelObjectivesFieldBuilder() + : null; + } else { + serviceLevelObjectivesBuilder_.addAllMessages(other.serviceLevelObjectives_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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.ListServiceLevelObjectivesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.ListServiceLevelObjectivesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List serviceLevelObjectives_ = + java.util.Collections.emptyList(); + + private void ensureServiceLevelObjectivesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + serviceLevelObjectives_ = + new java.util.ArrayList( + serviceLevelObjectives_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelObjective, + com.google.monitoring.v3.ServiceLevelObjective.Builder, + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder> + serviceLevelObjectivesBuilder_; + + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public java.util.List + getServiceLevelObjectivesList() { + if (serviceLevelObjectivesBuilder_ == null) { + return java.util.Collections.unmodifiableList(serviceLevelObjectives_); + } else { + return serviceLevelObjectivesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public int getServiceLevelObjectivesCount() { + if (serviceLevelObjectivesBuilder_ == null) { + return serviceLevelObjectives_.size(); + } else { + return serviceLevelObjectivesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public com.google.monitoring.v3.ServiceLevelObjective getServiceLevelObjectives(int index) { + if (serviceLevelObjectivesBuilder_ == null) { + return serviceLevelObjectives_.get(index); + } else { + return serviceLevelObjectivesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public Builder setServiceLevelObjectives( + int index, com.google.monitoring.v3.ServiceLevelObjective value) { + if (serviceLevelObjectivesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceLevelObjectivesIsMutable(); + serviceLevelObjectives_.set(index, value); + onChanged(); + } else { + serviceLevelObjectivesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public Builder setServiceLevelObjectives( + int index, com.google.monitoring.v3.ServiceLevelObjective.Builder builderForValue) { + if (serviceLevelObjectivesBuilder_ == null) { + ensureServiceLevelObjectivesIsMutable(); + serviceLevelObjectives_.set(index, builderForValue.build()); + onChanged(); + } else { + serviceLevelObjectivesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public Builder addServiceLevelObjectives(com.google.monitoring.v3.ServiceLevelObjective value) { + if (serviceLevelObjectivesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceLevelObjectivesIsMutable(); + serviceLevelObjectives_.add(value); + onChanged(); + } else { + serviceLevelObjectivesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public Builder addServiceLevelObjectives( + int index, com.google.monitoring.v3.ServiceLevelObjective value) { + if (serviceLevelObjectivesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceLevelObjectivesIsMutable(); + serviceLevelObjectives_.add(index, value); + onChanged(); + } else { + serviceLevelObjectivesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public Builder addServiceLevelObjectives( + com.google.monitoring.v3.ServiceLevelObjective.Builder builderForValue) { + if (serviceLevelObjectivesBuilder_ == null) { + ensureServiceLevelObjectivesIsMutable(); + serviceLevelObjectives_.add(builderForValue.build()); + onChanged(); + } else { + serviceLevelObjectivesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public Builder addServiceLevelObjectives( + int index, com.google.monitoring.v3.ServiceLevelObjective.Builder builderForValue) { + if (serviceLevelObjectivesBuilder_ == null) { + ensureServiceLevelObjectivesIsMutable(); + serviceLevelObjectives_.add(index, builderForValue.build()); + onChanged(); + } else { + serviceLevelObjectivesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public Builder addAllServiceLevelObjectives( + java.lang.Iterable values) { + if (serviceLevelObjectivesBuilder_ == null) { + ensureServiceLevelObjectivesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, serviceLevelObjectives_); + onChanged(); + } else { + serviceLevelObjectivesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public Builder clearServiceLevelObjectives() { + if (serviceLevelObjectivesBuilder_ == null) { + serviceLevelObjectives_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + serviceLevelObjectivesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public Builder removeServiceLevelObjectives(int index) { + if (serviceLevelObjectivesBuilder_ == null) { + ensureServiceLevelObjectivesIsMutable(); + serviceLevelObjectives_.remove(index); + onChanged(); + } else { + serviceLevelObjectivesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public com.google.monitoring.v3.ServiceLevelObjective.Builder getServiceLevelObjectivesBuilder( + int index) { + return getServiceLevelObjectivesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder + getServiceLevelObjectivesOrBuilder(int index) { + if (serviceLevelObjectivesBuilder_ == null) { + return serviceLevelObjectives_.get(index); + } else { + return serviceLevelObjectivesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public java.util.List + getServiceLevelObjectivesOrBuilderList() { + if (serviceLevelObjectivesBuilder_ != null) { + return serviceLevelObjectivesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serviceLevelObjectives_); + } + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public com.google.monitoring.v3.ServiceLevelObjective.Builder + addServiceLevelObjectivesBuilder() { + return getServiceLevelObjectivesFieldBuilder() + .addBuilder(com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance()); + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public com.google.monitoring.v3.ServiceLevelObjective.Builder addServiceLevelObjectivesBuilder( + int index) { + return getServiceLevelObjectivesFieldBuilder() + .addBuilder(index, com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance()); + } + /** + * + * + *
+     * The `ServiceLevelObjective`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * + */ + public java.util.List + getServiceLevelObjectivesBuilderList() { + return getServiceLevelObjectivesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelObjective, + com.google.monitoring.v3.ServiceLevelObjective.Builder, + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder> + getServiceLevelObjectivesFieldBuilder() { + if (serviceLevelObjectivesBuilder_ == null) { + serviceLevelObjectivesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelObjective, + com.google.monitoring.v3.ServiceLevelObjective.Builder, + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder>( + serviceLevelObjectives_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + serviceLevelObjectives_ = null; + } + return serviceLevelObjectivesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = 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.ListServiceLevelObjectivesResponse) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.ListServiceLevelObjectivesResponse) + private static final com.google.monitoring.v3.ListServiceLevelObjectivesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.ListServiceLevelObjectivesResponse(); + } + + public static com.google.monitoring.v3.ListServiceLevelObjectivesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServiceLevelObjectivesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServiceLevelObjectivesResponse(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.ListServiceLevelObjectivesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesResponseOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesResponseOrBuilder.java new file mode 100644 index 00000000..af60fcc9 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServiceLevelObjectivesResponseOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface ListServiceLevelObjectivesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.ListServiceLevelObjectivesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The `ServiceLevelObjective`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + */ + java.util.List getServiceLevelObjectivesList(); + /** + * + * + *
+   * The `ServiceLevelObjective`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + */ + com.google.monitoring.v3.ServiceLevelObjective getServiceLevelObjectives(int index); + /** + * + * + *
+   * The `ServiceLevelObjective`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + */ + int getServiceLevelObjectivesCount(); + /** + * + * + *
+   * The `ServiceLevelObjective`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + */ + java.util.List + getServiceLevelObjectivesOrBuilderList(); + /** + * + * + *
+   * The `ServiceLevelObjective`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + */ + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder getServiceLevelObjectivesOrBuilder( + int index); + + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} 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 new file mode 100644 index 00000000..bc19d2ee --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesRequest.java @@ -0,0 +1,1121 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `ListServices` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.ListServicesRequest} + */ +public final class ListServicesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.ListServicesRequest) + ListServicesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServicesRequest.newBuilder() to construct. + private ListServicesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServicesRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServicesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = 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.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServicesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServicesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ListServicesRequest.class, + com.google.monitoring.v3.ListServicesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Resource name of the parent `Workspace`.
+   * Of the form `projects/{project_id}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the parent `Workspace`.
+   * Of the form `projects/{project_id}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * A filter specifying what `Service`s to return. The filter currently
+   * 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`
+   * `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".
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filter specifying what `Service`s to return. The filter currently
+   * 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`
+   * `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".
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * A non-negative number that is the maximum number of results to return.
+   * When 0, use default page size.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + 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.ListServicesRequest)) { + return super.equals(obj); + } + com.google.monitoring.v3.ListServicesRequest other = + (com.google.monitoring.v3.ListServicesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.ListServicesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServicesRequest 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.ListServicesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServicesRequest 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.ListServicesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServicesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.ListServicesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServicesRequest 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.ListServicesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServicesRequest 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.ListServicesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServicesRequest 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.ListServicesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `ListServices` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.ListServicesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.ListServicesRequest) + com.google.monitoring.v3.ListServicesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServicesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServicesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ListServicesRequest.class, + com.google.monitoring.v3.ListServicesRequest.Builder.class); + } + + // Construct using com.google.monitoring.v3.ListServicesRequest.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(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServicesRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.ListServicesRequest getDefaultInstanceForType() { + return com.google.monitoring.v3.ListServicesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.ListServicesRequest build() { + com.google.monitoring.v3.ListServicesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.ListServicesRequest buildPartial() { + com.google.monitoring.v3.ListServicesRequest result = + new com.google.monitoring.v3.ListServicesRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + 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.ListServicesRequest) { + return mergeFrom((com.google.monitoring.v3.ListServicesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.ListServicesRequest other) { + if (other == com.google.monitoring.v3.ListServicesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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.ListServicesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.ListServicesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Resource name of the parent `Workspace`.
+     * Of the form `projects/{project_id}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the parent `Workspace`.
+     * Of the form `projects/{project_id}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the parent `Workspace`.
+     * Of the form `projects/{project_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent `Workspace`.
+     * Of the form `projects/{project_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent `Workspace`.
+     * Of the form `projects/{project_id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filter specifying what `Service`s to return. The filter currently
+     * 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`
+     * `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".
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filter specifying what `Service`s to return. The filter currently
+     * 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`
+     * `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".
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filter specifying what `Service`s to return. The filter currently
+     * 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`
+     * `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".
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A filter specifying what `Service`s to return. The filter currently
+     * 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`
+     * `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".
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A filter specifying what `Service`s to return. The filter currently
+     * 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`
+     * `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".
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * A non-negative number that is the maximum number of results to return.
+     * When 0, use default page size.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * A non-negative number that is the maximum number of results to return.
+     * When 0, use default page size.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A non-negative number that is the maximum number of results to return.
+     * When 0, use default page size.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 4; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = 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.ListServicesRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.ListServicesRequest) + private static final com.google.monitoring.v3.ListServicesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.ListServicesRequest(); + } + + public static com.google.monitoring.v3.ListServicesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServicesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServicesRequest(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.ListServicesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 00000000..9692ed53 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface ListServicesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.ListServicesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the parent `Workspace`.
+   * Of the form `projects/{project_id}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Resource name of the parent `Workspace`.
+   * Of the form `projects/{project_id}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * A filter specifying what `Service`s to return. The filter currently
+   * 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`
+   * `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".
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filter specifying what `Service`s to return. The filter currently
+   * 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`
+   * `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".
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * A non-negative number that is the maximum number of results to return.
+   * When 0, use default page size.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); + + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 4; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 4; + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesResponse.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesResponse.java new file mode 100644 index 00000000..8e079ac1 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesResponse.java @@ -0,0 +1,1112 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `ListServices` response.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.ListServicesResponse} + */ +public final class ListServicesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.ListServicesResponse) + ListServicesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServicesResponse.newBuilder() to construct. + private ListServicesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServicesResponse() { + services_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServicesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + services_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + services_.add( + input.readMessage(com.google.monitoring.v3.Service.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + services_ = java.util.Collections.unmodifiableList(services_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServicesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServicesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ListServicesResponse.class, + com.google.monitoring.v3.ListServicesResponse.Builder.class); + } + + private int bitField0_; + public static final int SERVICES_FIELD_NUMBER = 1; + private java.util.List services_; + /** + * + * + *
+   * The `Service`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public java.util.List getServicesList() { + return services_; + } + /** + * + * + *
+   * The `Service`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public java.util.List + getServicesOrBuilderList() { + return services_; + } + /** + * + * + *
+   * The `Service`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public int getServicesCount() { + return services_.size(); + } + /** + * + * + *
+   * The `Service`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public com.google.monitoring.v3.Service getServices(int index) { + return services_.get(index); + } + /** + * + * + *
+   * The `Service`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public com.google.monitoring.v3.ServiceOrBuilder getServicesOrBuilder(int index) { + return services_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < services_.size(); i++) { + output.writeMessage(1, services_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < services_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, services_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + 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.ListServicesResponse)) { + return super.equals(obj); + } + com.google.monitoring.v3.ListServicesResponse other = + (com.google.monitoring.v3.ListServicesResponse) obj; + + if (!getServicesList().equals(other.getServicesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) 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(); + if (getServicesCount() > 0) { + hash = (37 * hash) + SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getServicesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.ListServicesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServicesResponse 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.ListServicesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServicesResponse 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.ListServicesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ListServicesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.ListServicesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServicesResponse 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.ListServicesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServicesResponse 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.ListServicesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ListServicesResponse 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.ListServicesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `ListServices` response.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.ListServicesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.ListServicesResponse) + com.google.monitoring.v3.ListServicesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServicesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServicesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ListServicesResponse.class, + com.google.monitoring.v3.ListServicesResponse.Builder.class); + } + + // Construct using com.google.monitoring.v3.ListServicesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getServicesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (servicesBuilder_ == null) { + services_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + servicesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_ListServicesResponse_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.ListServicesResponse getDefaultInstanceForType() { + return com.google.monitoring.v3.ListServicesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.ListServicesResponse build() { + com.google.monitoring.v3.ListServicesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.ListServicesResponse buildPartial() { + com.google.monitoring.v3.ListServicesResponse result = + new com.google.monitoring.v3.ListServicesResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (servicesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + services_ = java.util.Collections.unmodifiableList(services_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.services_ = services_; + } else { + result.services_ = servicesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + 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.ListServicesResponse) { + return mergeFrom((com.google.monitoring.v3.ListServicesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.ListServicesResponse other) { + if (other == com.google.monitoring.v3.ListServicesResponse.getDefaultInstance()) return this; + if (servicesBuilder_ == null) { + if (!other.services_.isEmpty()) { + if (services_.isEmpty()) { + services_ = other.services_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServicesIsMutable(); + services_.addAll(other.services_); + } + onChanged(); + } + } else { + if (!other.services_.isEmpty()) { + if (servicesBuilder_.isEmpty()) { + servicesBuilder_.dispose(); + servicesBuilder_ = null; + services_ = other.services_; + bitField0_ = (bitField0_ & ~0x00000001); + servicesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getServicesFieldBuilder() + : null; + } else { + servicesBuilder_.addAllMessages(other.services_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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.ListServicesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.ListServicesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List services_ = + java.util.Collections.emptyList(); + + private void ensureServicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + services_ = new java.util.ArrayList(services_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Service, + com.google.monitoring.v3.Service.Builder, + com.google.monitoring.v3.ServiceOrBuilder> + servicesBuilder_; + + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public java.util.List getServicesList() { + if (servicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(services_); + } else { + return servicesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public int getServicesCount() { + if (servicesBuilder_ == null) { + return services_.size(); + } else { + return servicesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public com.google.monitoring.v3.Service getServices(int index) { + if (servicesBuilder_ == null) { + return services_.get(index); + } else { + return servicesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public Builder setServices(int index, com.google.monitoring.v3.Service value) { + if (servicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServicesIsMutable(); + services_.set(index, value); + onChanged(); + } else { + servicesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public Builder setServices( + int index, com.google.monitoring.v3.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.set(index, builderForValue.build()); + onChanged(); + } else { + servicesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public Builder addServices(com.google.monitoring.v3.Service value) { + if (servicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServicesIsMutable(); + services_.add(value); + onChanged(); + } else { + servicesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public Builder addServices(int index, com.google.monitoring.v3.Service value) { + if (servicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServicesIsMutable(); + services_.add(index, value); + onChanged(); + } else { + servicesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public Builder addServices(com.google.monitoring.v3.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.add(builderForValue.build()); + onChanged(); + } else { + servicesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public Builder addServices( + int index, com.google.monitoring.v3.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.add(index, builderForValue.build()); + onChanged(); + } else { + servicesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public Builder addAllServices( + java.lang.Iterable values) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, services_); + onChanged(); + } else { + servicesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public Builder clearServices() { + if (servicesBuilder_ == null) { + services_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + servicesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public Builder removeServices(int index) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.remove(index); + onChanged(); + } else { + servicesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public com.google.monitoring.v3.Service.Builder getServicesBuilder(int index) { + return getServicesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public com.google.monitoring.v3.ServiceOrBuilder getServicesOrBuilder(int index) { + if (servicesBuilder_ == null) { + return services_.get(index); + } else { + return servicesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public java.util.List + getServicesOrBuilderList() { + if (servicesBuilder_ != null) { + return servicesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(services_); + } + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public com.google.monitoring.v3.Service.Builder addServicesBuilder() { + return getServicesFieldBuilder() + .addBuilder(com.google.monitoring.v3.Service.getDefaultInstance()); + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public com.google.monitoring.v3.Service.Builder addServicesBuilder(int index) { + return getServicesFieldBuilder() + .addBuilder(index, com.google.monitoring.v3.Service.getDefaultInstance()); + } + /** + * + * + *
+     * The `Service`s matching the specified filter.
+     * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + public java.util.List getServicesBuilderList() { + return getServicesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Service, + com.google.monitoring.v3.Service.Builder, + com.google.monitoring.v3.ServiceOrBuilder> + getServicesFieldBuilder() { + if (servicesBuilder_ == null) { + servicesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.v3.Service, + com.google.monitoring.v3.Service.Builder, + com.google.monitoring.v3.ServiceOrBuilder>( + services_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + services_ = null; + } + return servicesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = 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.ListServicesResponse) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.ListServicesResponse) + private static final com.google.monitoring.v3.ListServicesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.ListServicesResponse(); + } + + public static com.google.monitoring.v3.ListServicesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServicesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServicesResponse(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.ListServicesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesResponseOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesResponseOrBuilder.java new file mode 100644 index 00000000..e178151a --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ListServicesResponseOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface ListServicesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.ListServicesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The `Service`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + java.util.List getServicesList(); + /** + * + * + *
+   * The `Service`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + com.google.monitoring.v3.Service getServices(int index); + /** + * + * + *
+   * The `Service`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + int getServicesCount(); + /** + * + * + *
+   * The `Service`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + java.util.List getServicesOrBuilderList(); + /** + * + * + *
+   * The `Service`s matching the specified filter.
+   * 
+ * + * repeated .google.monitoring.v3.Service services = 1; + */ + com.google.monitoring.v3.ServiceOrBuilder getServicesOrBuilder(int index); + + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} 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 aedb8df8..9bd2718d 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 @@ -453,9 +453,10 @@ public com.google.monitoring.v3.TimeIntervalOrBuilder getIntervalOrBuilder() { * * *
-   * By default, the raw time series data is returned.
-   * Use this field to combine multiple time series for different
-   * views of the data.
+   * Specifies the alignment of data points in individual time series as
+   * well as how to combine the retrieved time series across specified labels.
+   * By default (if no `aggregation` is explicitly specified), the raw time
+   * series data is returned.
    * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -467,9 +468,10 @@ public boolean hasAggregation() { * * *
-   * By default, the raw time series data is returned.
-   * Use this field to combine multiple time series for different
-   * views of the data.
+   * Specifies the alignment of data points in individual time series as
+   * well as how to combine the retrieved time series across specified labels.
+   * By default (if no `aggregation` is explicitly specified), the raw time
+   * series data is returned.
    * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -483,9 +485,10 @@ public com.google.monitoring.v3.Aggregation getAggregation() { * * *
-   * By default, the raw time series data is returned.
-   * Use this field to combine multiple time series for different
-   * views of the data.
+   * Specifies the alignment of data points in individual time series as
+   * well as how to combine the retrieved time series across specified labels.
+   * By default (if no `aggregation` is explicitly specified), the raw time
+   * series data is returned.
    * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -501,7 +504,7 @@ public com.google.monitoring.v3.AggregationOrBuilder getAggregationOrBuilder() { * *
    * Unsupported: must be left blank. The points in each time series are
-   * returned in reverse time order.
+   * currently returned in reverse time order (most recent to oldest).
    * 
* * string order_by = 6; @@ -522,7 +525,7 @@ public java.lang.String getOrderBy() { * *
    * Unsupported: must be left blank. The points in each time series are
-   * returned in reverse time order.
+   * currently returned in reverse time order (most recent to oldest).
    * 
* * string order_by = 6; @@ -1514,9 +1517,10 @@ public com.google.monitoring.v3.TimeIntervalOrBuilder getIntervalOrBuilder() { * * *
-     * By default, the raw time series data is returned.
-     * Use this field to combine multiple time series for different
-     * views of the data.
+     * Specifies the alignment of data points in individual time series as
+     * well as how to combine the retrieved time series across specified labels.
+     * By default (if no `aggregation` is explicitly specified), the raw time
+     * series data is returned.
      * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -1528,9 +1532,10 @@ public boolean hasAggregation() { * * *
-     * By default, the raw time series data is returned.
-     * Use this field to combine multiple time series for different
-     * views of the data.
+     * Specifies the alignment of data points in individual time series as
+     * well as how to combine the retrieved time series across specified labels.
+     * By default (if no `aggregation` is explicitly specified), the raw time
+     * series data is returned.
      * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -1548,9 +1553,10 @@ public com.google.monitoring.v3.Aggregation getAggregation() { * * *
-     * By default, the raw time series data is returned.
-     * Use this field to combine multiple time series for different
-     * views of the data.
+     * Specifies the alignment of data points in individual time series as
+     * well as how to combine the retrieved time series across specified labels.
+     * By default (if no `aggregation` is explicitly specified), the raw time
+     * series data is returned.
      * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -1572,9 +1578,10 @@ public Builder setAggregation(com.google.monitoring.v3.Aggregation value) { * * *
-     * By default, the raw time series data is returned.
-     * Use this field to combine multiple time series for different
-     * views of the data.
+     * Specifies the alignment of data points in individual time series as
+     * well as how to combine the retrieved time series across specified labels.
+     * By default (if no `aggregation` is explicitly specified), the raw time
+     * series data is returned.
      * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -1593,9 +1600,10 @@ public Builder setAggregation(com.google.monitoring.v3.Aggregation.Builder build * * *
-     * By default, the raw time series data is returned.
-     * Use this field to combine multiple time series for different
-     * views of the data.
+     * Specifies the alignment of data points in individual time series as
+     * well as how to combine the retrieved time series across specified labels.
+     * By default (if no `aggregation` is explicitly specified), the raw time
+     * series data is returned.
      * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -1621,9 +1629,10 @@ public Builder mergeAggregation(com.google.monitoring.v3.Aggregation value) { * * *
-     * By default, the raw time series data is returned.
-     * Use this field to combine multiple time series for different
-     * views of the data.
+     * Specifies the alignment of data points in individual time series as
+     * well as how to combine the retrieved time series across specified labels.
+     * By default (if no `aggregation` is explicitly specified), the raw time
+     * series data is returned.
      * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -1643,9 +1652,10 @@ public Builder clearAggregation() { * * *
-     * By default, the raw time series data is returned.
-     * Use this field to combine multiple time series for different
-     * views of the data.
+     * Specifies the alignment of data points in individual time series as
+     * well as how to combine the retrieved time series across specified labels.
+     * By default (if no `aggregation` is explicitly specified), the raw time
+     * series data is returned.
      * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -1659,9 +1669,10 @@ public com.google.monitoring.v3.Aggregation.Builder getAggregationBuilder() { * * *
-     * By default, the raw time series data is returned.
-     * Use this field to combine multiple time series for different
-     * views of the data.
+     * Specifies the alignment of data points in individual time series as
+     * well as how to combine the retrieved time series across specified labels.
+     * By default (if no `aggregation` is explicitly specified), the raw time
+     * series data is returned.
      * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -1679,9 +1690,10 @@ public com.google.monitoring.v3.AggregationOrBuilder getAggregationOrBuilder() { * * *
-     * By default, the raw time series data is returned.
-     * Use this field to combine multiple time series for different
-     * views of the data.
+     * Specifies the alignment of data points in individual time series as
+     * well as how to combine the retrieved time series across specified labels.
+     * By default (if no `aggregation` is explicitly specified), the raw time
+     * series data is returned.
      * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -1709,7 +1721,7 @@ public com.google.monitoring.v3.AggregationOrBuilder getAggregationOrBuilder() { * *
      * Unsupported: must be left blank. The points in each time series are
-     * returned in reverse time order.
+     * currently returned in reverse time order (most recent to oldest).
      * 
* * string order_by = 6; @@ -1730,7 +1742,7 @@ public java.lang.String getOrderBy() { * *
      * Unsupported: must be left blank. The points in each time series are
-     * returned in reverse time order.
+     * currently returned in reverse time order (most recent to oldest).
      * 
* * string order_by = 6; @@ -1751,7 +1763,7 @@ public com.google.protobuf.ByteString getOrderByBytes() { * *
      * Unsupported: must be left blank. The points in each time series are
-     * returned in reverse time order.
+     * currently returned in reverse time order (most recent to oldest).
      * 
* * string order_by = 6; @@ -1770,7 +1782,7 @@ public Builder setOrderBy(java.lang.String value) { * *
      * Unsupported: must be left blank. The points in each time series are
-     * returned in reverse time order.
+     * currently returned in reverse time order (most recent to oldest).
      * 
* * string order_by = 6; @@ -1786,7 +1798,7 @@ public Builder clearOrderBy() { * *
      * Unsupported: must be left blank. The points in each time series are
-     * returned in reverse time order.
+     * currently returned in reverse time order (most recent to oldest).
      * 
* * string order_by = 6; 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 a32d47e5..06021583 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 @@ -118,9 +118,10 @@ public interface ListTimeSeriesRequestOrBuilder * * *
-   * By default, the raw time series data is returned.
-   * Use this field to combine multiple time series for different
-   * views of the data.
+   * Specifies the alignment of data points in individual time series as
+   * well as how to combine the retrieved time series across specified labels.
+   * By default (if no `aggregation` is explicitly specified), the raw time
+   * series data is returned.
    * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -130,9 +131,10 @@ public interface ListTimeSeriesRequestOrBuilder * * *
-   * By default, the raw time series data is returned.
-   * Use this field to combine multiple time series for different
-   * views of the data.
+   * Specifies the alignment of data points in individual time series as
+   * well as how to combine the retrieved time series across specified labels.
+   * By default (if no `aggregation` is explicitly specified), the raw time
+   * series data is returned.
    * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -142,9 +144,10 @@ public interface ListTimeSeriesRequestOrBuilder * * *
-   * By default, the raw time series data is returned.
-   * Use this field to combine multiple time series for different
-   * views of the data.
+   * Specifies the alignment of data points in individual time series as
+   * well as how to combine the retrieved time series across specified labels.
+   * By default (if no `aggregation` is explicitly specified), the raw time
+   * series data is returned.
    * 
* * .google.monitoring.v3.Aggregation aggregation = 5; @@ -156,7 +159,7 @@ public interface ListTimeSeriesRequestOrBuilder * *
    * Unsupported: must be left blank. The points in each time series are
-   * returned in reverse time order.
+   * currently returned in reverse time order (most recent to oldest).
    * 
* * string order_by = 6; @@ -167,7 +170,7 @@ public interface ListTimeSeriesRequestOrBuilder * *
    * Unsupported: must be left blank. The points in each time series are
-   * returned in reverse time order.
+   * currently returned in reverse time order (most recent to oldest).
    * 
* * string order_by = 6; 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 93e024b7..8845bc29 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 @@ -75,6 +75,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_monitoring_v3_CreateTimeSeriesError_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_monitoring_v3_CreateTimeSeriesError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_CreateTimeSeriesSummary_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_CreateTimeSeriesSummary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_CreateTimeSeriesSummary_Error_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_CreateTimeSeriesSummary_Error_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -126,54 +134,60 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\003(\0132\022.google.rpc.Status\"^\n\027CreateTimeSer" + "iesRequest\022\014\n\004name\030\003 \001(\t\0225\n\013time_series\030" + "\002 \003(\0132 .google.monitoring.v3.TimeSeries\"" - + "r\n\025CreateTimeSeriesError\0225\n\013time_series\030" - + "\001 \001(\0132 .google.monitoring.v3.TimeSeries\022" - + "\"\n\006status\030\002 \001(\0132\022.google.rpc.Status2\322\014\n\r" - + "MetricService\022\335\001\n ListMonitoredResourceD" - + "escriptors\022=.google.monitoring.v3.ListMo" - + "nitoredResourceDescriptorsRequest\032>.goog" - + "le.monitoring.v3.ListMonitoredResourceDe" - + "scriptorsResponse\":\202\323\344\223\0024\0222/v3/{name=pro" - + "jects/*}/monitoredResourceDescriptors\022\304\001" - + "\n\036GetMonitoredResourceDescriptor\022;.googl" - + "e.monitoring.v3.GetMonitoredResourceDesc" - + "riptorRequest\032\'.google.api.MonitoredReso" - + "urceDescriptor\"<\202\323\344\223\0026\0224/v3/{name=projec" - + "ts/*/monitoredResourceDescriptors/*}\022\261\001\n" - + "\025ListMetricDescriptors\0222.google.monitori" - + "ng.v3.ListMetricDescriptorsRequest\0323.goo" - + "gle.monitoring.v3.ListMetricDescriptorsR" - + "esponse\"/\202\323\344\223\002)\022\'/v3/{name=projects/*}/m" - + "etricDescriptors\022\231\001\n\023GetMetricDescriptor" - + "\0220.google.monitoring.v3.GetMetricDescrip" - + "torRequest\032\034.google.api.MetricDescriptor" - + "\"2\202\323\344\223\002,\022*/v3/{name=projects/*/metricDes" - + "criptors/**}\022\257\001\n\026CreateMetricDescriptor\022" - + "3.google.monitoring.v3.CreateMetricDescr" - + "iptorRequest\032\034.google.api.MetricDescript" - + "or\"B\202\323\344\223\002<\"\'/v3/{name=projects/*}/metric" - + "Descriptors:\021metric_descriptor\022\231\001\n\026Delet" - + "eMetricDescriptor\0223.google.monitoring.v3" - + ".DeleteMetricDescriptorRequest\032\026.google." - + "protobuf.Empty\"2\202\323\344\223\002,**/v3/{name=projec" - + "ts/*/metricDescriptors/**}\022\225\001\n\016ListTimeS" - + "eries\022+.google.monitoring.v3.ListTimeSer" - + "iesRequest\032,.google.monitoring.v3.ListTi" - + "meSeriesResponse\"(\202\323\344\223\002\"\022 /v3/{name=proj" - + "ects/*}/timeSeries\022\206\001\n\020CreateTimeSeries\022" - + "-.google.monitoring.v3.CreateTimeSeriesR" - + "equest\032\026.google.protobuf.Empty\"+\202\323\344\223\002%\" " - + "/v3/{name=projects/*}/timeSeries:\001*\032\332\001\312A" - + "\031monitoring.googleapis.com\322A\272\001https://ww" - + "w.googleapis.com/auth/cloud-platform,htt" - + "ps://www.googleapis.com/auth/monitoring," - + "https://www.googleapis.com/auth/monitori" - + "ng.read,https://www.googleapis.com/auth/" - + "monitoring.writeB\252\001\n\030com.google.monitori" - + "ng.v3B\022MetricServiceProtoP\001Z>google.gola" - + "ng.org/genproto/googleapis/monitoring/v3" - + ";monitoring\252\002\032Google.Cloud.Monitoring.V3" - + "\312\002\032Google\\Cloud\\Monitoring\\V3b\006proto3" + + "z\n\025CreateTimeSeriesError\0229\n\013time_series\030" + + "\001 \001(\0132 .google.monitoring.v3.TimeSeriesB" + + "\002\030\001\022&\n\006status\030\002 \001(\0132\022.google.rpc.StatusB" + + "\002\030\001\"\330\001\n\027CreateTimeSeriesSummary\022\031\n\021total" + + "_point_count\030\001 \001(\005\022\033\n\023success_point_coun" + + "t\030\002 \001(\005\022C\n\006errors\030\003 \003(\01323.google.monitor" + + "ing.v3.CreateTimeSeriesSummary.Error\032@\n\005" + + "Error\022\"\n\006status\030\001 \001(\0132\022.google.rpc.Statu" + + "s\022\023\n\013point_count\030\002 \001(\0052\322\014\n\rMetricService" + + "\022\335\001\n ListMonitoredResourceDescriptors\022=." + + "google.monitoring.v3.ListMonitoredResour" + + "ceDescriptorsRequest\032>.google.monitoring" + + ".v3.ListMonitoredResourceDescriptorsResp" + + "onse\":\202\323\344\223\0024\0222/v3/{name=projects/*}/moni" + + "toredResourceDescriptors\022\304\001\n\036GetMonitore" + + "dResourceDescriptor\022;.google.monitoring." + + "v3.GetMonitoredResourceDescriptorRequest" + + "\032\'.google.api.MonitoredResourceDescripto" + + "r\"<\202\323\344\223\0026\0224/v3/{name=projects/*/monitore" + + "dResourceDescriptors/*}\022\261\001\n\025ListMetricDe" + + "scriptors\0222.google.monitoring.v3.ListMet" + + "ricDescriptorsRequest\0323.google.monitorin" + + "g.v3.ListMetricDescriptorsResponse\"/\202\323\344\223" + + "\002)\022\'/v3/{name=projects/*}/metricDescript" + + "ors\022\231\001\n\023GetMetricDescriptor\0220.google.mon" + + "itoring.v3.GetMetricDescriptorRequest\032\034." + + "google.api.MetricDescriptor\"2\202\323\344\223\002,\022*/v3" + + "/{name=projects/*/metricDescriptors/**}\022" + + "\257\001\n\026CreateMetricDescriptor\0223.google.moni" + + "toring.v3.CreateMetricDescriptorRequest\032" + + "\034.google.api.MetricDescriptor\"B\202\323\344\223\002<\"\'/" + + "v3/{name=projects/*}/metricDescriptors:\021" + + "metric_descriptor\022\231\001\n\026DeleteMetricDescri" + + "ptor\0223.google.monitoring.v3.DeleteMetric" + + "DescriptorRequest\032\026.google.protobuf.Empt" + + "y\"2\202\323\344\223\002,**/v3/{name=projects/*/metricDe" + + "scriptors/**}\022\225\001\n\016ListTimeSeries\022+.googl" + + "e.monitoring.v3.ListTimeSeriesRequest\032,." + + "google.monitoring.v3.ListTimeSeriesRespo" + + "nse\"(\202\323\344\223\002\"\022 /v3/{name=projects/*}/timeS" + + "eries\022\206\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*\032\332\001\312A\031monitoring.g" + + "oogleapis.com\322A\272\001https://www.googleapis." + + "com/auth/cloud-platform,https://www.goog" + + "leapis.com/auth/monitoring,https://www.g" + + "oogleapis.com/auth/monitoring.read,https" + + "://www.googleapis.com/auth/monitoring.wr" + + "iteB\252\001\n\030com.google.monitoring.v3B\022Metric" + + "ServiceProtoP\001Z>google.golang.org/genpro" + + "to/googleapis/monitoring/v3;monitoring\252\002" + + "\032Google.Cloud.Monitoring.V3\312\002\032Google\\Clo" + + "ud\\Monitoring\\V3b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -301,6 +315,24 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( new java.lang.String[] { "TimeSeries", "Status", }); + internal_static_google_monitoring_v3_CreateTimeSeriesSummary_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_monitoring_v3_CreateTimeSeriesSummary_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_CreateTimeSeriesSummary_descriptor, + new java.lang.String[] { + "TotalPointCount", "SuccessPointCount", "Errors", + }); + internal_static_google_monitoring_v3_CreateTimeSeriesSummary_Error_descriptor = + internal_static_google_monitoring_v3_CreateTimeSeriesSummary_descriptor + .getNestedTypes() + .get(0); + internal_static_google_monitoring_v3_CreateTimeSeriesSummary_Error_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_CreateTimeSeriesSummary_Error_descriptor, + new java.lang.String[] { + "Status", "PointCount", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); 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 faed5504..388025bb 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 @@ -54,32 +54,33 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n\'google/monitoring/v3/notification.prot" + "o\022\024google.monitoring.v3\032\026google/api/labe" - + "l.proto\032!google/monitoring/v3/common.pro" - + "to\032\036google/protobuf/wrappers.proto\"\323\001\n\035N" - + "otificationChannelDescriptor\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.go" - + "ogle.api.LabelDescriptor\022>\n\017supported_ti" - + "ers\030\005 \003(\0162!.google.monitoring.v3.Service" - + "TierB\002\030\001\"\266\004\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\032-\n\013Labels" - + "Entry\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\005value\030\002" - + " \001(\t:\0028\001\"W\n\022VerificationStatus\022#\n\037VERIFI" - + "CATION_STATUS_UNSPECIFIED\020\000\022\016\n\nUNVERIFIE" - + "D\020\001\022\014\n\010VERIFIED\020\002B\251\001\n\030com.google.monitor" - + "ing.v3B\021NotificationProtoP\001Z>google.gola" - + "ng.org/genproto/googleapis/monitoring/v3" - + ";monitoring\252\002\032Google.Cloud.Monitoring.V3" - + "\312\002\032Google\\Cloud\\Monitoring\\V3b\006proto3" + + "l.proto\032\035google/api/launch_stage.proto\032!" + + "google/monitoring/v3/common.proto\032\036googl" + + "e/protobuf/wrappers.proto\"\323\001\n\035Notificati" + + "onChannelDescriptor\022\014\n\004name\030\006 \001(\t\022\014\n\004typ" + + "e\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022\023\n\013descrip" + + "tion\030\003 \001(\t\022+\n\006labels\030\004 \003(\0132\033.google.api." + + "LabelDescriptor\022>\n\017supported_tiers\030\005 \003(\016" + + "2!.google.monitoring.v3.ServiceTierB\002\030\001\"" + + "\266\004\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\013des" + + "cription\030\004 \001(\t\022E\n\006labels\030\005 \003(\01325.google." + + "monitoring.v3.NotificationChannel.Labels" + + "Entry\022N\n\013user_labels\030\010 \003(\01329.google.moni" + + "toring.v3.NotificationChannel.UserLabels" + + "Entry\022Y\n\023verification_status\030\t \001(\0162<.goo" + + "gle.monitoring.v3.NotificationChannel.Ve" + + "rificationStatus\022+\n\007enabled\030\013 \001(\0132\032.goog" + + "le.protobuf.BoolValue\032-\n\013LabelsEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0321\n\017UserLabe" + + "lsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"" + + "W\n\022VerificationStatus\022#\n\037VERIFICATION_ST" + + "ATUS_UNSPECIFIED\020\000\022\016\n\nUNVERIFIED\020\001\022\014\n\010VE" + + "RIFIED\020\002B\251\001\n\030com.google.monitoring.v3B\021N" + + "otificationProtoP\001Z>google.golang.org/ge" + + "nproto/googleapis/monitoring/v3;monitori" + + "ng\252\002\032Google.Cloud.Monitoring.V3\312\002\032Google" + + "\\Cloud\\Monitoring\\V3b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -93,6 +94,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.LabelProto.getDescriptor(), + com.google.api.LaunchStageProto.getDescriptor(), com.google.monitoring.v3.CommonProto.getDescriptor(), com.google.protobuf.WrappersProto.getDescriptor(), }, @@ -137,6 +139,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( "Key", "Value", }); com.google.api.LabelProto.getDescriptor(); + com.google.api.LaunchStageProto.getDescriptor(); com.google.monitoring.v3.CommonProto.getDescriptor(); com.google.protobuf.WrappersProto.getDescriptor(); } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Point.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Point.java index 5ba1348f..58ee9894 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Point.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Point.java @@ -135,14 +135,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * The time interval to which the data point applies.  For `GAUGE` metrics,
-   * the start time is optional, but if it is supplied, it must equal the end
-   * time.  For `DELTA` metrics, the start and end time should specify a
-   * non-zero interval, with subsequent points specifying contiguous and
-   * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-   * time should specify 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 start time is optional, but if it is supplied, it must equal the
+   * end time.  For `DELTA` metrics, the start
+   * and end time should specify a non-zero interval, with subsequent points
+   * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+   * metrics, the start and end time should specify 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.
    * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -155,14 +155,14 @@ public boolean hasInterval() { * *
    * The time interval to which the data point applies.  For `GAUGE` metrics,
-   * the start time is optional, but if it is supplied, it must equal the end
-   * time.  For `DELTA` metrics, the start and end time should specify a
-   * non-zero interval, with subsequent points specifying contiguous and
-   * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-   * time should specify 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 start time is optional, but if it is supplied, it must equal the
+   * end time.  For `DELTA` metrics, the start
+   * and end time should specify a non-zero interval, with subsequent points
+   * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+   * metrics, the start and end time should specify 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.
    * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -177,14 +177,14 @@ public com.google.monitoring.v3.TimeInterval getInterval() { * *
    * The time interval to which the data point applies.  For `GAUGE` metrics,
-   * the start time is optional, but if it is supplied, it must equal the end
-   * time.  For `DELTA` metrics, the start and end time should specify a
-   * non-zero interval, with subsequent points specifying contiguous and
-   * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-   * time should specify 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 start time is optional, but if it is supplied, it must equal the
+   * end time.  For `DELTA` metrics, the start
+   * and end time should specify a non-zero interval, with subsequent points
+   * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+   * metrics, the start and end time should specify 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.
    * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -595,14 +595,14 @@ public Builder mergeFrom( * *
      * The time interval to which the data point applies.  For `GAUGE` metrics,
-     * the start time is optional, but if it is supplied, it must equal the end
-     * time.  For `DELTA` metrics, the start and end time should specify a
-     * non-zero interval, with subsequent points specifying contiguous and
-     * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-     * time should specify 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 start time is optional, but if it is supplied, it must equal the
+     * end time.  For `DELTA` metrics, the start
+     * and end time should specify a non-zero interval, with subsequent points
+     * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+     * metrics, the start and end time should specify 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.
      * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -615,14 +615,14 @@ public boolean hasInterval() { * *
      * The time interval to which the data point applies.  For `GAUGE` metrics,
-     * the start time is optional, but if it is supplied, it must equal the end
-     * time.  For `DELTA` metrics, the start and end time should specify a
-     * non-zero interval, with subsequent points specifying contiguous and
-     * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-     * time should specify 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 start time is optional, but if it is supplied, it must equal the
+     * end time.  For `DELTA` metrics, the start
+     * and end time should specify a non-zero interval, with subsequent points
+     * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+     * metrics, the start and end time should specify 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.
      * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -641,14 +641,14 @@ public com.google.monitoring.v3.TimeInterval getInterval() { * *
      * The time interval to which the data point applies.  For `GAUGE` metrics,
-     * the start time is optional, but if it is supplied, it must equal the end
-     * time.  For `DELTA` metrics, the start and end time should specify a
-     * non-zero interval, with subsequent points specifying contiguous and
-     * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-     * time should specify 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 start time is optional, but if it is supplied, it must equal the
+     * end time.  For `DELTA` metrics, the start
+     * and end time should specify a non-zero interval, with subsequent points
+     * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+     * metrics, the start and end time should specify 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.
      * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -671,14 +671,14 @@ public Builder setInterval(com.google.monitoring.v3.TimeInterval value) { * *
      * The time interval to which the data point applies.  For `GAUGE` metrics,
-     * the start time is optional, but if it is supplied, it must equal the end
-     * time.  For `DELTA` metrics, the start and end time should specify a
-     * non-zero interval, with subsequent points specifying contiguous and
-     * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-     * time should specify 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 start time is optional, but if it is supplied, it must equal the
+     * end time.  For `DELTA` metrics, the start
+     * and end time should specify a non-zero interval, with subsequent points
+     * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+     * metrics, the start and end time should specify 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.
      * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -698,14 +698,14 @@ public Builder setInterval(com.google.monitoring.v3.TimeInterval.Builder builder * *
      * The time interval to which the data point applies.  For `GAUGE` metrics,
-     * the start time is optional, but if it is supplied, it must equal the end
-     * time.  For `DELTA` metrics, the start and end time should specify a
-     * non-zero interval, with subsequent points specifying contiguous and
-     * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-     * time should specify 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 start time is optional, but if it is supplied, it must equal the
+     * end time.  For `DELTA` metrics, the start
+     * and end time should specify a non-zero interval, with subsequent points
+     * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+     * metrics, the start and end time should specify 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.
      * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -732,14 +732,14 @@ public Builder mergeInterval(com.google.monitoring.v3.TimeInterval value) { * *
      * The time interval to which the data point applies.  For `GAUGE` metrics,
-     * the start time is optional, but if it is supplied, it must equal the end
-     * time.  For `DELTA` metrics, the start and end time should specify a
-     * non-zero interval, with subsequent points specifying contiguous and
-     * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-     * time should specify 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 start time is optional, but if it is supplied, it must equal the
+     * end time.  For `DELTA` metrics, the start
+     * and end time should specify a non-zero interval, with subsequent points
+     * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+     * metrics, the start and end time should specify 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.
      * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -760,14 +760,14 @@ public Builder clearInterval() { * *
      * The time interval to which the data point applies.  For `GAUGE` metrics,
-     * the start time is optional, but if it is supplied, it must equal the end
-     * time.  For `DELTA` metrics, the start and end time should specify a
-     * non-zero interval, with subsequent points specifying contiguous and
-     * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-     * time should specify 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 start time is optional, but if it is supplied, it must equal the
+     * end time.  For `DELTA` metrics, the start
+     * and end time should specify a non-zero interval, with subsequent points
+     * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+     * metrics, the start and end time should specify 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.
      * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -782,14 +782,14 @@ public com.google.monitoring.v3.TimeInterval.Builder getIntervalBuilder() { * *
      * The time interval to which the data point applies.  For `GAUGE` metrics,
-     * the start time is optional, but if it is supplied, it must equal the end
-     * time.  For `DELTA` metrics, the start and end time should specify a
-     * non-zero interval, with subsequent points specifying contiguous and
-     * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-     * time should specify 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 start time is optional, but if it is supplied, it must equal the
+     * end time.  For `DELTA` metrics, the start
+     * and end time should specify a non-zero interval, with subsequent points
+     * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+     * metrics, the start and end time should specify 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.
      * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -808,14 +808,14 @@ public com.google.monitoring.v3.TimeIntervalOrBuilder getIntervalOrBuilder() { * *
      * The time interval to which the data point applies.  For `GAUGE` metrics,
-     * the start time is optional, but if it is supplied, it must equal the end
-     * time.  For `DELTA` metrics, the start and end time should specify a
-     * non-zero interval, with subsequent points specifying contiguous and
-     * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-     * time should specify 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 start time is optional, but if it is supplied, it must equal the
+     * end time.  For `DELTA` metrics, the start
+     * and end time should specify a non-zero interval, with subsequent points
+     * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+     * metrics, the start and end time should specify 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.
      * 
* * .google.monitoring.v3.TimeInterval interval = 1; diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/PointOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/PointOrBuilder.java index 3db2a4f5..0da3d4e1 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/PointOrBuilder.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/PointOrBuilder.java @@ -28,14 +28,14 @@ public interface PointOrBuilder * *
    * The time interval to which the data point applies.  For `GAUGE` metrics,
-   * the start time is optional, but if it is supplied, it must equal the end
-   * time.  For `DELTA` metrics, the start and end time should specify a
-   * non-zero interval, with subsequent points specifying contiguous and
-   * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-   * time should specify 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 start time is optional, but if it is supplied, it must equal the
+   * end time.  For `DELTA` metrics, the start
+   * and end time should specify a non-zero interval, with subsequent points
+   * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+   * metrics, the start and end time should specify 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.
    * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -46,14 +46,14 @@ public interface PointOrBuilder * *
    * The time interval to which the data point applies.  For `GAUGE` metrics,
-   * the start time is optional, but if it is supplied, it must equal the end
-   * time.  For `DELTA` metrics, the start and end time should specify a
-   * non-zero interval, with subsequent points specifying contiguous and
-   * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-   * time should specify 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 start time is optional, but if it is supplied, it must equal the
+   * end time.  For `DELTA` metrics, the start
+   * and end time should specify a non-zero interval, with subsequent points
+   * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+   * metrics, the start and end time should specify 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.
    * 
* * .google.monitoring.v3.TimeInterval interval = 1; @@ -64,14 +64,14 @@ public interface PointOrBuilder * *
    * The time interval to which the data point applies.  For `GAUGE` metrics,
-   * the start time is optional, but if it is supplied, it must equal the end
-   * time.  For `DELTA` metrics, the start and end time should specify a
-   * non-zero interval, with subsequent points specifying contiguous and
-   * non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
-   * time should specify 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 start time is optional, but if it is supplied, it must equal the
+   * end time.  For `DELTA` metrics, the start
+   * and end time should specify a non-zero interval, with subsequent points
+   * specifying contiguous and non-overlapping intervals.  For `CUMULATIVE`
+   * metrics, the start and end time should specify 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.
    * 
* * .google.monitoring.v3.TimeInterval interval = 1; diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Range.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Range.java new file mode 100644 index 00000000..9356fecc --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Range.java @@ -0,0 +1,612 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * Range of numerical values, inclusive of `min` and exclusive of `max`. If the
+ * open range "< range.max" is desired, set `range.min = -infinity`. If the open
+ * range ">= range.min" is desired, set `range.max = infinity`.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.Range} + */ +public final class Range extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.Range) + RangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Range.newBuilder() to construct. + private Range(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Range() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Range( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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 9: + { + min_ = input.readDouble(); + break; + } + case 17: + { + max_ = input.readDouble(); + 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_Range_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Range_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Range.class, com.google.monitoring.v3.Range.Builder.class); + } + + public static final int MIN_FIELD_NUMBER = 1; + private double min_; + /** + * + * + *
+   * Range minimum.
+   * 
+ * + * double min = 1; + */ + public double getMin() { + return min_; + } + + public static final int MAX_FIELD_NUMBER = 2; + private double max_; + /** + * + * + *
+   * Range maximum.
+   * 
+ * + * double max = 2; + */ + public double getMax() { + return max_; + } + + 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 (min_ != 0D) { + output.writeDouble(1, min_); + } + if (max_ != 0D) { + output.writeDouble(2, max_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (min_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, min_); + } + if (max_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, max_); + } + 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.Range)) { + return super.equals(obj); + } + com.google.monitoring.v3.Range other = (com.google.monitoring.v3.Range) obj; + + if (java.lang.Double.doubleToLongBits(getMin()) + != java.lang.Double.doubleToLongBits(other.getMin())) return false; + if (java.lang.Double.doubleToLongBits(getMax()) + != java.lang.Double.doubleToLongBits(other.getMax())) 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) + MIN_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getMin())); + hash = (37 * hash) + MAX_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getMax())); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.Range parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Range 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.Range parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Range 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.Range parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Range parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.Range parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Range 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.Range parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Range 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.Range parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Range 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.Range 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; + } + /** + * + * + *
+   * Range of numerical values, inclusive of `min` and exclusive of `max`. If the
+   * open range "< range.max" is desired, set `range.min = -infinity`. If the open
+   * range ">= range.min" is desired, set `range.max = infinity`.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.Range} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.Range) + com.google.monitoring.v3.RangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Range_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Range_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Range.class, com.google.monitoring.v3.Range.Builder.class); + } + + // Construct using com.google.monitoring.v3.Range.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(); + min_ = 0D; + + max_ = 0D; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Range_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.Range getDefaultInstanceForType() { + return com.google.monitoring.v3.Range.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.Range build() { + com.google.monitoring.v3.Range result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.Range buildPartial() { + com.google.monitoring.v3.Range result = new com.google.monitoring.v3.Range(this); + result.min_ = min_; + result.max_ = max_; + 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.Range) { + return mergeFrom((com.google.monitoring.v3.Range) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.Range other) { + if (other == com.google.monitoring.v3.Range.getDefaultInstance()) return this; + if (other.getMin() != 0D) { + setMin(other.getMin()); + } + if (other.getMax() != 0D) { + setMax(other.getMax()); + } + 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.Range parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.Range) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private double min_; + /** + * + * + *
+     * Range minimum.
+     * 
+ * + * double min = 1; + */ + public double getMin() { + return min_; + } + /** + * + * + *
+     * Range minimum.
+     * 
+ * + * double min = 1; + */ + public Builder setMin(double value) { + + min_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Range minimum.
+     * 
+ * + * double min = 1; + */ + public Builder clearMin() { + + min_ = 0D; + onChanged(); + return this; + } + + private double max_; + /** + * + * + *
+     * Range maximum.
+     * 
+ * + * double max = 2; + */ + public double getMax() { + return max_; + } + /** + * + * + *
+     * Range maximum.
+     * 
+ * + * double max = 2; + */ + public Builder setMax(double value) { + + max_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Range maximum.
+     * 
+ * + * double max = 2; + */ + public Builder clearMax() { + + max_ = 0D; + 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.Range) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.Range) + private static final com.google.monitoring.v3.Range DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.Range(); + } + + public static com.google.monitoring.v3.Range getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Range parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Range(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.Range getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/RangeOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/RangeOrBuilder.java new file mode 100644 index 00000000..83863d50 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/RangeOrBuilder.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +public interface RangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.Range) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Range minimum.
+   * 
+ * + * double min = 1; + */ + double getMin(); + + /** + * + * + *
+   * Range maximum.
+   * 
+ * + * double max = 2; + */ + double getMax(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/RequestBasedSli.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/RequestBasedSli.java new file mode 100644 index 00000000..6115bb04 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/RequestBasedSli.java @@ -0,0 +1,1148 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * Service Level Indicators for which atomic units of service are counted
+ * directly.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.RequestBasedSli} + */ +public final class RequestBasedSli extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.RequestBasedSli) + RequestBasedSliOrBuilder { + private static final long serialVersionUID = 0L; + // Use RequestBasedSli.newBuilder() to construct. + private RequestBasedSli(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RequestBasedSli() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RequestBasedSli( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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: + { + com.google.monitoring.v3.TimeSeriesRatio.Builder subBuilder = null; + if (methodCase_ == 1) { + subBuilder = ((com.google.monitoring.v3.TimeSeriesRatio) method_).toBuilder(); + } + method_ = + input.readMessage( + com.google.monitoring.v3.TimeSeriesRatio.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.v3.TimeSeriesRatio) method_); + method_ = subBuilder.buildPartial(); + } + methodCase_ = 1; + break; + } + case 26: + { + com.google.monitoring.v3.DistributionCut.Builder subBuilder = null; + if (methodCase_ == 3) { + subBuilder = ((com.google.monitoring.v3.DistributionCut) method_).toBuilder(); + } + method_ = + input.readMessage( + com.google.monitoring.v3.DistributionCut.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.v3.DistributionCut) method_); + method_ = subBuilder.buildPartial(); + } + methodCase_ = 3; + 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_RequestBasedSli_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_RequestBasedSli_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.RequestBasedSli.class, + com.google.monitoring.v3.RequestBasedSli.Builder.class); + } + + private int methodCase_ = 0; + private java.lang.Object method_; + + public enum MethodCase implements com.google.protobuf.Internal.EnumLite { + GOOD_TOTAL_RATIO(1), + DISTRIBUTION_CUT(3), + METHOD_NOT_SET(0); + private final int value; + + private MethodCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static MethodCase valueOf(int value) { + return forNumber(value); + } + + public static MethodCase forNumber(int value) { + switch (value) { + case 1: + return GOOD_TOTAL_RATIO; + case 3: + return DISTRIBUTION_CUT; + case 0: + return METHOD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MethodCase getMethodCase() { + return MethodCase.forNumber(methodCase_); + } + + public static final int GOOD_TOTAL_RATIO_FIELD_NUMBER = 1; + /** + * + * + *
+   * `good_total_ratio` is used when the ratio of `good_service` to
+   * `total_service` is computed from two `TimeSeries`.
+   * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + public boolean hasGoodTotalRatio() { + return methodCase_ == 1; + } + /** + * + * + *
+   * `good_total_ratio` is used when the ratio of `good_service` to
+   * `total_service` is computed from two `TimeSeries`.
+   * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + public com.google.monitoring.v3.TimeSeriesRatio getGoodTotalRatio() { + if (methodCase_ == 1) { + return (com.google.monitoring.v3.TimeSeriesRatio) method_; + } + return com.google.monitoring.v3.TimeSeriesRatio.getDefaultInstance(); + } + /** + * + * + *
+   * `good_total_ratio` is used when the ratio of `good_service` to
+   * `total_service` is computed from two `TimeSeries`.
+   * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + public com.google.monitoring.v3.TimeSeriesRatioOrBuilder getGoodTotalRatioOrBuilder() { + if (methodCase_ == 1) { + return (com.google.monitoring.v3.TimeSeriesRatio) method_; + } + return com.google.monitoring.v3.TimeSeriesRatio.getDefaultInstance(); + } + + public static final int DISTRIBUTION_CUT_FIELD_NUMBER = 3; + /** + * + * + *
+   * `distribution_cut` is used when `good_service` is a count of values
+   * aggregated in a `Distribution` that fall into a good range. The
+   * `total_service` is the total count of all values aggregated in the
+   * `Distribution`.
+   * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + public boolean hasDistributionCut() { + return methodCase_ == 3; + } + /** + * + * + *
+   * `distribution_cut` is used when `good_service` is a count of values
+   * aggregated in a `Distribution` that fall into a good range. The
+   * `total_service` is the total count of all values aggregated in the
+   * `Distribution`.
+   * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + public com.google.monitoring.v3.DistributionCut getDistributionCut() { + if (methodCase_ == 3) { + return (com.google.monitoring.v3.DistributionCut) method_; + } + return com.google.monitoring.v3.DistributionCut.getDefaultInstance(); + } + /** + * + * + *
+   * `distribution_cut` is used when `good_service` is a count of values
+   * aggregated in a `Distribution` that fall into a good range. The
+   * `total_service` is the total count of all values aggregated in the
+   * `Distribution`.
+   * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + public com.google.monitoring.v3.DistributionCutOrBuilder getDistributionCutOrBuilder() { + if (methodCase_ == 3) { + return (com.google.monitoring.v3.DistributionCut) method_; + } + return com.google.monitoring.v3.DistributionCut.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (methodCase_ == 1) { + output.writeMessage(1, (com.google.monitoring.v3.TimeSeriesRatio) method_); + } + if (methodCase_ == 3) { + output.writeMessage(3, (com.google.monitoring.v3.DistributionCut) method_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (methodCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.monitoring.v3.TimeSeriesRatio) method_); + } + if (methodCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.monitoring.v3.DistributionCut) method_); + } + 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.RequestBasedSli)) { + return super.equals(obj); + } + com.google.monitoring.v3.RequestBasedSli other = (com.google.monitoring.v3.RequestBasedSli) obj; + + if (!getMethodCase().equals(other.getMethodCase())) return false; + switch (methodCase_) { + case 1: + if (!getGoodTotalRatio().equals(other.getGoodTotalRatio())) return false; + break; + case 3: + if (!getDistributionCut().equals(other.getDistributionCut())) return false; + break; + case 0: + default: + } + 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(); + switch (methodCase_) { + case 1: + hash = (37 * hash) + GOOD_TOTAL_RATIO_FIELD_NUMBER; + hash = (53 * hash) + getGoodTotalRatio().hashCode(); + break; + case 3: + hash = (37 * hash) + DISTRIBUTION_CUT_FIELD_NUMBER; + hash = (53 * hash) + getDistributionCut().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.RequestBasedSli parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.RequestBasedSli 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.RequestBasedSli parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.RequestBasedSli 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.RequestBasedSli parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.RequestBasedSli parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.RequestBasedSli parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.RequestBasedSli 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.RequestBasedSli parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.RequestBasedSli 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.RequestBasedSli parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.RequestBasedSli 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.RequestBasedSli 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; + } + /** + * + * + *
+   * Service Level Indicators for which atomic units of service are counted
+   * directly.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.RequestBasedSli} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.RequestBasedSli) + com.google.monitoring.v3.RequestBasedSliOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_RequestBasedSli_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_RequestBasedSli_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.RequestBasedSli.class, + com.google.monitoring.v3.RequestBasedSli.Builder.class); + } + + // Construct using com.google.monitoring.v3.RequestBasedSli.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(); + methodCase_ = 0; + method_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_RequestBasedSli_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.RequestBasedSli getDefaultInstanceForType() { + return com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.RequestBasedSli build() { + com.google.monitoring.v3.RequestBasedSli result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.RequestBasedSli buildPartial() { + com.google.monitoring.v3.RequestBasedSli result = + new com.google.monitoring.v3.RequestBasedSli(this); + if (methodCase_ == 1) { + if (goodTotalRatioBuilder_ == null) { + result.method_ = method_; + } else { + result.method_ = goodTotalRatioBuilder_.build(); + } + } + if (methodCase_ == 3) { + if (distributionCutBuilder_ == null) { + result.method_ = method_; + } else { + result.method_ = distributionCutBuilder_.build(); + } + } + result.methodCase_ = methodCase_; + 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.RequestBasedSli) { + return mergeFrom((com.google.monitoring.v3.RequestBasedSli) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.RequestBasedSli other) { + if (other == com.google.monitoring.v3.RequestBasedSli.getDefaultInstance()) return this; + switch (other.getMethodCase()) { + case GOOD_TOTAL_RATIO: + { + mergeGoodTotalRatio(other.getGoodTotalRatio()); + break; + } + case DISTRIBUTION_CUT: + { + mergeDistributionCut(other.getDistributionCut()); + break; + } + case METHOD_NOT_SET: + { + break; + } + } + 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.RequestBasedSli parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.RequestBasedSli) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int methodCase_ = 0; + private java.lang.Object method_; + + public MethodCase getMethodCase() { + return MethodCase.forNumber(methodCase_); + } + + public Builder clearMethod() { + methodCase_ = 0; + method_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.TimeSeriesRatio, + com.google.monitoring.v3.TimeSeriesRatio.Builder, + com.google.monitoring.v3.TimeSeriesRatioOrBuilder> + goodTotalRatioBuilder_; + /** + * + * + *
+     * `good_total_ratio` is used when the ratio of `good_service` to
+     * `total_service` is computed from two `TimeSeries`.
+     * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + public boolean hasGoodTotalRatio() { + return methodCase_ == 1; + } + /** + * + * + *
+     * `good_total_ratio` is used when the ratio of `good_service` to
+     * `total_service` is computed from two `TimeSeries`.
+     * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + public com.google.monitoring.v3.TimeSeriesRatio getGoodTotalRatio() { + if (goodTotalRatioBuilder_ == null) { + if (methodCase_ == 1) { + return (com.google.monitoring.v3.TimeSeriesRatio) method_; + } + return com.google.monitoring.v3.TimeSeriesRatio.getDefaultInstance(); + } else { + if (methodCase_ == 1) { + return goodTotalRatioBuilder_.getMessage(); + } + return com.google.monitoring.v3.TimeSeriesRatio.getDefaultInstance(); + } + } + /** + * + * + *
+     * `good_total_ratio` is used when the ratio of `good_service` to
+     * `total_service` is computed from two `TimeSeries`.
+     * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + public Builder setGoodTotalRatio(com.google.monitoring.v3.TimeSeriesRatio value) { + if (goodTotalRatioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + method_ = value; + onChanged(); + } else { + goodTotalRatioBuilder_.setMessage(value); + } + methodCase_ = 1; + return this; + } + /** + * + * + *
+     * `good_total_ratio` is used when the ratio of `good_service` to
+     * `total_service` is computed from two `TimeSeries`.
+     * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + public Builder setGoodTotalRatio( + com.google.monitoring.v3.TimeSeriesRatio.Builder builderForValue) { + if (goodTotalRatioBuilder_ == null) { + method_ = builderForValue.build(); + onChanged(); + } else { + goodTotalRatioBuilder_.setMessage(builderForValue.build()); + } + methodCase_ = 1; + return this; + } + /** + * + * + *
+     * `good_total_ratio` is used when the ratio of `good_service` to
+     * `total_service` is computed from two `TimeSeries`.
+     * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + public Builder mergeGoodTotalRatio(com.google.monitoring.v3.TimeSeriesRatio value) { + if (goodTotalRatioBuilder_ == null) { + if (methodCase_ == 1 + && method_ != com.google.monitoring.v3.TimeSeriesRatio.getDefaultInstance()) { + method_ = + com.google.monitoring.v3.TimeSeriesRatio.newBuilder( + (com.google.monitoring.v3.TimeSeriesRatio) method_) + .mergeFrom(value) + .buildPartial(); + } else { + method_ = value; + } + onChanged(); + } else { + if (methodCase_ == 1) { + goodTotalRatioBuilder_.mergeFrom(value); + } + goodTotalRatioBuilder_.setMessage(value); + } + methodCase_ = 1; + return this; + } + /** + * + * + *
+     * `good_total_ratio` is used when the ratio of `good_service` to
+     * `total_service` is computed from two `TimeSeries`.
+     * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + public Builder clearGoodTotalRatio() { + if (goodTotalRatioBuilder_ == null) { + if (methodCase_ == 1) { + methodCase_ = 0; + method_ = null; + onChanged(); + } + } else { + if (methodCase_ == 1) { + methodCase_ = 0; + method_ = null; + } + goodTotalRatioBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * `good_total_ratio` is used when the ratio of `good_service` to
+     * `total_service` is computed from two `TimeSeries`.
+     * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + public com.google.monitoring.v3.TimeSeriesRatio.Builder getGoodTotalRatioBuilder() { + return getGoodTotalRatioFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * `good_total_ratio` is used when the ratio of `good_service` to
+     * `total_service` is computed from two `TimeSeries`.
+     * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + public com.google.monitoring.v3.TimeSeriesRatioOrBuilder getGoodTotalRatioOrBuilder() { + if ((methodCase_ == 1) && (goodTotalRatioBuilder_ != null)) { + return goodTotalRatioBuilder_.getMessageOrBuilder(); + } else { + if (methodCase_ == 1) { + return (com.google.monitoring.v3.TimeSeriesRatio) method_; + } + return com.google.monitoring.v3.TimeSeriesRatio.getDefaultInstance(); + } + } + /** + * + * + *
+     * `good_total_ratio` is used when the ratio of `good_service` to
+     * `total_service` is computed from two `TimeSeries`.
+     * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.TimeSeriesRatio, + com.google.monitoring.v3.TimeSeriesRatio.Builder, + com.google.monitoring.v3.TimeSeriesRatioOrBuilder> + getGoodTotalRatioFieldBuilder() { + if (goodTotalRatioBuilder_ == null) { + if (!(methodCase_ == 1)) { + method_ = com.google.monitoring.v3.TimeSeriesRatio.getDefaultInstance(); + } + goodTotalRatioBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.TimeSeriesRatio, + com.google.monitoring.v3.TimeSeriesRatio.Builder, + com.google.monitoring.v3.TimeSeriesRatioOrBuilder>( + (com.google.monitoring.v3.TimeSeriesRatio) method_, + getParentForChildren(), + isClean()); + method_ = null; + } + methodCase_ = 1; + onChanged(); + ; + return goodTotalRatioBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.DistributionCut, + com.google.monitoring.v3.DistributionCut.Builder, + com.google.monitoring.v3.DistributionCutOrBuilder> + distributionCutBuilder_; + /** + * + * + *
+     * `distribution_cut` is used when `good_service` is a count of values
+     * aggregated in a `Distribution` that fall into a good range. The
+     * `total_service` is the total count of all values aggregated in the
+     * `Distribution`.
+     * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + public boolean hasDistributionCut() { + return methodCase_ == 3; + } + /** + * + * + *
+     * `distribution_cut` is used when `good_service` is a count of values
+     * aggregated in a `Distribution` that fall into a good range. The
+     * `total_service` is the total count of all values aggregated in the
+     * `Distribution`.
+     * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + public com.google.monitoring.v3.DistributionCut getDistributionCut() { + if (distributionCutBuilder_ == null) { + if (methodCase_ == 3) { + return (com.google.monitoring.v3.DistributionCut) method_; + } + return com.google.monitoring.v3.DistributionCut.getDefaultInstance(); + } else { + if (methodCase_ == 3) { + return distributionCutBuilder_.getMessage(); + } + return com.google.monitoring.v3.DistributionCut.getDefaultInstance(); + } + } + /** + * + * + *
+     * `distribution_cut` is used when `good_service` is a count of values
+     * aggregated in a `Distribution` that fall into a good range. The
+     * `total_service` is the total count of all values aggregated in the
+     * `Distribution`.
+     * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + public Builder setDistributionCut(com.google.monitoring.v3.DistributionCut value) { + if (distributionCutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + method_ = value; + onChanged(); + } else { + distributionCutBuilder_.setMessage(value); + } + methodCase_ = 3; + return this; + } + /** + * + * + *
+     * `distribution_cut` is used when `good_service` is a count of values
+     * aggregated in a `Distribution` that fall into a good range. The
+     * `total_service` is the total count of all values aggregated in the
+     * `Distribution`.
+     * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + public Builder setDistributionCut( + com.google.monitoring.v3.DistributionCut.Builder builderForValue) { + if (distributionCutBuilder_ == null) { + method_ = builderForValue.build(); + onChanged(); + } else { + distributionCutBuilder_.setMessage(builderForValue.build()); + } + methodCase_ = 3; + return this; + } + /** + * + * + *
+     * `distribution_cut` is used when `good_service` is a count of values
+     * aggregated in a `Distribution` that fall into a good range. The
+     * `total_service` is the total count of all values aggregated in the
+     * `Distribution`.
+     * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + public Builder mergeDistributionCut(com.google.monitoring.v3.DistributionCut value) { + if (distributionCutBuilder_ == null) { + if (methodCase_ == 3 + && method_ != com.google.monitoring.v3.DistributionCut.getDefaultInstance()) { + method_ = + com.google.monitoring.v3.DistributionCut.newBuilder( + (com.google.monitoring.v3.DistributionCut) method_) + .mergeFrom(value) + .buildPartial(); + } else { + method_ = value; + } + onChanged(); + } else { + if (methodCase_ == 3) { + distributionCutBuilder_.mergeFrom(value); + } + distributionCutBuilder_.setMessage(value); + } + methodCase_ = 3; + return this; + } + /** + * + * + *
+     * `distribution_cut` is used when `good_service` is a count of values
+     * aggregated in a `Distribution` that fall into a good range. The
+     * `total_service` is the total count of all values aggregated in the
+     * `Distribution`.
+     * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + public Builder clearDistributionCut() { + if (distributionCutBuilder_ == null) { + if (methodCase_ == 3) { + methodCase_ = 0; + method_ = null; + onChanged(); + } + } else { + if (methodCase_ == 3) { + methodCase_ = 0; + method_ = null; + } + distributionCutBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * `distribution_cut` is used when `good_service` is a count of values
+     * aggregated in a `Distribution` that fall into a good range. The
+     * `total_service` is the total count of all values aggregated in the
+     * `Distribution`.
+     * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + public com.google.monitoring.v3.DistributionCut.Builder getDistributionCutBuilder() { + return getDistributionCutFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * `distribution_cut` is used when `good_service` is a count of values
+     * aggregated in a `Distribution` that fall into a good range. The
+     * `total_service` is the total count of all values aggregated in the
+     * `Distribution`.
+     * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + public com.google.monitoring.v3.DistributionCutOrBuilder getDistributionCutOrBuilder() { + if ((methodCase_ == 3) && (distributionCutBuilder_ != null)) { + return distributionCutBuilder_.getMessageOrBuilder(); + } else { + if (methodCase_ == 3) { + return (com.google.monitoring.v3.DistributionCut) method_; + } + return com.google.monitoring.v3.DistributionCut.getDefaultInstance(); + } + } + /** + * + * + *
+     * `distribution_cut` is used when `good_service` is a count of values
+     * aggregated in a `Distribution` that fall into a good range. The
+     * `total_service` is the total count of all values aggregated in the
+     * `Distribution`.
+     * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.DistributionCut, + com.google.monitoring.v3.DistributionCut.Builder, + com.google.monitoring.v3.DistributionCutOrBuilder> + getDistributionCutFieldBuilder() { + if (distributionCutBuilder_ == null) { + if (!(methodCase_ == 3)) { + method_ = com.google.monitoring.v3.DistributionCut.getDefaultInstance(); + } + distributionCutBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.DistributionCut, + com.google.monitoring.v3.DistributionCut.Builder, + com.google.monitoring.v3.DistributionCutOrBuilder>( + (com.google.monitoring.v3.DistributionCut) method_, + getParentForChildren(), + isClean()); + method_ = null; + } + methodCase_ = 3; + onChanged(); + ; + return distributionCutBuilder_; + } + + @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.RequestBasedSli) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.RequestBasedSli) + private static final com.google.monitoring.v3.RequestBasedSli DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.RequestBasedSli(); + } + + public static com.google.monitoring.v3.RequestBasedSli getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequestBasedSli parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RequestBasedSli(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.RequestBasedSli getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/RequestBasedSliOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/RequestBasedSliOrBuilder.java new file mode 100644 index 00000000..b76f1d3f --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/RequestBasedSliOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +public interface RequestBasedSliOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.RequestBasedSli) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * `good_total_ratio` is used when the ratio of `good_service` to
+   * `total_service` is computed from two `TimeSeries`.
+   * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + boolean hasGoodTotalRatio(); + /** + * + * + *
+   * `good_total_ratio` is used when the ratio of `good_service` to
+   * `total_service` is computed from two `TimeSeries`.
+   * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + com.google.monitoring.v3.TimeSeriesRatio getGoodTotalRatio(); + /** + * + * + *
+   * `good_total_ratio` is used when the ratio of `good_service` to
+   * `total_service` is computed from two `TimeSeries`.
+   * 
+ * + * .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + */ + com.google.monitoring.v3.TimeSeriesRatioOrBuilder getGoodTotalRatioOrBuilder(); + + /** + * + * + *
+   * `distribution_cut` is used when `good_service` is a count of values
+   * aggregated in a `Distribution` that fall into a good range. The
+   * `total_service` is the total count of all values aggregated in the
+   * `Distribution`.
+   * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + boolean hasDistributionCut(); + /** + * + * + *
+   * `distribution_cut` is used when `good_service` is a count of values
+   * aggregated in a `Distribution` that fall into a good range. The
+   * `total_service` is the total count of all values aggregated in the
+   * `Distribution`.
+   * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + com.google.monitoring.v3.DistributionCut getDistributionCut(); + /** + * + * + *
+   * `distribution_cut` is used when `good_service` is a count of values
+   * aggregated in a `Distribution` that fall into a good range. The
+   * `total_service` is the total count of all values aggregated in the
+   * `Distribution`.
+   * 
+ * + * .google.monitoring.v3.DistributionCut distribution_cut = 3; + */ + com.google.monitoring.v3.DistributionCutOrBuilder getDistributionCutOrBuilder(); + + public com.google.monitoring.v3.RequestBasedSli.MethodCase getMethodCase(); +} 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 new file mode 100644 index 00000000..27dad330 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/Service.java @@ -0,0 +1,5865 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * A `Service` is a discrete, autonomous, and network-accessible unit, designed
+ * to solve an individual concern
+ * ([Wikipedia](https://en.wikipedia.org/wiki/Service-orientation)). In
+ * Stackdriver Monitoring, a `Service` acts as the root resource under which
+ * operational aspects of the service are accessible.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.Service} + */ +public final class Service extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.Service) + ServiceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Service.newBuilder() to construct. + private Service(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Service() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Service( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 50: + { + com.google.monitoring.v3.Service.Custom.Builder subBuilder = null; + if (identifierCase_ == 6) { + subBuilder = ((com.google.monitoring.v3.Service.Custom) identifier_).toBuilder(); + } + identifier_ = + input.readMessage( + com.google.monitoring.v3.Service.Custom.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.v3.Service.Custom) identifier_); + identifier_ = subBuilder.buildPartial(); + } + identifierCase_ = 6; + break; + } + case 58: + { + com.google.monitoring.v3.Service.AppEngine.Builder subBuilder = null; + if (identifierCase_ == 7) { + subBuilder = ((com.google.monitoring.v3.Service.AppEngine) identifier_).toBuilder(); + } + identifier_ = + input.readMessage( + com.google.monitoring.v3.Service.AppEngine.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.v3.Service.AppEngine) identifier_); + identifier_ = subBuilder.buildPartial(); + } + identifierCase_ = 7; + break; + } + case 66: + { + com.google.monitoring.v3.Service.CloudEndpoints.Builder subBuilder = null; + if (identifierCase_ == 8) { + subBuilder = + ((com.google.monitoring.v3.Service.CloudEndpoints) identifier_).toBuilder(); + } + identifier_ = + input.readMessage( + com.google.monitoring.v3.Service.CloudEndpoints.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.v3.Service.CloudEndpoints) identifier_); + identifier_ = subBuilder.buildPartial(); + } + identifierCase_ = 8; + break; + } + case 74: + { + com.google.monitoring.v3.Service.ClusterIstio.Builder subBuilder = null; + if (identifierCase_ == 9) { + subBuilder = + ((com.google.monitoring.v3.Service.ClusterIstio) identifier_).toBuilder(); + } + identifier_ = + input.readMessage( + com.google.monitoring.v3.Service.ClusterIstio.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.v3.Service.ClusterIstio) identifier_); + identifier_ = subBuilder.buildPartial(); + } + identifierCase_ = 9; + break; + } + case 106: + { + com.google.monitoring.v3.Service.Telemetry.Builder subBuilder = null; + if (telemetry_ != null) { + subBuilder = telemetry_.toBuilder(); + } + telemetry_ = + input.readMessage( + com.google.monitoring.v3.Service.Telemetry.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(telemetry_); + telemetry_ = 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.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.class, com.google.monitoring.v3.Service.Builder.class); + } + + public interface CustomOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.Service.Custom) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Custom view of service telemetry. Currently a place-holder pending final
+   * design.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.Service.Custom} + */ + public static final class Custom extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.Service.Custom) + CustomOrBuilder { + private static final long serialVersionUID = 0L; + // Use Custom.newBuilder() to construct. + private Custom(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Custom() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Custom( + 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; + 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_Custom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_Custom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.Custom.class, + com.google.monitoring.v3.Service.Custom.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.Custom)) { + return super.equals(obj); + } + com.google.monitoring.v3.Service.Custom other = (com.google.monitoring.v3.Service.Custom) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.Service.Custom parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.Custom 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.Custom parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.Custom 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.Custom parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.Custom 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.Custom parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service.Custom 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.Custom parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service.Custom 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.Custom 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.Custom 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.Custom 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; + } + /** + * + * + *
+     * Custom view of service telemetry. Currently a place-holder pending final
+     * design.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.Service.Custom} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.Service.Custom) + com.google.monitoring.v3.Service.CustomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_Custom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_Custom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.Custom.class, + com.google.monitoring.v3.Service.Custom.Builder.class); + } + + // Construct using com.google.monitoring.v3.Service.Custom.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_Custom_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.Service.Custom getDefaultInstanceForType() { + return com.google.monitoring.v3.Service.Custom.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.Service.Custom build() { + com.google.monitoring.v3.Service.Custom result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.Service.Custom buildPartial() { + com.google.monitoring.v3.Service.Custom result = + new com.google.monitoring.v3.Service.Custom(this); + 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.Custom) { + return mergeFrom((com.google.monitoring.v3.Service.Custom) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.Service.Custom other) { + if (other == com.google.monitoring.v3.Service.Custom.getDefaultInstance()) return this; + 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.Custom parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.Service.Custom) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.Custom) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.Service.Custom) + private static final com.google.monitoring.v3.Service.Custom DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.Service.Custom(); + } + + public static com.google.monitoring.v3.Service.Custom getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Custom parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Custom(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.Custom getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AppEngineOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.Service.AppEngine) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The ID of the App Engine module underlying this service. Corresponds to
+     * the `module_id` resource label in the `gae_app` monitored resource:
+     * https://cloud.google.com/monitoring/api/resources#tag_gae_app
+     * 
+ * + * string module_id = 1; + */ + java.lang.String getModuleId(); + /** + * + * + *
+     * The ID of the App Engine module underlying this service. Corresponds to
+     * the `module_id` resource label in the `gae_app` monitored resource:
+     * https://cloud.google.com/monitoring/api/resources#tag_gae_app
+     * 
+ * + * string module_id = 1; + */ + com.google.protobuf.ByteString getModuleIdBytes(); + } + /** + * + * + *
+   * App Engine service. Learn more at https://cloud.google.com/appengine.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.Service.AppEngine} + */ + public static final class AppEngine extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.Service.AppEngine) + AppEngineOrBuilder { + private static final long serialVersionUID = 0L; + // Use AppEngine.newBuilder() to construct. + private AppEngine(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AppEngine() { + moduleId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AppEngine( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + moduleId_ = 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_AppEngine_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_AppEngine_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.AppEngine.class, + com.google.monitoring.v3.Service.AppEngine.Builder.class); + } + + public static final int MODULE_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object moduleId_; + /** + * + * + *
+     * The ID of the App Engine module underlying this service. Corresponds to
+     * the `module_id` resource label in the `gae_app` monitored resource:
+     * https://cloud.google.com/monitoring/api/resources#tag_gae_app
+     * 
+ * + * string module_id = 1; + */ + public java.lang.String getModuleId() { + java.lang.Object ref = moduleId_; + 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(); + moduleId_ = s; + return s; + } + } + /** + * + * + *
+     * The ID of the App Engine module underlying this service. Corresponds to
+     * the `module_id` resource label in the `gae_app` monitored resource:
+     * https://cloud.google.com/monitoring/api/resources#tag_gae_app
+     * 
+ * + * string module_id = 1; + */ + public com.google.protobuf.ByteString getModuleIdBytes() { + java.lang.Object ref = moduleId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + moduleId_ = 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 (!getModuleIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, moduleId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getModuleIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, moduleId_); + } + 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.AppEngine)) { + return super.equals(obj); + } + com.google.monitoring.v3.Service.AppEngine other = + (com.google.monitoring.v3.Service.AppEngine) obj; + + if (!getModuleId().equals(other.getModuleId())) 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) + MODULE_ID_FIELD_NUMBER; + hash = (53 * hash) + getModuleId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.Service.AppEngine parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.AppEngine 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.AppEngine parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.AppEngine 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.AppEngine parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.AppEngine 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.AppEngine parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service.AppEngine 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.AppEngine parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service.AppEngine 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.AppEngine 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.AppEngine 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.AppEngine 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; + } + /** + * + * + *
+     * App Engine service. Learn more at https://cloud.google.com/appengine.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.Service.AppEngine} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.Service.AppEngine) + com.google.monitoring.v3.Service.AppEngineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_AppEngine_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_AppEngine_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.AppEngine.class, + com.google.monitoring.v3.Service.AppEngine.Builder.class); + } + + // Construct using com.google.monitoring.v3.Service.AppEngine.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(); + moduleId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_AppEngine_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.Service.AppEngine getDefaultInstanceForType() { + return com.google.monitoring.v3.Service.AppEngine.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.Service.AppEngine build() { + com.google.monitoring.v3.Service.AppEngine result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.Service.AppEngine buildPartial() { + com.google.monitoring.v3.Service.AppEngine result = + new com.google.monitoring.v3.Service.AppEngine(this); + result.moduleId_ = moduleId_; + 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.AppEngine) { + return mergeFrom((com.google.monitoring.v3.Service.AppEngine) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.Service.AppEngine other) { + if (other == com.google.monitoring.v3.Service.AppEngine.getDefaultInstance()) return this; + if (!other.getModuleId().isEmpty()) { + moduleId_ = other.moduleId_; + 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.AppEngine parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.Service.AppEngine) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object moduleId_ = ""; + /** + * + * + *
+       * The ID of the App Engine module underlying this service. Corresponds to
+       * the `module_id` resource label in the `gae_app` monitored resource:
+       * https://cloud.google.com/monitoring/api/resources#tag_gae_app
+       * 
+ * + * string module_id = 1; + */ + public java.lang.String getModuleId() { + java.lang.Object ref = moduleId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + moduleId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The ID of the App Engine module underlying this service. Corresponds to
+       * the `module_id` resource label in the `gae_app` monitored resource:
+       * https://cloud.google.com/monitoring/api/resources#tag_gae_app
+       * 
+ * + * string module_id = 1; + */ + public com.google.protobuf.ByteString getModuleIdBytes() { + java.lang.Object ref = moduleId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + moduleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The ID of the App Engine module underlying this service. Corresponds to
+       * the `module_id` resource label in the `gae_app` monitored resource:
+       * https://cloud.google.com/monitoring/api/resources#tag_gae_app
+       * 
+ * + * string module_id = 1; + */ + public Builder setModuleId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + moduleId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The ID of the App Engine module underlying this service. Corresponds to
+       * the `module_id` resource label in the `gae_app` monitored resource:
+       * https://cloud.google.com/monitoring/api/resources#tag_gae_app
+       * 
+ * + * string module_id = 1; + */ + public Builder clearModuleId() { + + moduleId_ = getDefaultInstance().getModuleId(); + onChanged(); + return this; + } + /** + * + * + *
+       * The ID of the App Engine module underlying this service. Corresponds to
+       * the `module_id` resource label in the `gae_app` monitored resource:
+       * https://cloud.google.com/monitoring/api/resources#tag_gae_app
+       * 
+ * + * string module_id = 1; + */ + public Builder setModuleIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + moduleId_ = 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.AppEngine) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.Service.AppEngine) + private static final com.google.monitoring.v3.Service.AppEngine DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.Service.AppEngine(); + } + + public static com.google.monitoring.v3.Service.AppEngine getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppEngine parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AppEngine(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.AppEngine getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CloudEndpointsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.Service.CloudEndpoints) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the Cloud Endpoints service underlying this service.
+     * Corresponds to the `service` resource label in the `api` monitored
+     * resource: https://cloud.google.com/monitoring/api/resources#tag_api
+     * 
+ * + * string service = 1; + */ + java.lang.String getService(); + /** + * + * + *
+     * The name of the Cloud Endpoints service underlying this service.
+     * Corresponds to the `service` resource label in the `api` monitored
+     * resource: https://cloud.google.com/monitoring/api/resources#tag_api
+     * 
+ * + * string service = 1; + */ + com.google.protobuf.ByteString getServiceBytes(); + } + /** + * + * + *
+   * Cloud Endpoints service. Learn more at https://cloud.google.com/endpoints.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.Service.CloudEndpoints} + */ + public static final class CloudEndpoints extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.Service.CloudEndpoints) + CloudEndpointsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloudEndpoints.newBuilder() to construct. + private CloudEndpoints(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloudEndpoints() { + service_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CloudEndpoints( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + service_ = 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_CloudEndpoints_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_CloudEndpoints_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.CloudEndpoints.class, + com.google.monitoring.v3.Service.CloudEndpoints.Builder.class); + } + + public static final int SERVICE_FIELD_NUMBER = 1; + private volatile java.lang.Object service_; + /** + * + * + *
+     * The name of the Cloud Endpoints service underlying this service.
+     * Corresponds to the `service` resource label in the `api` monitored
+     * resource: https://cloud.google.com/monitoring/api/resources#tag_api
+     * 
+ * + * string service = 1; + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + 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(); + service_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the Cloud Endpoints service underlying this service.
+     * Corresponds to the `service` resource label in the `api` monitored
+     * resource: https://cloud.google.com/monitoring/api/resources#tag_api
+     * 
+ * + * string service = 1; + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = 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 (!getServiceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, service_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getServiceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, service_); + } + 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.CloudEndpoints)) { + return super.equals(obj); + } + com.google.monitoring.v3.Service.CloudEndpoints other = + (com.google.monitoring.v3.Service.CloudEndpoints) obj; + + if (!getService().equals(other.getService())) 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) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.Service.CloudEndpoints parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.CloudEndpoints 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.CloudEndpoints parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.CloudEndpoints 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.CloudEndpoints parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.CloudEndpoints 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.CloudEndpoints parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service.CloudEndpoints 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.CloudEndpoints parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service.CloudEndpoints 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.CloudEndpoints 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.CloudEndpoints 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.CloudEndpoints 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; + } + /** + * + * + *
+     * Cloud Endpoints service. Learn more at https://cloud.google.com/endpoints.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.Service.CloudEndpoints} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.Service.CloudEndpoints) + com.google.monitoring.v3.Service.CloudEndpointsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_CloudEndpoints_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_CloudEndpoints_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.CloudEndpoints.class, + com.google.monitoring.v3.Service.CloudEndpoints.Builder.class); + } + + // Construct using com.google.monitoring.v3.Service.CloudEndpoints.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(); + service_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_CloudEndpoints_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.Service.CloudEndpoints getDefaultInstanceForType() { + return com.google.monitoring.v3.Service.CloudEndpoints.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.Service.CloudEndpoints build() { + com.google.monitoring.v3.Service.CloudEndpoints result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.Service.CloudEndpoints buildPartial() { + com.google.monitoring.v3.Service.CloudEndpoints result = + new com.google.monitoring.v3.Service.CloudEndpoints(this); + result.service_ = service_; + 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.CloudEndpoints) { + return mergeFrom((com.google.monitoring.v3.Service.CloudEndpoints) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.Service.CloudEndpoints other) { + if (other == com.google.monitoring.v3.Service.CloudEndpoints.getDefaultInstance()) + return this; + if (!other.getService().isEmpty()) { + service_ = other.service_; + 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.CloudEndpoints parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.Service.CloudEndpoints) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object service_ = ""; + /** + * + * + *
+       * The name of the Cloud Endpoints service underlying this service.
+       * Corresponds to the `service` resource label in the `api` monitored
+       * resource: https://cloud.google.com/monitoring/api/resources#tag_api
+       * 
+ * + * string service = 1; + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the Cloud Endpoints service underlying this service.
+       * Corresponds to the `service` resource label in the `api` monitored
+       * resource: https://cloud.google.com/monitoring/api/resources#tag_api
+       * 
+ * + * string service = 1; + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the Cloud Endpoints service underlying this service.
+       * Corresponds to the `service` resource label in the `api` monitored
+       * resource: https://cloud.google.com/monitoring/api/resources#tag_api
+       * 
+ * + * string service = 1; + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + service_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the Cloud Endpoints service underlying this service.
+       * Corresponds to the `service` resource label in the `api` monitored
+       * resource: https://cloud.google.com/monitoring/api/resources#tag_api
+       * 
+ * + * string service = 1; + */ + public Builder clearService() { + + service_ = getDefaultInstance().getService(); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the Cloud Endpoints service underlying this service.
+       * Corresponds to the `service` resource label in the `api` monitored
+       * resource: https://cloud.google.com/monitoring/api/resources#tag_api
+       * 
+ * + * string service = 1; + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + service_ = 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.CloudEndpoints) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.Service.CloudEndpoints) + private static final com.google.monitoring.v3.Service.CloudEndpoints DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.Service.CloudEndpoints(); + } + + public static com.google.monitoring.v3.Service.CloudEndpoints getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudEndpoints parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CloudEndpoints(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.CloudEndpoints getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ClusterIstioOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.Service.ClusterIstio) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The location of the Kubernetes cluster in which this Istio service is
+     * defined. Corresponds to the `location` resource label in `k8s_cluster`
+     * resources.
+     * 
+ * + * string location = 1; + */ + java.lang.String getLocation(); + /** + * + * + *
+     * The location of the Kubernetes cluster in which this Istio service is
+     * defined. Corresponds to the `location` resource label in `k8s_cluster`
+     * resources.
+     * 
+ * + * string location = 1; + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+     * The name of the Kubernetes cluster in which this Istio service is
+     * defined. Corresponds to the `cluster_name` resource label in
+     * `k8s_cluster` resources.
+     * 
+ * + * string cluster_name = 2; + */ + java.lang.String getClusterName(); + /** + * + * + *
+     * The name of the Kubernetes cluster in which this Istio service is
+     * defined. Corresponds to the `cluster_name` resource label in
+     * `k8s_cluster` resources.
+     * 
+ * + * string cluster_name = 2; + */ + com.google.protobuf.ByteString getClusterNameBytes(); + + /** + * + * + *
+     * The namespace of the Istio service underlying this service. Corresponds
+     * to the `destination_service_namespace` metric label in Istio metrics.
+     * 
+ * + * string service_namespace = 3; + */ + java.lang.String getServiceNamespace(); + /** + * + * + *
+     * The namespace of the Istio service underlying this service. Corresponds
+     * to the `destination_service_namespace` metric label in Istio metrics.
+     * 
+ * + * string service_namespace = 3; + */ + com.google.protobuf.ByteString getServiceNamespaceBytes(); + + /** + * + * + *
+     * The name of the Istio service underlying this service. Corresponds to the
+     * `destination_service_name` metric label in Istio metrics.
+     * 
+ * + * string service_name = 4; + */ + java.lang.String getServiceName(); + /** + * + * + *
+     * The name of the Istio service underlying this service. Corresponds to the
+     * `destination_service_name` metric label in Istio metrics.
+     * 
+ * + * string service_name = 4; + */ + com.google.protobuf.ByteString getServiceNameBytes(); + } + /** + * + * + *
+   * Istio service. Learn more at http://istio.io.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.Service.ClusterIstio} + */ + public static final class ClusterIstio extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.Service.ClusterIstio) + ClusterIstioOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClusterIstio.newBuilder() to construct. + private ClusterIstio(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClusterIstio() { + location_ = ""; + clusterName_ = ""; + serviceNamespace_ = ""; + serviceName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClusterIstio( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + location_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + clusterName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceNamespace_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceName_ = 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_ClusterIstio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_ClusterIstio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.ClusterIstio.class, + com.google.monitoring.v3.Service.ClusterIstio.Builder.class); + } + + public static final int LOCATION_FIELD_NUMBER = 1; + private volatile java.lang.Object location_; + /** + * + * + *
+     * The location of the Kubernetes cluster in which this Istio service is
+     * defined. Corresponds to the `location` resource label in `k8s_cluster`
+     * resources.
+     * 
+ * + * string location = 1; + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + 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(); + location_ = s; + return s; + } + } + /** + * + * + *
+     * The location of the Kubernetes cluster in which this Istio service is
+     * defined. Corresponds to the `location` resource label in `k8s_cluster`
+     * resources.
+     * 
+ * + * string location = 1; + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object clusterName_; + /** + * + * + *
+     * The name of the Kubernetes cluster in which this Istio service is
+     * defined. Corresponds to the `cluster_name` resource label in
+     * `k8s_cluster` resources.
+     * 
+ * + * string cluster_name = 2; + */ + public java.lang.String getClusterName() { + java.lang.Object ref = clusterName_; + 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(); + clusterName_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the Kubernetes cluster in which this Istio service is
+     * defined. Corresponds to the `cluster_name` resource label in
+     * `k8s_cluster` resources.
+     * 
+ * + * string cluster_name = 2; + */ + public com.google.protobuf.ByteString getClusterNameBytes() { + java.lang.Object ref = clusterName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_NAMESPACE_FIELD_NUMBER = 3; + private volatile java.lang.Object serviceNamespace_; + /** + * + * + *
+     * The namespace of the Istio service underlying this service. Corresponds
+     * to the `destination_service_namespace` metric label in Istio metrics.
+     * 
+ * + * string service_namespace = 3; + */ + public java.lang.String getServiceNamespace() { + java.lang.Object ref = serviceNamespace_; + 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(); + serviceNamespace_ = s; + return s; + } + } + /** + * + * + *
+     * The namespace of the Istio service underlying this service. Corresponds
+     * to the `destination_service_namespace` metric label in Istio metrics.
+     * 
+ * + * string service_namespace = 3; + */ + public com.google.protobuf.ByteString getServiceNamespaceBytes() { + java.lang.Object ref = serviceNamespace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceNamespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_NAME_FIELD_NUMBER = 4; + private volatile java.lang.Object serviceName_; + /** + * + * + *
+     * The name of the Istio service underlying this service. Corresponds to the
+     * `destination_service_name` metric label in Istio metrics.
+     * 
+ * + * string service_name = 4; + */ + public java.lang.String getServiceName() { + java.lang.Object ref = serviceName_; + 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(); + serviceName_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the Istio service underlying this service. Corresponds to the
+     * `destination_service_name` metric label in Istio metrics.
+     * 
+ * + * string service_name = 4; + */ + public com.google.protobuf.ByteString getServiceNameBytes() { + java.lang.Object ref = serviceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceName_ = 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 (!getLocationBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, location_); + } + if (!getClusterNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterName_); + } + if (!getServiceNamespaceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, serviceNamespace_); + } + if (!getServiceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, serviceName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLocationBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, location_); + } + if (!getClusterNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterName_); + } + if (!getServiceNamespaceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, serviceNamespace_); + } + if (!getServiceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, serviceName_); + } + 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.ClusterIstio)) { + return super.equals(obj); + } + com.google.monitoring.v3.Service.ClusterIstio other = + (com.google.monitoring.v3.Service.ClusterIstio) obj; + + if (!getLocation().equals(other.getLocation())) return false; + if (!getClusterName().equals(other.getClusterName())) return false; + if (!getServiceNamespace().equals(other.getServiceNamespace())) return false; + if (!getServiceName().equals(other.getServiceName())) 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) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + CLUSTER_NAME_FIELD_NUMBER; + hash = (53 * hash) + getClusterName().hashCode(); + hash = (37 * hash) + SERVICE_NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getServiceNamespace().hashCode(); + hash = (37 * hash) + SERVICE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getServiceName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.Service.ClusterIstio parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.ClusterIstio 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.ClusterIstio parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.ClusterIstio 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.ClusterIstio parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service.ClusterIstio 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.ClusterIstio parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service.ClusterIstio 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.ClusterIstio parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service.ClusterIstio 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.ClusterIstio 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.ClusterIstio 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.ClusterIstio 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; + } + /** + * + * + *
+     * Istio service. Learn more at http://istio.io.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.Service.ClusterIstio} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.Service.ClusterIstio) + com.google.monitoring.v3.Service.ClusterIstioOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_ClusterIstio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_ClusterIstio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.ClusterIstio.class, + com.google.monitoring.v3.Service.ClusterIstio.Builder.class); + } + + // Construct using com.google.monitoring.v3.Service.ClusterIstio.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(); + location_ = ""; + + clusterName_ = ""; + + serviceNamespace_ = ""; + + serviceName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_ClusterIstio_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.Service.ClusterIstio getDefaultInstanceForType() { + return com.google.monitoring.v3.Service.ClusterIstio.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.Service.ClusterIstio build() { + com.google.monitoring.v3.Service.ClusterIstio result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.Service.ClusterIstio buildPartial() { + com.google.monitoring.v3.Service.ClusterIstio result = + new com.google.monitoring.v3.Service.ClusterIstio(this); + result.location_ = location_; + result.clusterName_ = clusterName_; + result.serviceNamespace_ = serviceNamespace_; + result.serviceName_ = serviceName_; + 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.ClusterIstio) { + return mergeFrom((com.google.monitoring.v3.Service.ClusterIstio) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.Service.ClusterIstio other) { + if (other == com.google.monitoring.v3.Service.ClusterIstio.getDefaultInstance()) + return this; + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + onChanged(); + } + if (!other.getClusterName().isEmpty()) { + clusterName_ = other.clusterName_; + onChanged(); + } + if (!other.getServiceNamespace().isEmpty()) { + serviceNamespace_ = other.serviceNamespace_; + onChanged(); + } + if (!other.getServiceName().isEmpty()) { + serviceName_ = other.serviceName_; + 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.ClusterIstio parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.Service.ClusterIstio) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+       * The location of the Kubernetes cluster in which this Istio service is
+       * defined. Corresponds to the `location` resource label in `k8s_cluster`
+       * resources.
+       * 
+ * + * string location = 1; + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The location of the Kubernetes cluster in which this Istio service is
+       * defined. Corresponds to the `location` resource label in `k8s_cluster`
+       * resources.
+       * 
+ * + * string location = 1; + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The location of the Kubernetes cluster in which this Istio service is
+       * defined. Corresponds to the `location` resource label in `k8s_cluster`
+       * resources.
+       * 
+ * + * string location = 1; + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + location_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The location of the Kubernetes cluster in which this Istio service is
+       * defined. Corresponds to the `location` resource label in `k8s_cluster`
+       * resources.
+       * 
+ * + * string location = 1; + */ + public Builder clearLocation() { + + location_ = getDefaultInstance().getLocation(); + onChanged(); + return this; + } + /** + * + * + *
+       * The location of the Kubernetes cluster in which this Istio service is
+       * defined. Corresponds to the `location` resource label in `k8s_cluster`
+       * resources.
+       * 
+ * + * string location = 1; + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + location_ = value; + onChanged(); + return this; + } + + private java.lang.Object clusterName_ = ""; + /** + * + * + *
+       * The name of the Kubernetes cluster in which this Istio service is
+       * defined. Corresponds to the `cluster_name` resource label in
+       * `k8s_cluster` resources.
+       * 
+ * + * string cluster_name = 2; + */ + public java.lang.String getClusterName() { + java.lang.Object ref = clusterName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the Kubernetes cluster in which this Istio service is
+       * defined. Corresponds to the `cluster_name` resource label in
+       * `k8s_cluster` resources.
+       * 
+ * + * string cluster_name = 2; + */ + public com.google.protobuf.ByteString getClusterNameBytes() { + java.lang.Object ref = clusterName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the Kubernetes cluster in which this Istio service is
+       * defined. Corresponds to the `cluster_name` resource label in
+       * `k8s_cluster` resources.
+       * 
+ * + * string cluster_name = 2; + */ + public Builder setClusterName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + clusterName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the Kubernetes cluster in which this Istio service is
+       * defined. Corresponds to the `cluster_name` resource label in
+       * `k8s_cluster` resources.
+       * 
+ * + * string cluster_name = 2; + */ + public Builder clearClusterName() { + + clusterName_ = getDefaultInstance().getClusterName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the Kubernetes cluster in which this Istio service is
+       * defined. Corresponds to the `cluster_name` resource label in
+       * `k8s_cluster` resources.
+       * 
+ * + * string cluster_name = 2; + */ + public Builder setClusterNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + clusterName_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceNamespace_ = ""; + /** + * + * + *
+       * The namespace of the Istio service underlying this service. Corresponds
+       * to the `destination_service_namespace` metric label in Istio metrics.
+       * 
+ * + * string service_namespace = 3; + */ + public java.lang.String getServiceNamespace() { + java.lang.Object ref = serviceNamespace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceNamespace_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The namespace of the Istio service underlying this service. Corresponds
+       * to the `destination_service_namespace` metric label in Istio metrics.
+       * 
+ * + * string service_namespace = 3; + */ + public com.google.protobuf.ByteString getServiceNamespaceBytes() { + java.lang.Object ref = serviceNamespace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceNamespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The namespace of the Istio service underlying this service. Corresponds
+       * to the `destination_service_namespace` metric label in Istio metrics.
+       * 
+ * + * string service_namespace = 3; + */ + public Builder setServiceNamespace(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceNamespace_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The namespace of the Istio service underlying this service. Corresponds
+       * to the `destination_service_namespace` metric label in Istio metrics.
+       * 
+ * + * string service_namespace = 3; + */ + public Builder clearServiceNamespace() { + + serviceNamespace_ = getDefaultInstance().getServiceNamespace(); + onChanged(); + return this; + } + /** + * + * + *
+       * The namespace of the Istio service underlying this service. Corresponds
+       * to the `destination_service_namespace` metric label in Istio metrics.
+       * 
+ * + * string service_namespace = 3; + */ + public Builder setServiceNamespaceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceNamespace_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceName_ = ""; + /** + * + * + *
+       * The name of the Istio service underlying this service. Corresponds to the
+       * `destination_service_name` metric label in Istio metrics.
+       * 
+ * + * string service_name = 4; + */ + public java.lang.String getServiceName() { + java.lang.Object ref = serviceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the Istio service underlying this service. Corresponds to the
+       * `destination_service_name` metric label in Istio metrics.
+       * 
+ * + * string service_name = 4; + */ + public com.google.protobuf.ByteString getServiceNameBytes() { + java.lang.Object ref = serviceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the Istio service underlying this service. Corresponds to the
+       * `destination_service_name` metric label in Istio metrics.
+       * 
+ * + * string service_name = 4; + */ + public Builder setServiceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the Istio service underlying this service. Corresponds to the
+       * `destination_service_name` metric label in Istio metrics.
+       * 
+ * + * string service_name = 4; + */ + public Builder clearServiceName() { + + serviceName_ = getDefaultInstance().getServiceName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the Istio service underlying this service. Corresponds to the
+       * `destination_service_name` metric label in Istio metrics.
+       * 
+ * + * string service_name = 4; + */ + public Builder setServiceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceName_ = 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.ClusterIstio) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.Service.ClusterIstio) + private static final com.google.monitoring.v3.Service.ClusterIstio DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.Service.ClusterIstio(); + } + + public static com.google.monitoring.v3.Service.ClusterIstio getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClusterIstio parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClusterIstio(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.ClusterIstio 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; + */ + 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; + */ + 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 + 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(); + } + int mutable_bitField0_ = 0; + 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; + */ + 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; + */ + 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(); + } + 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.Telemetry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.Service.Telemetry) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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; + */ + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * 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; + */ + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof 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; + } + } + /** + * + * + *
+       * 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; + */ + public Builder setResourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * 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; + */ + public Builder clearResourceName() { + + resourceName_ = getDefaultInstance().getResourceName(); + onChanged(); + return this; + } + /** + * + * + *
+       * 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; + */ + public Builder setResourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceName_ = 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.Telemetry) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.Service.Telemetry) + private static final com.google.monitoring.v3.Service.Telemetry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.Service.Telemetry(); + } + + public static com.google.monitoring.v3.Service.Telemetry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Telemetry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Telemetry(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.Telemetry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int identifierCase_ = 0; + private java.lang.Object identifier_; + + public enum IdentifierCase implements com.google.protobuf.Internal.EnumLite { + CUSTOM(6), + APP_ENGINE(7), + CLOUD_ENDPOINTS(8), + CLUSTER_ISTIO(9), + IDENTIFIER_NOT_SET(0); + private final int value; + + private IdentifierCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static IdentifierCase valueOf(int value) { + return forNumber(value); + } + + public static IdentifierCase forNumber(int value) { + switch (value) { + case 6: + return CUSTOM; + case 7: + return APP_ENGINE; + case 8: + return CLOUD_ENDPOINTS; + case 9: + return CLUSTER_ISTIO; + case 0: + return IDENTIFIER_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public IdentifierCase getIdentifierCase() { + return IdentifierCase.forNumber(identifierCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name for this Service. Of the form
+   * `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name for this Service. Of the form
+   * `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Name used for UI elements listing this Service.
+   * 
+ * + * string display_name = 2; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Name used for UI elements listing this Service.
+   * 
+ * + * string display_name = 2; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_FIELD_NUMBER = 6; + /** + * + * + *
+   * Custom service type.
+   * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + public boolean hasCustom() { + return identifierCase_ == 6; + } + /** + * + * + *
+   * Custom service type.
+   * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + public com.google.monitoring.v3.Service.Custom getCustom() { + if (identifierCase_ == 6) { + return (com.google.monitoring.v3.Service.Custom) identifier_; + } + return com.google.monitoring.v3.Service.Custom.getDefaultInstance(); + } + /** + * + * + *
+   * Custom service type.
+   * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + public com.google.monitoring.v3.Service.CustomOrBuilder getCustomOrBuilder() { + if (identifierCase_ == 6) { + return (com.google.monitoring.v3.Service.Custom) identifier_; + } + return com.google.monitoring.v3.Service.Custom.getDefaultInstance(); + } + + public static final int APP_ENGINE_FIELD_NUMBER = 7; + /** + * + * + *
+   * Type used for App Engine services.
+   * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + public boolean hasAppEngine() { + return identifierCase_ == 7; + } + /** + * + * + *
+   * Type used for App Engine services.
+   * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + public com.google.monitoring.v3.Service.AppEngine getAppEngine() { + if (identifierCase_ == 7) { + return (com.google.monitoring.v3.Service.AppEngine) identifier_; + } + return com.google.monitoring.v3.Service.AppEngine.getDefaultInstance(); + } + /** + * + * + *
+   * Type used for App Engine services.
+   * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + public com.google.monitoring.v3.Service.AppEngineOrBuilder getAppEngineOrBuilder() { + if (identifierCase_ == 7) { + return (com.google.monitoring.v3.Service.AppEngine) identifier_; + } + return com.google.monitoring.v3.Service.AppEngine.getDefaultInstance(); + } + + public static final int CLOUD_ENDPOINTS_FIELD_NUMBER = 8; + /** + * + * + *
+   * Type used for Cloud Endpoints services.
+   * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + public boolean hasCloudEndpoints() { + return identifierCase_ == 8; + } + /** + * + * + *
+   * Type used for Cloud Endpoints services.
+   * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + public com.google.monitoring.v3.Service.CloudEndpoints getCloudEndpoints() { + if (identifierCase_ == 8) { + return (com.google.monitoring.v3.Service.CloudEndpoints) identifier_; + } + return com.google.monitoring.v3.Service.CloudEndpoints.getDefaultInstance(); + } + /** + * + * + *
+   * Type used for Cloud Endpoints services.
+   * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + public com.google.monitoring.v3.Service.CloudEndpointsOrBuilder getCloudEndpointsOrBuilder() { + if (identifierCase_ == 8) { + return (com.google.monitoring.v3.Service.CloudEndpoints) identifier_; + } + return com.google.monitoring.v3.Service.CloudEndpoints.getDefaultInstance(); + } + + public static final int CLUSTER_ISTIO_FIELD_NUMBER = 9; + /** + * + * + *
+   * Type used for Istio services that live in a Kubernetes cluster.
+   * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + public boolean hasClusterIstio() { + return identifierCase_ == 9; + } + /** + * + * + *
+   * Type used for Istio services that live in a Kubernetes cluster.
+   * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + public com.google.monitoring.v3.Service.ClusterIstio getClusterIstio() { + if (identifierCase_ == 9) { + return (com.google.monitoring.v3.Service.ClusterIstio) identifier_; + } + return com.google.monitoring.v3.Service.ClusterIstio.getDefaultInstance(); + } + /** + * + * + *
+   * Type used for Istio services that live in a Kubernetes cluster.
+   * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + public com.google.monitoring.v3.Service.ClusterIstioOrBuilder getClusterIstioOrBuilder() { + if (identifierCase_ == 9) { + return (com.google.monitoring.v3.Service.ClusterIstio) identifier_; + } + return com.google.monitoring.v3.Service.ClusterIstio.getDefaultInstance(); + } + + public static final int TELEMETRY_FIELD_NUMBER = 13; + private com.google.monitoring.v3.Service.Telemetry telemetry_; + /** + * + * + *
+   * Configuration for how to query telemetry on a Service.
+   * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + public boolean hasTelemetry() { + return telemetry_ != null; + } + /** + * + * + *
+   * Configuration for how to query telemetry on a Service.
+   * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + public com.google.monitoring.v3.Service.Telemetry getTelemetry() { + return telemetry_ == null + ? com.google.monitoring.v3.Service.Telemetry.getDefaultInstance() + : telemetry_; + } + /** + * + * + *
+   * Configuration for how to query telemetry on a Service.
+   * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + public com.google.monitoring.v3.Service.TelemetryOrBuilder getTelemetryOrBuilder() { + return getTelemetry(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (identifierCase_ == 6) { + output.writeMessage(6, (com.google.monitoring.v3.Service.Custom) identifier_); + } + if (identifierCase_ == 7) { + output.writeMessage(7, (com.google.monitoring.v3.Service.AppEngine) identifier_); + } + if (identifierCase_ == 8) { + output.writeMessage(8, (com.google.monitoring.v3.Service.CloudEndpoints) identifier_); + } + if (identifierCase_ == 9) { + output.writeMessage(9, (com.google.monitoring.v3.Service.ClusterIstio) identifier_); + } + if (telemetry_ != null) { + output.writeMessage(13, getTelemetry()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (identifierCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.monitoring.v3.Service.Custom) identifier_); + } + if (identifierCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.monitoring.v3.Service.AppEngine) identifier_); + } + if (identifierCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.monitoring.v3.Service.CloudEndpoints) identifier_); + } + if (identifierCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.monitoring.v3.Service.ClusterIstio) identifier_); + } + if (telemetry_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getTelemetry()); + } + 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)) { + return super.equals(obj); + } + com.google.monitoring.v3.Service other = (com.google.monitoring.v3.Service) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasTelemetry() != other.hasTelemetry()) return false; + if (hasTelemetry()) { + if (!getTelemetry().equals(other.getTelemetry())) return false; + } + if (!getIdentifierCase().equals(other.getIdentifierCase())) return false; + switch (identifierCase_) { + case 6: + if (!getCustom().equals(other.getCustom())) return false; + break; + case 7: + if (!getAppEngine().equals(other.getAppEngine())) return false; + break; + case 8: + if (!getCloudEndpoints().equals(other.getCloudEndpoints())) return false; + break; + case 9: + if (!getClusterIstio().equals(other.getClusterIstio())) return false; + break; + case 0: + default: + } + 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (hasTelemetry()) { + hash = (37 * hash) + TELEMETRY_FIELD_NUMBER; + hash = (53 * hash) + getTelemetry().hashCode(); + } + switch (identifierCase_) { + case 6: + hash = (37 * hash) + CUSTOM_FIELD_NUMBER; + hash = (53 * hash) + getCustom().hashCode(); + break; + case 7: + hash = (37 * hash) + APP_ENGINE_FIELD_NUMBER; + hash = (53 * hash) + getAppEngine().hashCode(); + break; + case 8: + hash = (37 * hash) + CLOUD_ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getCloudEndpoints().hashCode(); + break; + case 9: + hash = (37 * hash) + CLUSTER_ISTIO_FIELD_NUMBER; + hash = (53 * hash) + getClusterIstio().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.Service parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service 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 parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service 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 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.Service 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 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service 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 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.Service 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 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 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 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 `Service` is a discrete, autonomous, and network-accessible unit, designed
+   * to solve an individual concern
+   * ([Wikipedia](https://en.wikipedia.org/wiki/Service-orientation)). In
+   * Stackdriver Monitoring, a `Service` acts as the root resource under which
+   * operational aspects of the service are accessible.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.Service} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.Service) + com.google.monitoring.v3.ServiceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.Service.class, + com.google.monitoring.v3.Service.Builder.class); + } + + // Construct using com.google.monitoring.v3.Service.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(); + name_ = ""; + + displayName_ = ""; + + if (telemetryBuilder_ == null) { + telemetry_ = null; + } else { + telemetry_ = null; + telemetryBuilder_ = null; + } + identifierCase_ = 0; + identifier_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_Service_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.Service getDefaultInstanceForType() { + return com.google.monitoring.v3.Service.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.Service build() { + com.google.monitoring.v3.Service result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.Service buildPartial() { + com.google.monitoring.v3.Service result = new com.google.monitoring.v3.Service(this); + result.name_ = name_; + result.displayName_ = displayName_; + if (identifierCase_ == 6) { + if (customBuilder_ == null) { + result.identifier_ = identifier_; + } else { + result.identifier_ = customBuilder_.build(); + } + } + if (identifierCase_ == 7) { + if (appEngineBuilder_ == null) { + result.identifier_ = identifier_; + } else { + result.identifier_ = appEngineBuilder_.build(); + } + } + if (identifierCase_ == 8) { + if (cloudEndpointsBuilder_ == null) { + result.identifier_ = identifier_; + } else { + result.identifier_ = cloudEndpointsBuilder_.build(); + } + } + if (identifierCase_ == 9) { + if (clusterIstioBuilder_ == null) { + result.identifier_ = identifier_; + } else { + result.identifier_ = clusterIstioBuilder_.build(); + } + } + if (telemetryBuilder_ == null) { + result.telemetry_ = telemetry_; + } else { + result.telemetry_ = telemetryBuilder_.build(); + } + result.identifierCase_ = identifierCase_; + 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) { + return mergeFrom((com.google.monitoring.v3.Service) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.Service other) { + if (other == com.google.monitoring.v3.Service.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.hasTelemetry()) { + mergeTelemetry(other.getTelemetry()); + } + switch (other.getIdentifierCase()) { + case CUSTOM: + { + mergeCustom(other.getCustom()); + break; + } + case APP_ENGINE: + { + mergeAppEngine(other.getAppEngine()); + break; + } + case CLOUD_ENDPOINTS: + { + mergeCloudEndpoints(other.getCloudEndpoints()); + break; + } + case CLUSTER_ISTIO: + { + mergeClusterIstio(other.getClusterIstio()); + break; + } + case IDENTIFIER_NOT_SET: + { + break; + } + } + 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 parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.Service) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int identifierCase_ = 0; + private java.lang.Object identifier_; + + public IdentifierCase getIdentifierCase() { + return IdentifierCase.forNumber(identifierCase_); + } + + public Builder clearIdentifier() { + identifierCase_ = 0; + identifier_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name for this Service. Of the form
+     * `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name for this Service. Of the form
+     * `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name for this Service. Of the form
+     * `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for this Service. Of the form
+     * `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for this Service. Of the form
+     * `projects/{project_id}/services/{service_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Name used for UI elements listing this Service.
+     * 
+ * + * string display_name = 2; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name used for UI elements listing this Service.
+     * 
+ * + * string display_name = 2; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name used for UI elements listing this Service.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name used for UI elements listing this Service.
+     * 
+ * + * string display_name = 2; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name used for UI elements listing this Service.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.Custom, + com.google.monitoring.v3.Service.Custom.Builder, + com.google.monitoring.v3.Service.CustomOrBuilder> + customBuilder_; + /** + * + * + *
+     * Custom service type.
+     * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + public boolean hasCustom() { + return identifierCase_ == 6; + } + /** + * + * + *
+     * Custom service type.
+     * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + public com.google.monitoring.v3.Service.Custom getCustom() { + if (customBuilder_ == null) { + if (identifierCase_ == 6) { + return (com.google.monitoring.v3.Service.Custom) identifier_; + } + return com.google.monitoring.v3.Service.Custom.getDefaultInstance(); + } else { + if (identifierCase_ == 6) { + return customBuilder_.getMessage(); + } + return com.google.monitoring.v3.Service.Custom.getDefaultInstance(); + } + } + /** + * + * + *
+     * Custom service type.
+     * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + public Builder setCustom(com.google.monitoring.v3.Service.Custom value) { + if (customBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + identifier_ = value; + onChanged(); + } else { + customBuilder_.setMessage(value); + } + identifierCase_ = 6; + return this; + } + /** + * + * + *
+     * Custom service type.
+     * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + public Builder setCustom(com.google.monitoring.v3.Service.Custom.Builder builderForValue) { + if (customBuilder_ == null) { + identifier_ = builderForValue.build(); + onChanged(); + } else { + customBuilder_.setMessage(builderForValue.build()); + } + identifierCase_ = 6; + return this; + } + /** + * + * + *
+     * Custom service type.
+     * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + public Builder mergeCustom(com.google.monitoring.v3.Service.Custom value) { + if (customBuilder_ == null) { + if (identifierCase_ == 6 + && identifier_ != com.google.monitoring.v3.Service.Custom.getDefaultInstance()) { + identifier_ = + com.google.monitoring.v3.Service.Custom.newBuilder( + (com.google.monitoring.v3.Service.Custom) identifier_) + .mergeFrom(value) + .buildPartial(); + } else { + identifier_ = value; + } + onChanged(); + } else { + if (identifierCase_ == 6) { + customBuilder_.mergeFrom(value); + } + customBuilder_.setMessage(value); + } + identifierCase_ = 6; + return this; + } + /** + * + * + *
+     * Custom service type.
+     * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + public Builder clearCustom() { + if (customBuilder_ == null) { + if (identifierCase_ == 6) { + identifierCase_ = 0; + identifier_ = null; + onChanged(); + } + } else { + if (identifierCase_ == 6) { + identifierCase_ = 0; + identifier_ = null; + } + customBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Custom service type.
+     * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + public com.google.monitoring.v3.Service.Custom.Builder getCustomBuilder() { + return getCustomFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Custom service type.
+     * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + public com.google.monitoring.v3.Service.CustomOrBuilder getCustomOrBuilder() { + if ((identifierCase_ == 6) && (customBuilder_ != null)) { + return customBuilder_.getMessageOrBuilder(); + } else { + if (identifierCase_ == 6) { + return (com.google.monitoring.v3.Service.Custom) identifier_; + } + return com.google.monitoring.v3.Service.Custom.getDefaultInstance(); + } + } + /** + * + * + *
+     * Custom service type.
+     * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.Custom, + com.google.monitoring.v3.Service.Custom.Builder, + com.google.monitoring.v3.Service.CustomOrBuilder> + getCustomFieldBuilder() { + if (customBuilder_ == null) { + if (!(identifierCase_ == 6)) { + identifier_ = com.google.monitoring.v3.Service.Custom.getDefaultInstance(); + } + customBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.Custom, + com.google.monitoring.v3.Service.Custom.Builder, + com.google.monitoring.v3.Service.CustomOrBuilder>( + (com.google.monitoring.v3.Service.Custom) identifier_, + getParentForChildren(), + isClean()); + identifier_ = null; + } + identifierCase_ = 6; + onChanged(); + ; + return customBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.AppEngine, + com.google.monitoring.v3.Service.AppEngine.Builder, + com.google.monitoring.v3.Service.AppEngineOrBuilder> + appEngineBuilder_; + /** + * + * + *
+     * Type used for App Engine services.
+     * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + public boolean hasAppEngine() { + return identifierCase_ == 7; + } + /** + * + * + *
+     * Type used for App Engine services.
+     * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + public com.google.monitoring.v3.Service.AppEngine getAppEngine() { + if (appEngineBuilder_ == null) { + if (identifierCase_ == 7) { + return (com.google.monitoring.v3.Service.AppEngine) identifier_; + } + return com.google.monitoring.v3.Service.AppEngine.getDefaultInstance(); + } else { + if (identifierCase_ == 7) { + return appEngineBuilder_.getMessage(); + } + return com.google.monitoring.v3.Service.AppEngine.getDefaultInstance(); + } + } + /** + * + * + *
+     * Type used for App Engine services.
+     * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + public Builder setAppEngine(com.google.monitoring.v3.Service.AppEngine value) { + if (appEngineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + identifier_ = value; + onChanged(); + } else { + appEngineBuilder_.setMessage(value); + } + identifierCase_ = 7; + return this; + } + /** + * + * + *
+     * Type used for App Engine services.
+     * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + public Builder setAppEngine( + com.google.monitoring.v3.Service.AppEngine.Builder builderForValue) { + if (appEngineBuilder_ == null) { + identifier_ = builderForValue.build(); + onChanged(); + } else { + appEngineBuilder_.setMessage(builderForValue.build()); + } + identifierCase_ = 7; + return this; + } + /** + * + * + *
+     * Type used for App Engine services.
+     * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + public Builder mergeAppEngine(com.google.monitoring.v3.Service.AppEngine value) { + if (appEngineBuilder_ == null) { + if (identifierCase_ == 7 + && identifier_ != com.google.monitoring.v3.Service.AppEngine.getDefaultInstance()) { + identifier_ = + com.google.monitoring.v3.Service.AppEngine.newBuilder( + (com.google.monitoring.v3.Service.AppEngine) identifier_) + .mergeFrom(value) + .buildPartial(); + } else { + identifier_ = value; + } + onChanged(); + } else { + if (identifierCase_ == 7) { + appEngineBuilder_.mergeFrom(value); + } + appEngineBuilder_.setMessage(value); + } + identifierCase_ = 7; + return this; + } + /** + * + * + *
+     * Type used for App Engine services.
+     * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + public Builder clearAppEngine() { + if (appEngineBuilder_ == null) { + if (identifierCase_ == 7) { + identifierCase_ = 0; + identifier_ = null; + onChanged(); + } + } else { + if (identifierCase_ == 7) { + identifierCase_ = 0; + identifier_ = null; + } + appEngineBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Type used for App Engine services.
+     * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + public com.google.monitoring.v3.Service.AppEngine.Builder getAppEngineBuilder() { + return getAppEngineFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Type used for App Engine services.
+     * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + public com.google.monitoring.v3.Service.AppEngineOrBuilder getAppEngineOrBuilder() { + if ((identifierCase_ == 7) && (appEngineBuilder_ != null)) { + return appEngineBuilder_.getMessageOrBuilder(); + } else { + if (identifierCase_ == 7) { + return (com.google.monitoring.v3.Service.AppEngine) identifier_; + } + return com.google.monitoring.v3.Service.AppEngine.getDefaultInstance(); + } + } + /** + * + * + *
+     * Type used for App Engine services.
+     * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.AppEngine, + com.google.monitoring.v3.Service.AppEngine.Builder, + com.google.monitoring.v3.Service.AppEngineOrBuilder> + getAppEngineFieldBuilder() { + if (appEngineBuilder_ == null) { + if (!(identifierCase_ == 7)) { + identifier_ = com.google.monitoring.v3.Service.AppEngine.getDefaultInstance(); + } + appEngineBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.AppEngine, + com.google.monitoring.v3.Service.AppEngine.Builder, + com.google.monitoring.v3.Service.AppEngineOrBuilder>( + (com.google.monitoring.v3.Service.AppEngine) identifier_, + getParentForChildren(), + isClean()); + identifier_ = null; + } + identifierCase_ = 7; + onChanged(); + ; + return appEngineBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.CloudEndpoints, + com.google.monitoring.v3.Service.CloudEndpoints.Builder, + com.google.monitoring.v3.Service.CloudEndpointsOrBuilder> + cloudEndpointsBuilder_; + /** + * + * + *
+     * Type used for Cloud Endpoints services.
+     * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + public boolean hasCloudEndpoints() { + return identifierCase_ == 8; + } + /** + * + * + *
+     * Type used for Cloud Endpoints services.
+     * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + public com.google.monitoring.v3.Service.CloudEndpoints getCloudEndpoints() { + if (cloudEndpointsBuilder_ == null) { + if (identifierCase_ == 8) { + return (com.google.monitoring.v3.Service.CloudEndpoints) identifier_; + } + return com.google.monitoring.v3.Service.CloudEndpoints.getDefaultInstance(); + } else { + if (identifierCase_ == 8) { + return cloudEndpointsBuilder_.getMessage(); + } + return com.google.monitoring.v3.Service.CloudEndpoints.getDefaultInstance(); + } + } + /** + * + * + *
+     * Type used for Cloud Endpoints services.
+     * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + public Builder setCloudEndpoints(com.google.monitoring.v3.Service.CloudEndpoints value) { + if (cloudEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + identifier_ = value; + onChanged(); + } else { + cloudEndpointsBuilder_.setMessage(value); + } + identifierCase_ = 8; + return this; + } + /** + * + * + *
+     * Type used for Cloud Endpoints services.
+     * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + public Builder setCloudEndpoints( + com.google.monitoring.v3.Service.CloudEndpoints.Builder builderForValue) { + if (cloudEndpointsBuilder_ == null) { + identifier_ = builderForValue.build(); + onChanged(); + } else { + cloudEndpointsBuilder_.setMessage(builderForValue.build()); + } + identifierCase_ = 8; + return this; + } + /** + * + * + *
+     * Type used for Cloud Endpoints services.
+     * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + public Builder mergeCloudEndpoints(com.google.monitoring.v3.Service.CloudEndpoints value) { + if (cloudEndpointsBuilder_ == null) { + if (identifierCase_ == 8 + && identifier_ + != com.google.monitoring.v3.Service.CloudEndpoints.getDefaultInstance()) { + identifier_ = + com.google.monitoring.v3.Service.CloudEndpoints.newBuilder( + (com.google.monitoring.v3.Service.CloudEndpoints) identifier_) + .mergeFrom(value) + .buildPartial(); + } else { + identifier_ = value; + } + onChanged(); + } else { + if (identifierCase_ == 8) { + cloudEndpointsBuilder_.mergeFrom(value); + } + cloudEndpointsBuilder_.setMessage(value); + } + identifierCase_ = 8; + return this; + } + /** + * + * + *
+     * Type used for Cloud Endpoints services.
+     * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + public Builder clearCloudEndpoints() { + if (cloudEndpointsBuilder_ == null) { + if (identifierCase_ == 8) { + identifierCase_ = 0; + identifier_ = null; + onChanged(); + } + } else { + if (identifierCase_ == 8) { + identifierCase_ = 0; + identifier_ = null; + } + cloudEndpointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Type used for Cloud Endpoints services.
+     * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + public com.google.monitoring.v3.Service.CloudEndpoints.Builder getCloudEndpointsBuilder() { + return getCloudEndpointsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Type used for Cloud Endpoints services.
+     * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + public com.google.monitoring.v3.Service.CloudEndpointsOrBuilder getCloudEndpointsOrBuilder() { + if ((identifierCase_ == 8) && (cloudEndpointsBuilder_ != null)) { + return cloudEndpointsBuilder_.getMessageOrBuilder(); + } else { + if (identifierCase_ == 8) { + return (com.google.monitoring.v3.Service.CloudEndpoints) identifier_; + } + return com.google.monitoring.v3.Service.CloudEndpoints.getDefaultInstance(); + } + } + /** + * + * + *
+     * Type used for Cloud Endpoints services.
+     * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.CloudEndpoints, + com.google.monitoring.v3.Service.CloudEndpoints.Builder, + com.google.monitoring.v3.Service.CloudEndpointsOrBuilder> + getCloudEndpointsFieldBuilder() { + if (cloudEndpointsBuilder_ == null) { + if (!(identifierCase_ == 8)) { + identifier_ = com.google.monitoring.v3.Service.CloudEndpoints.getDefaultInstance(); + } + cloudEndpointsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.CloudEndpoints, + com.google.monitoring.v3.Service.CloudEndpoints.Builder, + com.google.monitoring.v3.Service.CloudEndpointsOrBuilder>( + (com.google.monitoring.v3.Service.CloudEndpoints) identifier_, + getParentForChildren(), + isClean()); + identifier_ = null; + } + identifierCase_ = 8; + onChanged(); + ; + return cloudEndpointsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.ClusterIstio, + com.google.monitoring.v3.Service.ClusterIstio.Builder, + com.google.monitoring.v3.Service.ClusterIstioOrBuilder> + clusterIstioBuilder_; + /** + * + * + *
+     * Type used for Istio services that live in a Kubernetes cluster.
+     * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + public boolean hasClusterIstio() { + return identifierCase_ == 9; + } + /** + * + * + *
+     * Type used for Istio services that live in a Kubernetes cluster.
+     * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + public com.google.monitoring.v3.Service.ClusterIstio getClusterIstio() { + if (clusterIstioBuilder_ == null) { + if (identifierCase_ == 9) { + return (com.google.monitoring.v3.Service.ClusterIstio) identifier_; + } + return com.google.monitoring.v3.Service.ClusterIstio.getDefaultInstance(); + } else { + if (identifierCase_ == 9) { + return clusterIstioBuilder_.getMessage(); + } + return com.google.monitoring.v3.Service.ClusterIstio.getDefaultInstance(); + } + } + /** + * + * + *
+     * Type used for Istio services that live in a Kubernetes cluster.
+     * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + public Builder setClusterIstio(com.google.monitoring.v3.Service.ClusterIstio value) { + if (clusterIstioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + identifier_ = value; + onChanged(); + } else { + clusterIstioBuilder_.setMessage(value); + } + identifierCase_ = 9; + return this; + } + /** + * + * + *
+     * Type used for Istio services that live in a Kubernetes cluster.
+     * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + public Builder setClusterIstio( + com.google.monitoring.v3.Service.ClusterIstio.Builder builderForValue) { + if (clusterIstioBuilder_ == null) { + identifier_ = builderForValue.build(); + onChanged(); + } else { + clusterIstioBuilder_.setMessage(builderForValue.build()); + } + identifierCase_ = 9; + return this; + } + /** + * + * + *
+     * Type used for Istio services that live in a Kubernetes cluster.
+     * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + public Builder mergeClusterIstio(com.google.monitoring.v3.Service.ClusterIstio value) { + if (clusterIstioBuilder_ == null) { + if (identifierCase_ == 9 + && identifier_ != com.google.monitoring.v3.Service.ClusterIstio.getDefaultInstance()) { + identifier_ = + com.google.monitoring.v3.Service.ClusterIstio.newBuilder( + (com.google.monitoring.v3.Service.ClusterIstio) identifier_) + .mergeFrom(value) + .buildPartial(); + } else { + identifier_ = value; + } + onChanged(); + } else { + if (identifierCase_ == 9) { + clusterIstioBuilder_.mergeFrom(value); + } + clusterIstioBuilder_.setMessage(value); + } + identifierCase_ = 9; + return this; + } + /** + * + * + *
+     * Type used for Istio services that live in a Kubernetes cluster.
+     * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + public Builder clearClusterIstio() { + if (clusterIstioBuilder_ == null) { + if (identifierCase_ == 9) { + identifierCase_ = 0; + identifier_ = null; + onChanged(); + } + } else { + if (identifierCase_ == 9) { + identifierCase_ = 0; + identifier_ = null; + } + clusterIstioBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Type used for Istio services that live in a Kubernetes cluster.
+     * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + public com.google.monitoring.v3.Service.ClusterIstio.Builder getClusterIstioBuilder() { + return getClusterIstioFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Type used for Istio services that live in a Kubernetes cluster.
+     * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + public com.google.monitoring.v3.Service.ClusterIstioOrBuilder getClusterIstioOrBuilder() { + if ((identifierCase_ == 9) && (clusterIstioBuilder_ != null)) { + return clusterIstioBuilder_.getMessageOrBuilder(); + } else { + if (identifierCase_ == 9) { + return (com.google.monitoring.v3.Service.ClusterIstio) identifier_; + } + return com.google.monitoring.v3.Service.ClusterIstio.getDefaultInstance(); + } + } + /** + * + * + *
+     * Type used for Istio services that live in a Kubernetes cluster.
+     * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.ClusterIstio, + com.google.monitoring.v3.Service.ClusterIstio.Builder, + com.google.monitoring.v3.Service.ClusterIstioOrBuilder> + getClusterIstioFieldBuilder() { + if (clusterIstioBuilder_ == null) { + if (!(identifierCase_ == 9)) { + identifier_ = com.google.monitoring.v3.Service.ClusterIstio.getDefaultInstance(); + } + clusterIstioBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.ClusterIstio, + com.google.monitoring.v3.Service.ClusterIstio.Builder, + com.google.monitoring.v3.Service.ClusterIstioOrBuilder>( + (com.google.monitoring.v3.Service.ClusterIstio) identifier_, + getParentForChildren(), + isClean()); + identifier_ = null; + } + identifierCase_ = 9; + onChanged(); + ; + return clusterIstioBuilder_; + } + + private com.google.monitoring.v3.Service.Telemetry telemetry_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.Telemetry, + com.google.monitoring.v3.Service.Telemetry.Builder, + com.google.monitoring.v3.Service.TelemetryOrBuilder> + telemetryBuilder_; + /** + * + * + *
+     * Configuration for how to query telemetry on a Service.
+     * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + public boolean hasTelemetry() { + return telemetryBuilder_ != null || telemetry_ != null; + } + /** + * + * + *
+     * Configuration for how to query telemetry on a Service.
+     * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + public com.google.monitoring.v3.Service.Telemetry getTelemetry() { + if (telemetryBuilder_ == null) { + return telemetry_ == null + ? com.google.monitoring.v3.Service.Telemetry.getDefaultInstance() + : telemetry_; + } else { + return telemetryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Configuration for how to query telemetry on a Service.
+     * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + public Builder setTelemetry(com.google.monitoring.v3.Service.Telemetry value) { + if (telemetryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + telemetry_ = value; + onChanged(); + } else { + telemetryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Configuration for how to query telemetry on a Service.
+     * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + public Builder setTelemetry( + com.google.monitoring.v3.Service.Telemetry.Builder builderForValue) { + if (telemetryBuilder_ == null) { + telemetry_ = builderForValue.build(); + onChanged(); + } else { + telemetryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Configuration for how to query telemetry on a Service.
+     * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + public Builder mergeTelemetry(com.google.monitoring.v3.Service.Telemetry value) { + if (telemetryBuilder_ == null) { + if (telemetry_ != null) { + telemetry_ = + com.google.monitoring.v3.Service.Telemetry.newBuilder(telemetry_) + .mergeFrom(value) + .buildPartial(); + } else { + telemetry_ = value; + } + onChanged(); + } else { + telemetryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Configuration for how to query telemetry on a Service.
+     * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + public Builder clearTelemetry() { + if (telemetryBuilder_ == null) { + telemetry_ = null; + onChanged(); + } else { + telemetry_ = null; + telemetryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Configuration for how to query telemetry on a Service.
+     * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + public com.google.monitoring.v3.Service.Telemetry.Builder getTelemetryBuilder() { + + onChanged(); + return getTelemetryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configuration for how to query telemetry on a Service.
+     * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + public com.google.monitoring.v3.Service.TelemetryOrBuilder getTelemetryOrBuilder() { + if (telemetryBuilder_ != null) { + return telemetryBuilder_.getMessageOrBuilder(); + } else { + return telemetry_ == null + ? com.google.monitoring.v3.Service.Telemetry.getDefaultInstance() + : telemetry_; + } + } + /** + * + * + *
+     * Configuration for how to query telemetry on a Service.
+     * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.Telemetry, + com.google.monitoring.v3.Service.Telemetry.Builder, + com.google.monitoring.v3.Service.TelemetryOrBuilder> + getTelemetryFieldBuilder() { + if (telemetryBuilder_ == null) { + telemetryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service.Telemetry, + com.google.monitoring.v3.Service.Telemetry.Builder, + com.google.monitoring.v3.Service.TelemetryOrBuilder>( + getTelemetry(), getParentForChildren(), isClean()); + telemetry_ = null; + } + return telemetryBuilder_; + } + + @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) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.Service) + private static final com.google.monitoring.v3.Service DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.Service(); + } + + public static com.google.monitoring.v3.Service getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Service parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Service(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 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelIndicator.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelIndicator.java new file mode 100644 index 00000000..ed4c22be --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelIndicator.java @@ -0,0 +1,1410 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * A Service-Level Indicator (SLI) describes the "performance" of a service. For
+ * some services, the SLI is well-defined. In such cases, the SLI can be
+ * described easily by referencing the well-known SLI and providing the needed
+ * parameters. Alternatively, a "custom" SLI can be defined with a query to the
+ * underlying metric store. An SLI is defined to be `good_service /
+ * total_service` over any queried time interval. The value of performance
+ * always falls into the range `0 <= performance <= 1`. A custom SLI describes
+ * how to compute this ratio, whether this is by dividing values from a pair of
+ * time series, cutting a `Distribution` into good and bad counts, or counting
+ * time windows in which the service complies with a criterion. For separation
+ * of concerns, a single Service-Level Indicator measures performance for only
+ * one aspect of service quality, such as fraction of successful queries or
+ * fast-enough queries.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.ServiceLevelIndicator} + */ +public final class ServiceLevelIndicator extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.ServiceLevelIndicator) + ServiceLevelIndicatorOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceLevelIndicator.newBuilder() to construct. + private ServiceLevelIndicator(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServiceLevelIndicator() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServiceLevelIndicator( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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: + { + com.google.monitoring.v3.RequestBasedSli.Builder subBuilder = null; + if (typeCase_ == 1) { + subBuilder = ((com.google.monitoring.v3.RequestBasedSli) type_).toBuilder(); + } + type_ = + input.readMessage( + com.google.monitoring.v3.RequestBasedSli.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.v3.RequestBasedSli) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 1; + break; + } + case 18: + { + com.google.monitoring.v3.WindowsBasedSli.Builder subBuilder = null; + if (typeCase_ == 2) { + subBuilder = ((com.google.monitoring.v3.WindowsBasedSli) type_).toBuilder(); + } + type_ = + input.readMessage( + com.google.monitoring.v3.WindowsBasedSli.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.v3.WindowsBasedSli) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 2; + break; + } + case 34: + { + com.google.monitoring.v3.BasicSli.Builder subBuilder = null; + if (typeCase_ == 4) { + subBuilder = ((com.google.monitoring.v3.BasicSli) type_).toBuilder(); + } + type_ = + input.readMessage(com.google.monitoring.v3.BasicSli.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.v3.BasicSli) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 4; + 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_ServiceLevelIndicator_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_ServiceLevelIndicator_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ServiceLevelIndicator.class, + com.google.monitoring.v3.ServiceLevelIndicator.Builder.class); + } + + private int typeCase_ = 0; + private java.lang.Object type_; + + public enum TypeCase implements com.google.protobuf.Internal.EnumLite { + BASIC_SLI(4), + REQUEST_BASED(1), + WINDOWS_BASED(2), + TYPE_NOT_SET(0); + private final int value; + + private TypeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static TypeCase valueOf(int value) { + return forNumber(value); + } + + public static TypeCase forNumber(int value) { + switch (value) { + case 4: + return BASIC_SLI; + case 1: + return REQUEST_BASED; + case 2: + return WINDOWS_BASED; + case 0: + return TYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public static final int BASIC_SLI_FIELD_NUMBER = 4; + /** + * + * + *
+   * Basic SLI on a well-known service type.
+   * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + public boolean hasBasicSli() { + return typeCase_ == 4; + } + /** + * + * + *
+   * Basic SLI on a well-known service type.
+   * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + public com.google.monitoring.v3.BasicSli getBasicSli() { + if (typeCase_ == 4) { + return (com.google.monitoring.v3.BasicSli) type_; + } + return com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } + /** + * + * + *
+   * Basic SLI on a well-known service type.
+   * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + public com.google.monitoring.v3.BasicSliOrBuilder getBasicSliOrBuilder() { + if (typeCase_ == 4) { + return (com.google.monitoring.v3.BasicSli) type_; + } + return com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } + + public static final int REQUEST_BASED_FIELD_NUMBER = 1; + /** + * + * + *
+   * Request-based SLIs
+   * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + public boolean hasRequestBased() { + return typeCase_ == 1; + } + /** + * + * + *
+   * Request-based SLIs
+   * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + public com.google.monitoring.v3.RequestBasedSli getRequestBased() { + if (typeCase_ == 1) { + return (com.google.monitoring.v3.RequestBasedSli) type_; + } + return com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } + /** + * + * + *
+   * Request-based SLIs
+   * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + public com.google.monitoring.v3.RequestBasedSliOrBuilder getRequestBasedOrBuilder() { + if (typeCase_ == 1) { + return (com.google.monitoring.v3.RequestBasedSli) type_; + } + return com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } + + public static final int WINDOWS_BASED_FIELD_NUMBER = 2; + /** + * + * + *
+   * Windows-based SLIs
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + public boolean hasWindowsBased() { + return typeCase_ == 2; + } + /** + * + * + *
+   * Windows-based SLIs
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + public com.google.monitoring.v3.WindowsBasedSli getWindowsBased() { + if (typeCase_ == 2) { + return (com.google.monitoring.v3.WindowsBasedSli) type_; + } + return com.google.monitoring.v3.WindowsBasedSli.getDefaultInstance(); + } + /** + * + * + *
+   * Windows-based SLIs
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + public com.google.monitoring.v3.WindowsBasedSliOrBuilder getWindowsBasedOrBuilder() { + if (typeCase_ == 2) { + return (com.google.monitoring.v3.WindowsBasedSli) type_; + } + return com.google.monitoring.v3.WindowsBasedSli.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (typeCase_ == 1) { + output.writeMessage(1, (com.google.monitoring.v3.RequestBasedSli) type_); + } + if (typeCase_ == 2) { + output.writeMessage(2, (com.google.monitoring.v3.WindowsBasedSli) type_); + } + if (typeCase_ == 4) { + output.writeMessage(4, (com.google.monitoring.v3.BasicSli) type_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (typeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.monitoring.v3.RequestBasedSli) type_); + } + if (typeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.monitoring.v3.WindowsBasedSli) type_); + } + if (typeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.monitoring.v3.BasicSli) type_); + } + 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.ServiceLevelIndicator)) { + return super.equals(obj); + } + com.google.monitoring.v3.ServiceLevelIndicator other = + (com.google.monitoring.v3.ServiceLevelIndicator) obj; + + if (!getTypeCase().equals(other.getTypeCase())) return false; + switch (typeCase_) { + case 4: + if (!getBasicSli().equals(other.getBasicSli())) return false; + break; + case 1: + if (!getRequestBased().equals(other.getRequestBased())) return false; + break; + case 2: + if (!getWindowsBased().equals(other.getWindowsBased())) return false; + break; + case 0: + default: + } + 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(); + switch (typeCase_) { + case 4: + hash = (37 * hash) + BASIC_SLI_FIELD_NUMBER; + hash = (53 * hash) + getBasicSli().hashCode(); + break; + case 1: + hash = (37 * hash) + REQUEST_BASED_FIELD_NUMBER; + hash = (53 * hash) + getRequestBased().hashCode(); + break; + case 2: + hash = (37 * hash) + WINDOWS_BASED_FIELD_NUMBER; + hash = (53 * hash) + getWindowsBased().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.ServiceLevelIndicator parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ServiceLevelIndicator 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.ServiceLevelIndicator parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ServiceLevelIndicator 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.ServiceLevelIndicator parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ServiceLevelIndicator parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.ServiceLevelIndicator parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ServiceLevelIndicator 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.ServiceLevelIndicator parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ServiceLevelIndicator 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.ServiceLevelIndicator parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ServiceLevelIndicator 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.ServiceLevelIndicator 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 Service-Level Indicator (SLI) describes the "performance" of a service. For
+   * some services, the SLI is well-defined. In such cases, the SLI can be
+   * described easily by referencing the well-known SLI and providing the needed
+   * parameters. Alternatively, a "custom" SLI can be defined with a query to the
+   * underlying metric store. An SLI is defined to be `good_service /
+   * total_service` over any queried time interval. The value of performance
+   * always falls into the range `0 <= performance <= 1`. A custom SLI describes
+   * how to compute this ratio, whether this is by dividing values from a pair of
+   * time series, cutting a `Distribution` into good and bad counts, or counting
+   * time windows in which the service complies with a criterion. For separation
+   * of concerns, a single Service-Level Indicator measures performance for only
+   * one aspect of service quality, such as fraction of successful queries or
+   * fast-enough queries.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.ServiceLevelIndicator} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.ServiceLevelIndicator) + com.google.monitoring.v3.ServiceLevelIndicatorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_ServiceLevelIndicator_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_ServiceLevelIndicator_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ServiceLevelIndicator.class, + com.google.monitoring.v3.ServiceLevelIndicator.Builder.class); + } + + // Construct using com.google.monitoring.v3.ServiceLevelIndicator.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(); + typeCase_ = 0; + type_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_ServiceLevelIndicator_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.ServiceLevelIndicator getDefaultInstanceForType() { + return com.google.monitoring.v3.ServiceLevelIndicator.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.ServiceLevelIndicator build() { + com.google.monitoring.v3.ServiceLevelIndicator result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.ServiceLevelIndicator buildPartial() { + com.google.monitoring.v3.ServiceLevelIndicator result = + new com.google.monitoring.v3.ServiceLevelIndicator(this); + if (typeCase_ == 4) { + if (basicSliBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = basicSliBuilder_.build(); + } + } + if (typeCase_ == 1) { + if (requestBasedBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = requestBasedBuilder_.build(); + } + } + if (typeCase_ == 2) { + if (windowsBasedBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = windowsBasedBuilder_.build(); + } + } + result.typeCase_ = typeCase_; + 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.ServiceLevelIndicator) { + return mergeFrom((com.google.monitoring.v3.ServiceLevelIndicator) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.ServiceLevelIndicator other) { + if (other == com.google.monitoring.v3.ServiceLevelIndicator.getDefaultInstance()) return this; + switch (other.getTypeCase()) { + case BASIC_SLI: + { + mergeBasicSli(other.getBasicSli()); + break; + } + case REQUEST_BASED: + { + mergeRequestBased(other.getRequestBased()); + break; + } + case WINDOWS_BASED: + { + mergeWindowsBased(other.getWindowsBased()); + break; + } + case TYPE_NOT_SET: + { + break; + } + } + 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.ServiceLevelIndicator parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.ServiceLevelIndicator) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int typeCase_ = 0; + private java.lang.Object type_; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public Builder clearType() { + typeCase_ = 0; + type_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli, + com.google.monitoring.v3.BasicSli.Builder, + com.google.monitoring.v3.BasicSliOrBuilder> + basicSliBuilder_; + /** + * + * + *
+     * Basic SLI on a well-known service type.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + public boolean hasBasicSli() { + return typeCase_ == 4; + } + /** + * + * + *
+     * Basic SLI on a well-known service type.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + public com.google.monitoring.v3.BasicSli getBasicSli() { + if (basicSliBuilder_ == null) { + if (typeCase_ == 4) { + return (com.google.monitoring.v3.BasicSli) type_; + } + return com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } else { + if (typeCase_ == 4) { + return basicSliBuilder_.getMessage(); + } + return com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } + } + /** + * + * + *
+     * Basic SLI on a well-known service type.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + public Builder setBasicSli(com.google.monitoring.v3.BasicSli value) { + if (basicSliBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + basicSliBuilder_.setMessage(value); + } + typeCase_ = 4; + return this; + } + /** + * + * + *
+     * Basic SLI on a well-known service type.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + public Builder setBasicSli(com.google.monitoring.v3.BasicSli.Builder builderForValue) { + if (basicSliBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + basicSliBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 4; + return this; + } + /** + * + * + *
+     * Basic SLI on a well-known service type.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + public Builder mergeBasicSli(com.google.monitoring.v3.BasicSli value) { + if (basicSliBuilder_ == null) { + if (typeCase_ == 4 && type_ != com.google.monitoring.v3.BasicSli.getDefaultInstance()) { + type_ = + com.google.monitoring.v3.BasicSli.newBuilder( + (com.google.monitoring.v3.BasicSli) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 4) { + basicSliBuilder_.mergeFrom(value); + } + basicSliBuilder_.setMessage(value); + } + typeCase_ = 4; + return this; + } + /** + * + * + *
+     * Basic SLI on a well-known service type.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + public Builder clearBasicSli() { + if (basicSliBuilder_ == null) { + if (typeCase_ == 4) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 4) { + typeCase_ = 0; + type_ = null; + } + basicSliBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Basic SLI on a well-known service type.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + public com.google.monitoring.v3.BasicSli.Builder getBasicSliBuilder() { + return getBasicSliFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Basic SLI on a well-known service type.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + public com.google.monitoring.v3.BasicSliOrBuilder getBasicSliOrBuilder() { + if ((typeCase_ == 4) && (basicSliBuilder_ != null)) { + return basicSliBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 4) { + return (com.google.monitoring.v3.BasicSli) type_; + } + return com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } + } + /** + * + * + *
+     * Basic SLI on a well-known service type.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli, + com.google.monitoring.v3.BasicSli.Builder, + com.google.monitoring.v3.BasicSliOrBuilder> + getBasicSliFieldBuilder() { + if (basicSliBuilder_ == null) { + if (!(typeCase_ == 4)) { + type_ = com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } + basicSliBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli, + com.google.monitoring.v3.BasicSli.Builder, + com.google.monitoring.v3.BasicSliOrBuilder>( + (com.google.monitoring.v3.BasicSli) type_, getParentForChildren(), isClean()); + type_ = null; + } + typeCase_ = 4; + onChanged(); + ; + return basicSliBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.RequestBasedSli, + com.google.monitoring.v3.RequestBasedSli.Builder, + com.google.monitoring.v3.RequestBasedSliOrBuilder> + requestBasedBuilder_; + /** + * + * + *
+     * Request-based SLIs
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + public boolean hasRequestBased() { + return typeCase_ == 1; + } + /** + * + * + *
+     * Request-based SLIs
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + public com.google.monitoring.v3.RequestBasedSli getRequestBased() { + if (requestBasedBuilder_ == null) { + if (typeCase_ == 1) { + return (com.google.monitoring.v3.RequestBasedSli) type_; + } + return com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } else { + if (typeCase_ == 1) { + return requestBasedBuilder_.getMessage(); + } + return com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } + } + /** + * + * + *
+     * Request-based SLIs
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + public Builder setRequestBased(com.google.monitoring.v3.RequestBasedSli value) { + if (requestBasedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + requestBasedBuilder_.setMessage(value); + } + typeCase_ = 1; + return this; + } + /** + * + * + *
+     * Request-based SLIs
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + public Builder setRequestBased( + com.google.monitoring.v3.RequestBasedSli.Builder builderForValue) { + if (requestBasedBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + requestBasedBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 1; + return this; + } + /** + * + * + *
+     * Request-based SLIs
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + public Builder mergeRequestBased(com.google.monitoring.v3.RequestBasedSli value) { + if (requestBasedBuilder_ == null) { + if (typeCase_ == 1 + && type_ != com.google.monitoring.v3.RequestBasedSli.getDefaultInstance()) { + type_ = + com.google.monitoring.v3.RequestBasedSli.newBuilder( + (com.google.monitoring.v3.RequestBasedSli) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 1) { + requestBasedBuilder_.mergeFrom(value); + } + requestBasedBuilder_.setMessage(value); + } + typeCase_ = 1; + return this; + } + /** + * + * + *
+     * Request-based SLIs
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + public Builder clearRequestBased() { + if (requestBasedBuilder_ == null) { + if (typeCase_ == 1) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 1) { + typeCase_ = 0; + type_ = null; + } + requestBasedBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Request-based SLIs
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + public com.google.monitoring.v3.RequestBasedSli.Builder getRequestBasedBuilder() { + return getRequestBasedFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Request-based SLIs
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + public com.google.monitoring.v3.RequestBasedSliOrBuilder getRequestBasedOrBuilder() { + if ((typeCase_ == 1) && (requestBasedBuilder_ != null)) { + return requestBasedBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 1) { + return (com.google.monitoring.v3.RequestBasedSli) type_; + } + return com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } + } + /** + * + * + *
+     * Request-based SLIs
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.RequestBasedSli, + com.google.monitoring.v3.RequestBasedSli.Builder, + com.google.monitoring.v3.RequestBasedSliOrBuilder> + getRequestBasedFieldBuilder() { + if (requestBasedBuilder_ == null) { + if (!(typeCase_ == 1)) { + type_ = com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } + requestBasedBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.RequestBasedSli, + com.google.monitoring.v3.RequestBasedSli.Builder, + com.google.monitoring.v3.RequestBasedSliOrBuilder>( + (com.google.monitoring.v3.RequestBasedSli) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 1; + onChanged(); + ; + return requestBasedBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli, + com.google.monitoring.v3.WindowsBasedSli.Builder, + com.google.monitoring.v3.WindowsBasedSliOrBuilder> + windowsBasedBuilder_; + /** + * + * + *
+     * Windows-based SLIs
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + public boolean hasWindowsBased() { + return typeCase_ == 2; + } + /** + * + * + *
+     * Windows-based SLIs
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + public com.google.monitoring.v3.WindowsBasedSli getWindowsBased() { + if (windowsBasedBuilder_ == null) { + if (typeCase_ == 2) { + return (com.google.monitoring.v3.WindowsBasedSli) type_; + } + return com.google.monitoring.v3.WindowsBasedSli.getDefaultInstance(); + } else { + if (typeCase_ == 2) { + return windowsBasedBuilder_.getMessage(); + } + return com.google.monitoring.v3.WindowsBasedSli.getDefaultInstance(); + } + } + /** + * + * + *
+     * Windows-based SLIs
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + public Builder setWindowsBased(com.google.monitoring.v3.WindowsBasedSli value) { + if (windowsBasedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + windowsBasedBuilder_.setMessage(value); + } + typeCase_ = 2; + return this; + } + /** + * + * + *
+     * Windows-based SLIs
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + public Builder setWindowsBased( + com.google.monitoring.v3.WindowsBasedSli.Builder builderForValue) { + if (windowsBasedBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + windowsBasedBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 2; + return this; + } + /** + * + * + *
+     * Windows-based SLIs
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + public Builder mergeWindowsBased(com.google.monitoring.v3.WindowsBasedSli value) { + if (windowsBasedBuilder_ == null) { + if (typeCase_ == 2 + && type_ != com.google.monitoring.v3.WindowsBasedSli.getDefaultInstance()) { + type_ = + com.google.monitoring.v3.WindowsBasedSli.newBuilder( + (com.google.monitoring.v3.WindowsBasedSli) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 2) { + windowsBasedBuilder_.mergeFrom(value); + } + windowsBasedBuilder_.setMessage(value); + } + typeCase_ = 2; + return this; + } + /** + * + * + *
+     * Windows-based SLIs
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + public Builder clearWindowsBased() { + if (windowsBasedBuilder_ == null) { + if (typeCase_ == 2) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 2) { + typeCase_ = 0; + type_ = null; + } + windowsBasedBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Windows-based SLIs
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + public com.google.monitoring.v3.WindowsBasedSli.Builder getWindowsBasedBuilder() { + return getWindowsBasedFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Windows-based SLIs
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + public com.google.monitoring.v3.WindowsBasedSliOrBuilder getWindowsBasedOrBuilder() { + if ((typeCase_ == 2) && (windowsBasedBuilder_ != null)) { + return windowsBasedBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 2) { + return (com.google.monitoring.v3.WindowsBasedSli) type_; + } + return com.google.monitoring.v3.WindowsBasedSli.getDefaultInstance(); + } + } + /** + * + * + *
+     * Windows-based SLIs
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli, + com.google.monitoring.v3.WindowsBasedSli.Builder, + com.google.monitoring.v3.WindowsBasedSliOrBuilder> + getWindowsBasedFieldBuilder() { + if (windowsBasedBuilder_ == null) { + if (!(typeCase_ == 2)) { + type_ = com.google.monitoring.v3.WindowsBasedSli.getDefaultInstance(); + } + windowsBasedBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli, + com.google.monitoring.v3.WindowsBasedSli.Builder, + com.google.monitoring.v3.WindowsBasedSliOrBuilder>( + (com.google.monitoring.v3.WindowsBasedSli) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 2; + onChanged(); + ; + return windowsBasedBuilder_; + } + + @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.ServiceLevelIndicator) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.ServiceLevelIndicator) + private static final com.google.monitoring.v3.ServiceLevelIndicator DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.ServiceLevelIndicator(); + } + + public static com.google.monitoring.v3.ServiceLevelIndicator getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceLevelIndicator parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceLevelIndicator(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.ServiceLevelIndicator getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelIndicatorOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelIndicatorOrBuilder.java new file mode 100644 index 00000000..3e00bee1 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelIndicatorOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +public interface ServiceLevelIndicatorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.ServiceLevelIndicator) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Basic SLI on a well-known service type.
+   * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + boolean hasBasicSli(); + /** + * + * + *
+   * Basic SLI on a well-known service type.
+   * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + com.google.monitoring.v3.BasicSli getBasicSli(); + /** + * + * + *
+   * Basic SLI on a well-known service type.
+   * 
+ * + * .google.monitoring.v3.BasicSli basic_sli = 4; + */ + com.google.monitoring.v3.BasicSliOrBuilder getBasicSliOrBuilder(); + + /** + * + * + *
+   * Request-based SLIs
+   * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + boolean hasRequestBased(); + /** + * + * + *
+   * Request-based SLIs
+   * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + com.google.monitoring.v3.RequestBasedSli getRequestBased(); + /** + * + * + *
+   * Request-based SLIs
+   * 
+ * + * .google.monitoring.v3.RequestBasedSli request_based = 1; + */ + com.google.monitoring.v3.RequestBasedSliOrBuilder getRequestBasedOrBuilder(); + + /** + * + * + *
+   * Windows-based SLIs
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + boolean hasWindowsBased(); + /** + * + * + *
+   * Windows-based SLIs
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + com.google.monitoring.v3.WindowsBasedSli getWindowsBased(); + /** + * + * + *
+   * Windows-based SLIs
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli windows_based = 2; + */ + com.google.monitoring.v3.WindowsBasedSliOrBuilder getWindowsBasedOrBuilder(); + + public com.google.monitoring.v3.ServiceLevelIndicator.TypeCase getTypeCase(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjective.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjective.java new file mode 100644 index 00000000..c94d8102 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjective.java @@ -0,0 +1,1863 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * A Service-Level Objective (SLO) describes a level of desired good service. It
+ * consists of a service-level indicator (SLI), a performance goal, and a period
+ * over which the objective is to be evaluated against that goal. The SLO can
+ * use SLIs defined in a number of different manners. Typical SLOs might include
+ * "99% of requests in each rolling week have latency below 200 milliseconds" or
+ * "99.5% of requests in each calendar month return successfully."
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.ServiceLevelObjective} + */ +public final class ServiceLevelObjective extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.ServiceLevelObjective) + ServiceLevelObjectiveOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceLevelObjective.newBuilder() to construct. + private ServiceLevelObjective(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServiceLevelObjective() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServiceLevelObjective( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + name_ = s; + break; + } + case 26: + { + com.google.monitoring.v3.ServiceLevelIndicator.Builder subBuilder = null; + if (serviceLevelIndicator_ != null) { + subBuilder = serviceLevelIndicator_.toBuilder(); + } + serviceLevelIndicator_ = + input.readMessage( + com.google.monitoring.v3.ServiceLevelIndicator.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceLevelIndicator_); + serviceLevelIndicator_ = subBuilder.buildPartial(); + } + + break; + } + case 33: + { + goal_ = input.readDouble(); + break; + } + case 42: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (periodCase_ == 5) { + subBuilder = ((com.google.protobuf.Duration) period_).toBuilder(); + } + period_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Duration) period_); + period_ = subBuilder.buildPartial(); + } + periodCase_ = 5; + break; + } + case 48: + { + int rawValue = input.readEnum(); + periodCase_ = 6; + period_ = rawValue; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = 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_ServiceLevelObjective_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_ServiceLevelObjective_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ServiceLevelObjective.class, + com.google.monitoring.v3.ServiceLevelObjective.Builder.class); + } + + /** + * + * + *
+   * `ServiceLevelObjective.View` determines what form of
+   * `ServiceLevelObjective` is returned from `GetServiceLevelObjective`,
+   * `ListServiceLevelObjectives`, and `ListServiceLevelObjectiveVersions` RPCs.
+   * 
+ * + * Protobuf enum {@code google.monitoring.v3.ServiceLevelObjective.View} + */ + public enum View implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Same as FULL.
+     * 
+ * + * VIEW_UNSPECIFIED = 0; + */ + VIEW_UNSPECIFIED(0), + /** + * + * + *
+     * Return the embedded `ServiceLevelIndicator` in the form in which it was
+     * defined. If it was defined using a `BasicSli`, return that `BasicSli`.
+     * 
+ * + * FULL = 2; + */ + FULL(2), + /** + * + * + *
+     * For `ServiceLevelIndicator`s using `BasicSli` articulation, instead
+     * return the `ServiceLevelIndicator` with its mode of computation fully
+     * spelled out as a `RequestBasedSli`. For `ServiceLevelIndicator`s using
+     * `RequestBasedSli` or `WindowsBasedSli`, return the
+     * `ServiceLevelIndicator` as it was provided.
+     * 
+ * + * EXPLICIT = 1; + */ + EXPLICIT(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Same as FULL.
+     * 
+ * + * VIEW_UNSPECIFIED = 0; + */ + public static final int VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Return the embedded `ServiceLevelIndicator` in the form in which it was
+     * defined. If it was defined using a `BasicSli`, return that `BasicSli`.
+     * 
+ * + * FULL = 2; + */ + public static final int FULL_VALUE = 2; + /** + * + * + *
+     * For `ServiceLevelIndicator`s using `BasicSli` articulation, instead
+     * return the `ServiceLevelIndicator` with its mode of computation fully
+     * spelled out as a `RequestBasedSli`. For `ServiceLevelIndicator`s using
+     * `RequestBasedSli` or `WindowsBasedSli`, return the
+     * `ServiceLevelIndicator` as it was provided.
+     * 
+ * + * EXPLICIT = 1; + */ + public static final int EXPLICIT_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static View valueOf(int value) { + return forNumber(value); + } + + public static View forNumber(int value) { + switch (value) { + case 0: + return VIEW_UNSPECIFIED; + case 2: + return FULL; + case 1: + return EXPLICIT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public View findValueByNumber(int number) { + return View.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.v3.ServiceLevelObjective.getDescriptor().getEnumTypes().get(0); + } + + private static final View[] VALUES = values(); + + public static View valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private View(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.v3.ServiceLevelObjective.View) + } + + private int periodCase_ = 0; + private java.lang.Object period_; + + public enum PeriodCase implements com.google.protobuf.Internal.EnumLite { + ROLLING_PERIOD(5), + CALENDAR_PERIOD(6), + PERIOD_NOT_SET(0); + private final int value; + + private PeriodCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static PeriodCase valueOf(int value) { + return forNumber(value); + } + + public static PeriodCase forNumber(int value) { + switch (value) { + case 5: + return ROLLING_PERIOD; + case 6: + return CALENDAR_PERIOD; + case 0: + return PERIOD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PeriodCase getPeriodCase() { + return PeriodCase.forNumber(periodCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name for this `ServiceLevelObjective`.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name for this `ServiceLevelObjective`.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 11; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Name used for UI elements listing this SLO.
+   * 
+ * + * string display_name = 11; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Name used for UI elements listing this SLO.
+   * 
+ * + * string display_name = 11; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_LEVEL_INDICATOR_FIELD_NUMBER = 3; + private com.google.monitoring.v3.ServiceLevelIndicator serviceLevelIndicator_; + /** + * + * + *
+   * The definition of good service, used to measure and calculate the quality
+   * of the `Service`'s performance with respect to a single aspect of service
+   * quality.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + public boolean hasServiceLevelIndicator() { + return serviceLevelIndicator_ != null; + } + /** + * + * + *
+   * The definition of good service, used to measure and calculate the quality
+   * of the `Service`'s performance with respect to a single aspect of service
+   * quality.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + public com.google.monitoring.v3.ServiceLevelIndicator getServiceLevelIndicator() { + return serviceLevelIndicator_ == null + ? com.google.monitoring.v3.ServiceLevelIndicator.getDefaultInstance() + : serviceLevelIndicator_; + } + /** + * + * + *
+   * The definition of good service, used to measure and calculate the quality
+   * of the `Service`'s performance with respect to a single aspect of service
+   * quality.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + public com.google.monitoring.v3.ServiceLevelIndicatorOrBuilder + getServiceLevelIndicatorOrBuilder() { + return getServiceLevelIndicator(); + } + + public static final int GOAL_FIELD_NUMBER = 4; + private double goal_; + /** + * + * + *
+   * The fraction of service that must be good in order for this objective to be
+   * met. `0 < goal <= 1`.
+   * 
+ * + * double goal = 4; + */ + public double getGoal() { + return goal_; + } + + public static final int ROLLING_PERIOD_FIELD_NUMBER = 5; + /** + * + * + *
+   * A rolling time period, semantically "in the past `<rolling_period>`".
+   * Must be an integer multiple of 1 day no larger than 30 days.
+   * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + public boolean hasRollingPeriod() { + return periodCase_ == 5; + } + /** + * + * + *
+   * A rolling time period, semantically "in the past `<rolling_period>`".
+   * Must be an integer multiple of 1 day no larger than 30 days.
+   * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + public com.google.protobuf.Duration getRollingPeriod() { + if (periodCase_ == 5) { + return (com.google.protobuf.Duration) period_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + /** + * + * + *
+   * A rolling time period, semantically "in the past `<rolling_period>`".
+   * Must be an integer multiple of 1 day no larger than 30 days.
+   * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + public com.google.protobuf.DurationOrBuilder getRollingPeriodOrBuilder() { + if (periodCase_ == 5) { + return (com.google.protobuf.Duration) period_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int CALENDAR_PERIOD_FIELD_NUMBER = 6; + /** + * + * + *
+   * A calendar period, semantically "since the start of the current
+   * `<calendar_period>`". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and
+   * `MONTH` are supported.
+   * 
+ * + * .google.type.CalendarPeriod calendar_period = 6; + */ + public int getCalendarPeriodValue() { + if (periodCase_ == 6) { + return (java.lang.Integer) period_; + } + return 0; + } + /** + * + * + *
+   * A calendar period, semantically "since the start of the current
+   * `<calendar_period>`". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and
+   * `MONTH` are supported.
+   * 
+ * + * .google.type.CalendarPeriod calendar_period = 6; + */ + public com.google.type.CalendarPeriod getCalendarPeriod() { + if (periodCase_ == 6) { + @SuppressWarnings("deprecation") + com.google.type.CalendarPeriod result = + com.google.type.CalendarPeriod.valueOf((java.lang.Integer) period_); + return result == null ? com.google.type.CalendarPeriod.UNRECOGNIZED : result; + } + return com.google.type.CalendarPeriod.CALENDAR_PERIOD_UNSPECIFIED; + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (serviceLevelIndicator_ != null) { + output.writeMessage(3, getServiceLevelIndicator()); + } + if (goal_ != 0D) { + output.writeDouble(4, goal_); + } + if (periodCase_ == 5) { + output.writeMessage(5, (com.google.protobuf.Duration) period_); + } + if (periodCase_ == 6) { + output.writeEnum(6, ((java.lang.Integer) period_)); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, displayName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (serviceLevelIndicator_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getServiceLevelIndicator()); + } + if (goal_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(4, goal_); + } + if (periodCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.protobuf.Duration) period_); + } + if (periodCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize(6, ((java.lang.Integer) period_)); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, displayName_); + } + 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.ServiceLevelObjective)) { + return super.equals(obj); + } + com.google.monitoring.v3.ServiceLevelObjective other = + (com.google.monitoring.v3.ServiceLevelObjective) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasServiceLevelIndicator() != other.hasServiceLevelIndicator()) return false; + if (hasServiceLevelIndicator()) { + if (!getServiceLevelIndicator().equals(other.getServiceLevelIndicator())) return false; + } + if (java.lang.Double.doubleToLongBits(getGoal()) + != java.lang.Double.doubleToLongBits(other.getGoal())) return false; + if (!getPeriodCase().equals(other.getPeriodCase())) return false; + switch (periodCase_) { + case 5: + if (!getRollingPeriod().equals(other.getRollingPeriod())) return false; + break; + case 6: + if (getCalendarPeriodValue() != other.getCalendarPeriodValue()) return false; + break; + case 0: + default: + } + 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (hasServiceLevelIndicator()) { + hash = (37 * hash) + SERVICE_LEVEL_INDICATOR_FIELD_NUMBER; + hash = (53 * hash) + getServiceLevelIndicator().hashCode(); + } + hash = (37 * hash) + GOAL_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getGoal())); + switch (periodCase_) { + case 5: + hash = (37 * hash) + ROLLING_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getRollingPeriod().hashCode(); + break; + case 6: + hash = (37 * hash) + CALENDAR_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getCalendarPeriodValue(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.ServiceLevelObjective parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ServiceLevelObjective 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.ServiceLevelObjective parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ServiceLevelObjective 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.ServiceLevelObjective parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.ServiceLevelObjective parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.ServiceLevelObjective parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ServiceLevelObjective 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.ServiceLevelObjective parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ServiceLevelObjective 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.ServiceLevelObjective parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.ServiceLevelObjective 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.ServiceLevelObjective 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 Service-Level Objective (SLO) describes a level of desired good service. It
+   * consists of a service-level indicator (SLI), a performance goal, and a period
+   * over which the objective is to be evaluated against that goal. The SLO can
+   * use SLIs defined in a number of different manners. Typical SLOs might include
+   * "99% of requests in each rolling week have latency below 200 milliseconds" or
+   * "99.5% of requests in each calendar month return successfully."
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.ServiceLevelObjective} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.ServiceLevelObjective) + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_ServiceLevelObjective_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_ServiceLevelObjective_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.ServiceLevelObjective.class, + com.google.monitoring.v3.ServiceLevelObjective.Builder.class); + } + + // Construct using com.google.monitoring.v3.ServiceLevelObjective.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(); + name_ = ""; + + displayName_ = ""; + + if (serviceLevelIndicatorBuilder_ == null) { + serviceLevelIndicator_ = null; + } else { + serviceLevelIndicator_ = null; + serviceLevelIndicatorBuilder_ = null; + } + goal_ = 0D; + + periodCase_ = 0; + period_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_ServiceLevelObjective_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.ServiceLevelObjective getDefaultInstanceForType() { + return com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.ServiceLevelObjective build() { + com.google.monitoring.v3.ServiceLevelObjective result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.ServiceLevelObjective buildPartial() { + com.google.monitoring.v3.ServiceLevelObjective result = + new com.google.monitoring.v3.ServiceLevelObjective(this); + result.name_ = name_; + result.displayName_ = displayName_; + if (serviceLevelIndicatorBuilder_ == null) { + result.serviceLevelIndicator_ = serviceLevelIndicator_; + } else { + result.serviceLevelIndicator_ = serviceLevelIndicatorBuilder_.build(); + } + result.goal_ = goal_; + if (periodCase_ == 5) { + if (rollingPeriodBuilder_ == null) { + result.period_ = period_; + } else { + result.period_ = rollingPeriodBuilder_.build(); + } + } + if (periodCase_ == 6) { + result.period_ = period_; + } + result.periodCase_ = periodCase_; + 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.ServiceLevelObjective) { + return mergeFrom((com.google.monitoring.v3.ServiceLevelObjective) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.ServiceLevelObjective other) { + if (other == com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.hasServiceLevelIndicator()) { + mergeServiceLevelIndicator(other.getServiceLevelIndicator()); + } + if (other.getGoal() != 0D) { + setGoal(other.getGoal()); + } + switch (other.getPeriodCase()) { + case ROLLING_PERIOD: + { + mergeRollingPeriod(other.getRollingPeriod()); + break; + } + case CALENDAR_PERIOD: + { + setCalendarPeriodValue(other.getCalendarPeriodValue()); + break; + } + case PERIOD_NOT_SET: + { + break; + } + } + 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.ServiceLevelObjective parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.ServiceLevelObjective) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int periodCase_ = 0; + private java.lang.Object period_; + + public PeriodCase getPeriodCase() { + return PeriodCase.forNumber(periodCase_); + } + + public Builder clearPeriod() { + periodCase_ = 0; + period_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name for this `ServiceLevelObjective`.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name for this `ServiceLevelObjective`.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name for this `ServiceLevelObjective`.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for this `ServiceLevelObjective`.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for this `ServiceLevelObjective`.
+     * Of the form
+     * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Name used for UI elements listing this SLO.
+     * 
+ * + * string display_name = 11; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name used for UI elements listing this SLO.
+     * 
+ * + * string display_name = 11; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name used for UI elements listing this SLO.
+     * 
+ * + * string display_name = 11; + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name used for UI elements listing this SLO.
+     * 
+ * + * string display_name = 11; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name used for UI elements listing this SLO.
+     * 
+ * + * string display_name = 11; + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private com.google.monitoring.v3.ServiceLevelIndicator serviceLevelIndicator_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelIndicator, + com.google.monitoring.v3.ServiceLevelIndicator.Builder, + com.google.monitoring.v3.ServiceLevelIndicatorOrBuilder> + serviceLevelIndicatorBuilder_; + /** + * + * + *
+     * The definition of good service, used to measure and calculate the quality
+     * of the `Service`'s performance with respect to a single aspect of service
+     * quality.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + public boolean hasServiceLevelIndicator() { + return serviceLevelIndicatorBuilder_ != null || serviceLevelIndicator_ != null; + } + /** + * + * + *
+     * The definition of good service, used to measure and calculate the quality
+     * of the `Service`'s performance with respect to a single aspect of service
+     * quality.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + public com.google.monitoring.v3.ServiceLevelIndicator getServiceLevelIndicator() { + if (serviceLevelIndicatorBuilder_ == null) { + return serviceLevelIndicator_ == null + ? com.google.monitoring.v3.ServiceLevelIndicator.getDefaultInstance() + : serviceLevelIndicator_; + } else { + return serviceLevelIndicatorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The definition of good service, used to measure and calculate the quality
+     * of the `Service`'s performance with respect to a single aspect of service
+     * quality.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + public Builder setServiceLevelIndicator(com.google.monitoring.v3.ServiceLevelIndicator value) { + if (serviceLevelIndicatorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceLevelIndicator_ = value; + onChanged(); + } else { + serviceLevelIndicatorBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The definition of good service, used to measure and calculate the quality
+     * of the `Service`'s performance with respect to a single aspect of service
+     * quality.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + public Builder setServiceLevelIndicator( + com.google.monitoring.v3.ServiceLevelIndicator.Builder builderForValue) { + if (serviceLevelIndicatorBuilder_ == null) { + serviceLevelIndicator_ = builderForValue.build(); + onChanged(); + } else { + serviceLevelIndicatorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The definition of good service, used to measure and calculate the quality
+     * of the `Service`'s performance with respect to a single aspect of service
+     * quality.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + public Builder mergeServiceLevelIndicator( + com.google.monitoring.v3.ServiceLevelIndicator value) { + if (serviceLevelIndicatorBuilder_ == null) { + if (serviceLevelIndicator_ != null) { + serviceLevelIndicator_ = + com.google.monitoring.v3.ServiceLevelIndicator.newBuilder(serviceLevelIndicator_) + .mergeFrom(value) + .buildPartial(); + } else { + serviceLevelIndicator_ = value; + } + onChanged(); + } else { + serviceLevelIndicatorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The definition of good service, used to measure and calculate the quality
+     * of the `Service`'s performance with respect to a single aspect of service
+     * quality.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + public Builder clearServiceLevelIndicator() { + if (serviceLevelIndicatorBuilder_ == null) { + serviceLevelIndicator_ = null; + onChanged(); + } else { + serviceLevelIndicator_ = null; + serviceLevelIndicatorBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The definition of good service, used to measure and calculate the quality
+     * of the `Service`'s performance with respect to a single aspect of service
+     * quality.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + public com.google.monitoring.v3.ServiceLevelIndicator.Builder + getServiceLevelIndicatorBuilder() { + + onChanged(); + return getServiceLevelIndicatorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The definition of good service, used to measure and calculate the quality
+     * of the `Service`'s performance with respect to a single aspect of service
+     * quality.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + public com.google.monitoring.v3.ServiceLevelIndicatorOrBuilder + getServiceLevelIndicatorOrBuilder() { + if (serviceLevelIndicatorBuilder_ != null) { + return serviceLevelIndicatorBuilder_.getMessageOrBuilder(); + } else { + return serviceLevelIndicator_ == null + ? com.google.monitoring.v3.ServiceLevelIndicator.getDefaultInstance() + : serviceLevelIndicator_; + } + } + /** + * + * + *
+     * The definition of good service, used to measure and calculate the quality
+     * of the `Service`'s performance with respect to a single aspect of service
+     * quality.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelIndicator, + com.google.monitoring.v3.ServiceLevelIndicator.Builder, + com.google.monitoring.v3.ServiceLevelIndicatorOrBuilder> + getServiceLevelIndicatorFieldBuilder() { + if (serviceLevelIndicatorBuilder_ == null) { + serviceLevelIndicatorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelIndicator, + com.google.monitoring.v3.ServiceLevelIndicator.Builder, + com.google.monitoring.v3.ServiceLevelIndicatorOrBuilder>( + getServiceLevelIndicator(), getParentForChildren(), isClean()); + serviceLevelIndicator_ = null; + } + return serviceLevelIndicatorBuilder_; + } + + private double goal_; + /** + * + * + *
+     * The fraction of service that must be good in order for this objective to be
+     * met. `0 < goal <= 1`.
+     * 
+ * + * double goal = 4; + */ + public double getGoal() { + return goal_; + } + /** + * + * + *
+     * The fraction of service that must be good in order for this objective to be
+     * met. `0 < goal <= 1`.
+     * 
+ * + * double goal = 4; + */ + public Builder setGoal(double value) { + + goal_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The fraction of service that must be good in order for this objective to be
+     * met. `0 < goal <= 1`.
+     * 
+ * + * double goal = 4; + */ + public Builder clearGoal() { + + goal_ = 0D; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + rollingPeriodBuilder_; + /** + * + * + *
+     * A rolling time period, semantically "in the past `<rolling_period>`".
+     * Must be an integer multiple of 1 day no larger than 30 days.
+     * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + public boolean hasRollingPeriod() { + return periodCase_ == 5; + } + /** + * + * + *
+     * A rolling time period, semantically "in the past `<rolling_period>`".
+     * Must be an integer multiple of 1 day no larger than 30 days.
+     * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + public com.google.protobuf.Duration getRollingPeriod() { + if (rollingPeriodBuilder_ == null) { + if (periodCase_ == 5) { + return (com.google.protobuf.Duration) period_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (periodCase_ == 5) { + return rollingPeriodBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * A rolling time period, semantically "in the past `<rolling_period>`".
+     * Must be an integer multiple of 1 day no larger than 30 days.
+     * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + public Builder setRollingPeriod(com.google.protobuf.Duration value) { + if (rollingPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + period_ = value; + onChanged(); + } else { + rollingPeriodBuilder_.setMessage(value); + } + periodCase_ = 5; + return this; + } + /** + * + * + *
+     * A rolling time period, semantically "in the past `<rolling_period>`".
+     * Must be an integer multiple of 1 day no larger than 30 days.
+     * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + public Builder setRollingPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (rollingPeriodBuilder_ == null) { + period_ = builderForValue.build(); + onChanged(); + } else { + rollingPeriodBuilder_.setMessage(builderForValue.build()); + } + periodCase_ = 5; + return this; + } + /** + * + * + *
+     * A rolling time period, semantically "in the past `<rolling_period>`".
+     * Must be an integer multiple of 1 day no larger than 30 days.
+     * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + public Builder mergeRollingPeriod(com.google.protobuf.Duration value) { + if (rollingPeriodBuilder_ == null) { + if (periodCase_ == 5 && period_ != com.google.protobuf.Duration.getDefaultInstance()) { + period_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) period_) + .mergeFrom(value) + .buildPartial(); + } else { + period_ = value; + } + onChanged(); + } else { + if (periodCase_ == 5) { + rollingPeriodBuilder_.mergeFrom(value); + } + rollingPeriodBuilder_.setMessage(value); + } + periodCase_ = 5; + return this; + } + /** + * + * + *
+     * A rolling time period, semantically "in the past `<rolling_period>`".
+     * Must be an integer multiple of 1 day no larger than 30 days.
+     * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + public Builder clearRollingPeriod() { + if (rollingPeriodBuilder_ == null) { + if (periodCase_ == 5) { + periodCase_ = 0; + period_ = null; + onChanged(); + } + } else { + if (periodCase_ == 5) { + periodCase_ = 0; + period_ = null; + } + rollingPeriodBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A rolling time period, semantically "in the past `<rolling_period>`".
+     * Must be an integer multiple of 1 day no larger than 30 days.
+     * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + public com.google.protobuf.Duration.Builder getRollingPeriodBuilder() { + return getRollingPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A rolling time period, semantically "in the past `<rolling_period>`".
+     * Must be an integer multiple of 1 day no larger than 30 days.
+     * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + public com.google.protobuf.DurationOrBuilder getRollingPeriodOrBuilder() { + if ((periodCase_ == 5) && (rollingPeriodBuilder_ != null)) { + return rollingPeriodBuilder_.getMessageOrBuilder(); + } else { + if (periodCase_ == 5) { + return (com.google.protobuf.Duration) period_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * A rolling time period, semantically "in the past `<rolling_period>`".
+     * Must be an integer multiple of 1 day no larger than 30 days.
+     * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getRollingPeriodFieldBuilder() { + if (rollingPeriodBuilder_ == null) { + if (!(periodCase_ == 5)) { + period_ = com.google.protobuf.Duration.getDefaultInstance(); + } + rollingPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) period_, getParentForChildren(), isClean()); + period_ = null; + } + periodCase_ = 5; + onChanged(); + ; + return rollingPeriodBuilder_; + } + + /** + * + * + *
+     * A calendar period, semantically "since the start of the current
+     * `<calendar_period>`". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and
+     * `MONTH` are supported.
+     * 
+ * + * .google.type.CalendarPeriod calendar_period = 6; + */ + public int getCalendarPeriodValue() { + if (periodCase_ == 6) { + return ((java.lang.Integer) period_).intValue(); + } + return 0; + } + /** + * + * + *
+     * A calendar period, semantically "since the start of the current
+     * `<calendar_period>`". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and
+     * `MONTH` are supported.
+     * 
+ * + * .google.type.CalendarPeriod calendar_period = 6; + */ + public Builder setCalendarPeriodValue(int value) { + periodCase_ = 6; + period_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A calendar period, semantically "since the start of the current
+     * `<calendar_period>`". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and
+     * `MONTH` are supported.
+     * 
+ * + * .google.type.CalendarPeriod calendar_period = 6; + */ + public com.google.type.CalendarPeriod getCalendarPeriod() { + if (periodCase_ == 6) { + @SuppressWarnings("deprecation") + com.google.type.CalendarPeriod result = + com.google.type.CalendarPeriod.valueOf((java.lang.Integer) period_); + return result == null ? com.google.type.CalendarPeriod.UNRECOGNIZED : result; + } + return com.google.type.CalendarPeriod.CALENDAR_PERIOD_UNSPECIFIED; + } + /** + * + * + *
+     * A calendar period, semantically "since the start of the current
+     * `<calendar_period>`". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and
+     * `MONTH` are supported.
+     * 
+ * + * .google.type.CalendarPeriod calendar_period = 6; + */ + public Builder setCalendarPeriod(com.google.type.CalendarPeriod value) { + if (value == null) { + throw new NullPointerException(); + } + periodCase_ = 6; + period_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * A calendar period, semantically "since the start of the current
+     * `<calendar_period>`". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and
+     * `MONTH` are supported.
+     * 
+ * + * .google.type.CalendarPeriod calendar_period = 6; + */ + public Builder clearCalendarPeriod() { + if (periodCase_ == 6) { + periodCase_ = 0; + period_ = null; + 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.ServiceLevelObjective) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.ServiceLevelObjective) + private static final com.google.monitoring.v3.ServiceLevelObjective DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.ServiceLevelObjective(); + } + + public static com.google.monitoring.v3.ServiceLevelObjective getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceLevelObjective parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceLevelObjective(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.ServiceLevelObjective getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjectiveName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjectiveName.java new file mode 100644 index 00000000..6eb10636 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjectiveName.java @@ -0,0 +1,218 @@ +/* + * Copyright 2019 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.pathtemplate.PathTemplate; +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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ServiceLevelObjectiveName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String service; + private final String serviceLevelObjective; + + public String getProject() { + return project; + } + + public String getService() { + return service; + } + + public String getServiceLevelObjective() { + return serviceLevelObjective; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ServiceLevelObjectiveName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + service = Preconditions.checkNotNull(builder.getService()); + serviceLevelObjective = Preconditions.checkNotNull(builder.getServiceLevelObjective()); + } + + public static ServiceLevelObjectiveName of( + String project, String service, String serviceLevelObjective) { + return newBuilder() + .setProject(project) + .setService(service) + .setServiceLevelObjective(serviceLevelObjective) + .build(); + } + + public static String format(String project, String service, String serviceLevelObjective) { + return newBuilder() + .setProject(project) + .setService(service) + .setServiceLevelObjective(serviceLevelObjective) + .build() + .toString(); + } + + public static ServiceLevelObjectiveName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, + "ServiceLevelObjectiveName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), matchMap.get("service"), matchMap.get("service_level_objective")); + } + + 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 (ServiceLevelObjectiveName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("service", service); + fieldMapBuilder.put("serviceLevelObjective", serviceLevelObjective); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "service", service, "service_level_objective", serviceLevelObjective); + } + + /** Builder for ServiceLevelObjectiveName. */ + public static class Builder { + + private String project; + private String service; + private String serviceLevelObjective; + + public String getProject() { + return project; + } + + public String getService() { + return service; + } + + public String getServiceLevelObjective() { + return serviceLevelObjective; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + public Builder setServiceLevelObjective(String serviceLevelObjective) { + this.serviceLevelObjective = serviceLevelObjective; + return this; + } + + private Builder() {} + + private Builder(ServiceLevelObjectiveName serviceLevelObjectiveName) { + project = serviceLevelObjectiveName.project; + service = serviceLevelObjectiveName.service; + serviceLevelObjective = serviceLevelObjectiveName.serviceLevelObjective; + } + + public ServiceLevelObjectiveName build() { + return new ServiceLevelObjectiveName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ServiceLevelObjectiveName) { + ServiceLevelObjectiveName that = (ServiceLevelObjectiveName) o; + return (this.project.equals(that.project)) + && (this.service.equals(that.service)) + && (this.serviceLevelObjective.equals(that.serviceLevelObjective)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= service.hashCode(); + h *= 1000003; + h ^= serviceLevelObjective.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjectiveOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjectiveOrBuilder.java new file mode 100644 index 00000000..f7194db9 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjectiveOrBuilder.java @@ -0,0 +1,181 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +public interface ServiceLevelObjectiveOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.ServiceLevelObjective) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name for this `ServiceLevelObjective`.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name for this `ServiceLevelObjective`.
+   * Of the form
+   * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Name used for UI elements listing this SLO.
+   * 
+ * + * string display_name = 11; + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Name used for UI elements listing this SLO.
+   * 
+ * + * string display_name = 11; + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The definition of good service, used to measure and calculate the quality
+   * of the `Service`'s performance with respect to a single aspect of service
+   * quality.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + boolean hasServiceLevelIndicator(); + /** + * + * + *
+   * The definition of good service, used to measure and calculate the quality
+   * of the `Service`'s performance with respect to a single aspect of service
+   * quality.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + com.google.monitoring.v3.ServiceLevelIndicator getServiceLevelIndicator(); + /** + * + * + *
+   * The definition of good service, used to measure and calculate the quality
+   * of the `Service`'s performance with respect to a single aspect of service
+   * quality.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + com.google.monitoring.v3.ServiceLevelIndicatorOrBuilder getServiceLevelIndicatorOrBuilder(); + + /** + * + * + *
+   * The fraction of service that must be good in order for this objective to be
+   * met. `0 < goal <= 1`.
+   * 
+ * + * double goal = 4; + */ + double getGoal(); + + /** + * + * + *
+   * A rolling time period, semantically "in the past `<rolling_period>`".
+   * Must be an integer multiple of 1 day no larger than 30 days.
+   * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + boolean hasRollingPeriod(); + /** + * + * + *
+   * A rolling time period, semantically "in the past `<rolling_period>`".
+   * Must be an integer multiple of 1 day no larger than 30 days.
+   * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + com.google.protobuf.Duration getRollingPeriod(); + /** + * + * + *
+   * A rolling time period, semantically "in the past `<rolling_period>`".
+   * Must be an integer multiple of 1 day no larger than 30 days.
+   * 
+ * + * .google.protobuf.Duration rolling_period = 5; + */ + com.google.protobuf.DurationOrBuilder getRollingPeriodOrBuilder(); + + /** + * + * + *
+   * A calendar period, semantically "since the start of the current
+   * `<calendar_period>`". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and
+   * `MONTH` are supported.
+   * 
+ * + * .google.type.CalendarPeriod calendar_period = 6; + */ + int getCalendarPeriodValue(); + /** + * + * + *
+   * A calendar period, semantically "since the start of the current
+   * `<calendar_period>`". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and
+   * `MONTH` are supported.
+   * 
+ * + * .google.type.CalendarPeriod calendar_period = 6; + */ + com.google.type.CalendarPeriod getCalendarPeriod(); + + public com.google.monitoring.v3.ServiceLevelObjective.PeriodCase getPeriodCase(); +} 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 new file mode 100644 index 00000000..4d7c55b5 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringProto.java @@ -0,0 +1,366 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +public final class ServiceMonitoringProto { + private ServiceMonitoringProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_Service_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_Service_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_Service_Custom_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_Service_Custom_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_Service_AppEngine_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_Service_AppEngine_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_Service_CloudEndpoints_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_Service_CloudEndpoints_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_Service_ClusterIstio_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_Service_ClusterIstio_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_Service_Telemetry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_Service_Telemetry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_ServiceLevelObjective_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_ServiceLevelObjective_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_ServiceLevelIndicator_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_ServiceLevelIndicator_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_BasicSli_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_BasicSli_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_BasicSli_AvailabilityCriteria_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_BasicSli_AvailabilityCriteria_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_BasicSli_LatencyCriteria_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_BasicSli_LatencyCriteria_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_Range_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_Range_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_RequestBasedSli_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_RequestBasedSli_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_TimeSeriesRatio_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_TimeSeriesRatio_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_DistributionCut_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_DistributionCut_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_WindowsBasedSli_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_WindowsBasedSli_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_WindowsBasedSli_PerformanceThreshold_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_WindowsBasedSli_PerformanceThreshold_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_WindowsBasedSli_MetricRange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_WindowsBasedSli_MetricRange_fieldAccessorTable; + + 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/service.proto\022\024go" + + "ogle.monitoring.v3\032#google/api/monitored" + + "_resource.proto\032\036google/protobuf/duratio" + + "n.proto\032\037google/protobuf/timestamp.proto" + + "\032!google/type/calendar_period.proto\"\326\004\n\007" + + "Service\022\014\n\004name\030\001 \001(\t\022\024\n\014display_name\030\002 " + + "\001(\t\0226\n\006custom\030\006 \001(\0132$.google.monitoring." + + "v3.Service.CustomH\000\022=\n\napp_engine\030\007 \001(\0132" + + "\'.google.monitoring.v3.Service.AppEngine" + + "H\000\022G\n\017cloud_endpoints\030\010 \001(\0132,.google.mon" + + "itoring.v3.Service.CloudEndpointsH\000\022C\n\rc" + + "luster_istio\030\t \001(\0132*.google.monitoring.v" + + "3.Service.ClusterIstioH\000\022:\n\ttelemetry\030\r " + + "\001(\0132\'.google.monitoring.v3.Service.Telem" + + "etry\032\010\n\006Custom\032\036\n\tAppEngine\022\021\n\tmodule_id" + + "\030\001 \001(\t\032!\n\016CloudEndpoints\022\017\n\007service\030\001 \001(" + + "\t\032g\n\014ClusterIstio\022\020\n\010location\030\001 \001(\t\022\024\n\014c" + + "luster_name\030\002 \001(\t\022\031\n\021service_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(\tB\014\n\nidentifier\"\304\002\n" + + "\025ServiceLevelObjective\022\014\n\004name\030\001 \001(\t\022\024\n\014" + + "display_name\030\013 \001(\t\022L\n\027service_level_indi" + + "cator\030\003 \001(\0132+.google.monitoring.v3.Servi" + + "ceLevelIndicator\022\014\n\004goal\030\004 \001(\001\0223\n\016rollin" + + "g_period\030\005 \001(\0132\031.google.protobuf.Duratio" + + "nH\000\0226\n\017calendar_period\030\006 \001(\0162\033.google.ty" + + "pe.CalendarPeriodH\000\"4\n\004View\022\024\n\020VIEW_UNSP" + + "ECIFIED\020\000\022\010\n\004FULL\020\002\022\014\n\010EXPLICIT\020\001B\010\n\006per" + + "iod\"\324\001\n\025ServiceLevelIndicator\0223\n\tbasic_s" + + "li\030\004 \001(\0132\036.google.monitoring.v3.BasicSli" + + "H\000\022>\n\rrequest_based\030\001 \001(\0132%.google.monit" + + "oring.v3.RequestBasedSliH\000\022>\n\rwindows_ba" + + "sed\030\002 \001(\0132%.google.monitoring.v3.Windows" + + "BasedSliH\000B\006\n\004type\"\266\002\n\010BasicSli\022\016\n\006metho" + + "d\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.monito" + + "ring.v3.BasicSli.AvailabilityCriteriaH\000\022" + + "A\n\007latency\030\003 \001(\0132..google.monitoring.v3." + + "BasicSli.LatencyCriteriaH\000\032\026\n\024Availabili" + + "tyCriteria\032?\n\017LatencyCriteria\022,\n\tthresho" + + "ld\030\003 \001(\0132\031.google.protobuf.DurationB\016\n\014s" + + "li_criteria\"!\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.Time" + + "SeriesRatioH\000\022A\n\020distribution_cut\030\003 \001(\0132" + + "%.google.monitoring.v3.DistributionCutH\000" + + "B\010\n\006method\"h\n\017TimeSeriesRatio\022\033\n\023good_se" + + "rvice_filter\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\017" + + "DistributionCut\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_bad" + + "_metric_filter\030\005 \001(\tH\000\022`\n\032good_total_rat" + + "io_threshold\030\002 \001(\0132:.google.monitoring.v" + + "3.WindowsBasedSli.PerformanceThresholdH\000" + + "\022Q\n\024metric_mean_in_range\030\006 \001(\01321.google." + + "monitoring.v3.WindowsBasedSli.MetricRang" + + "eH\000\022P\n\023metric_sum_in_range\030\007 \001(\01321.googl" + + "e.monitoring.v3.WindowsBasedSli.MetricRa" + + "ngeH\000\0220\n\rwindow_period\030\004 \001(\0132\031.google.pr" + + "otobuf.Duration\032\260\001\n\024PerformanceThreshold" + + "\022<\n\013performance\030\001 \001(\0132%.google.monitorin" + + "g.v3.RequestBasedSliH\000\022?\n\025basic_sli_perf" + + "ormance\030\003 \001(\0132\036.google.monitoring.v3.Bas" + + "icSliH\000\022\021\n\tthreshold\030\002 \001(\001B\006\n\004type\032N\n\013Me" + + "tricRange\022\023\n\013time_series\030\001 \001(\t\022*\n\005range\030" + + "\004 \001(\0132\033.google.monitoring.v3.RangeB\022\n\020wi" + + "ndow_criterionB\256\001\n\030com.google.monitoring" + + ".v3B\026ServiceMonitoringProtoP\001Z>google.go" + + "lang.org/genproto/googleapis/monitoring/" + + "v3;monitoring\252\002\032Google.Cloud.Monitoring." + + "V3\312\002\032Google\\Cloud\\Monitoring\\V3b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.MonitoredResourceProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.CalendarPeriodProto.getDescriptor(), + }, + assigner); + internal_static_google_monitoring_v3_Service_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_v3_Service_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_Service_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Custom", + "AppEngine", + "CloudEndpoints", + "ClusterIstio", + "Telemetry", + "Identifier", + }); + internal_static_google_monitoring_v3_Service_Custom_descriptor = + internal_static_google_monitoring_v3_Service_descriptor.getNestedTypes().get(0); + internal_static_google_monitoring_v3_Service_Custom_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_Service_Custom_descriptor, + new java.lang.String[] {}); + internal_static_google_monitoring_v3_Service_AppEngine_descriptor = + internal_static_google_monitoring_v3_Service_descriptor.getNestedTypes().get(1); + internal_static_google_monitoring_v3_Service_AppEngine_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_Service_AppEngine_descriptor, + new java.lang.String[] { + "ModuleId", + }); + internal_static_google_monitoring_v3_Service_CloudEndpoints_descriptor = + internal_static_google_monitoring_v3_Service_descriptor.getNestedTypes().get(2); + internal_static_google_monitoring_v3_Service_CloudEndpoints_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_Service_CloudEndpoints_descriptor, + new java.lang.String[] { + "Service", + }); + internal_static_google_monitoring_v3_Service_ClusterIstio_descriptor = + internal_static_google_monitoring_v3_Service_descriptor.getNestedTypes().get(3); + internal_static_google_monitoring_v3_Service_ClusterIstio_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_Service_ClusterIstio_descriptor, + new java.lang.String[] { + "Location", "ClusterName", "ServiceNamespace", "ServiceName", + }); + internal_static_google_monitoring_v3_Service_Telemetry_descriptor = + internal_static_google_monitoring_v3_Service_descriptor.getNestedTypes().get(4); + internal_static_google_monitoring_v3_Service_Telemetry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_Service_Telemetry_descriptor, + new java.lang.String[] { + "ResourceName", + }); + internal_static_google_monitoring_v3_ServiceLevelObjective_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_monitoring_v3_ServiceLevelObjective_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_ServiceLevelObjective_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "ServiceLevelIndicator", + "Goal", + "RollingPeriod", + "CalendarPeriod", + "Period", + }); + internal_static_google_monitoring_v3_ServiceLevelIndicator_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_monitoring_v3_ServiceLevelIndicator_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_ServiceLevelIndicator_descriptor, + new java.lang.String[] { + "BasicSli", "RequestBased", "WindowsBased", "Type", + }); + internal_static_google_monitoring_v3_BasicSli_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_monitoring_v3_BasicSli_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_BasicSli_descriptor, + new java.lang.String[] { + "Method", "Location", "Version", "Availability", "Latency", "SliCriteria", + }); + internal_static_google_monitoring_v3_BasicSli_AvailabilityCriteria_descriptor = + internal_static_google_monitoring_v3_BasicSli_descriptor.getNestedTypes().get(0); + internal_static_google_monitoring_v3_BasicSli_AvailabilityCriteria_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_BasicSli_AvailabilityCriteria_descriptor, + new java.lang.String[] {}); + internal_static_google_monitoring_v3_BasicSli_LatencyCriteria_descriptor = + internal_static_google_monitoring_v3_BasicSli_descriptor.getNestedTypes().get(1); + internal_static_google_monitoring_v3_BasicSli_LatencyCriteria_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_BasicSli_LatencyCriteria_descriptor, + new java.lang.String[] { + "Threshold", + }); + internal_static_google_monitoring_v3_Range_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_monitoring_v3_Range_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_Range_descriptor, + new java.lang.String[] { + "Min", "Max", + }); + internal_static_google_monitoring_v3_RequestBasedSli_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_monitoring_v3_RequestBasedSli_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_RequestBasedSli_descriptor, + new java.lang.String[] { + "GoodTotalRatio", "DistributionCut", "Method", + }); + internal_static_google_monitoring_v3_TimeSeriesRatio_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_monitoring_v3_TimeSeriesRatio_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_TimeSeriesRatio_descriptor, + new java.lang.String[] { + "GoodServiceFilter", "BadServiceFilter", "TotalServiceFilter", + }); + internal_static_google_monitoring_v3_DistributionCut_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_monitoring_v3_DistributionCut_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_DistributionCut_descriptor, + new java.lang.String[] { + "DistributionFilter", "Range", + }); + internal_static_google_monitoring_v3_WindowsBasedSli_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_monitoring_v3_WindowsBasedSli_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_WindowsBasedSli_descriptor, + new java.lang.String[] { + "GoodBadMetricFilter", + "GoodTotalRatioThreshold", + "MetricMeanInRange", + "MetricSumInRange", + "WindowPeriod", + "WindowCriterion", + }); + internal_static_google_monitoring_v3_WindowsBasedSli_PerformanceThreshold_descriptor = + internal_static_google_monitoring_v3_WindowsBasedSli_descriptor.getNestedTypes().get(0); + internal_static_google_monitoring_v3_WindowsBasedSli_PerformanceThreshold_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_WindowsBasedSli_PerformanceThreshold_descriptor, + new java.lang.String[] { + "Performance", "BasicSliPerformance", "Threshold", "Type", + }); + internal_static_google_monitoring_v3_WindowsBasedSli_MetricRange_descriptor = + internal_static_google_monitoring_v3_WindowsBasedSli_descriptor.getNestedTypes().get(1); + internal_static_google_monitoring_v3_WindowsBasedSli_MetricRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_WindowsBasedSli_MetricRange_descriptor, + new java.lang.String[] { + "TimeSeries", "Range", + }); + com.google.api.MonitoredResourceProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.CalendarPeriodProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringServiceProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringServiceProto.java new file mode 100644 index 00000000..e6eec5d1 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceMonitoringServiceProto.java @@ -0,0 +1,311 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public final class ServiceMonitoringServiceProto { + private ServiceMonitoringServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_CreateServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_CreateServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_GetServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_GetServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_ListServicesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_ListServicesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_ListServicesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_ListServicesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_UpdateServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_UpdateServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_DeleteServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_DeleteServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_CreateServiceLevelObjectiveRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_CreateServiceLevelObjectiveRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_GetServiceLevelObjectiveRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_GetServiceLevelObjectiveRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_ListServiceLevelObjectivesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_ListServiceLevelObjectivesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_ListServiceLevelObjectivesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_ListServiceLevelObjectivesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_UpdateServiceLevelObjectiveRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_UpdateServiceLevelObjectiveRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_DeleteServiceLevelObjectiveRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_DeleteServiceLevelObjectiveRequest_fieldAccessorTable; + + 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/service_service.p" + + "roto\022\024google.monitoring.v3\032\034google/api/a" + + "nnotations.proto\032#google/api/monitored_r" + + "esource.proto\032\"google/monitoring/v3/serv" + + "ice.proto\032\033google/protobuf/empty.proto\032 " + + "google/protobuf/field_mask.proto\032\027google" + + "/api/client.proto\"j\n\024CreateServiceReques" + + "t\022\016\n\006parent\030\001 \001(\t\022\022\n\nservice_id\030\003 \001(\t\022.\n" + + "\007service\030\002 \001(\0132\035.google.monitoring.v3.Se" + + "rvice\"!\n\021GetServiceRequest\022\014\n\004name\030\001 \001(\t" + + "\"\\\n\023ListServicesRequest\022\016\n\006parent\030\001 \001(\t\022" + + "\016\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npa" + + "ge_token\030\004 \001(\t\"`\n\024ListServicesResponse\022/" + + "\n\010services\030\001 \003(\0132\035.google.monitoring.v3." + + "Service\022\027\n\017next_page_token\030\002 \001(\t\"w\n\024Upda" + + "teServiceRequest\022.\n\007service\030\001 \001(\0132\035.goog" + + "le.monitoring.v3.Service\022/\n\013update_mask\030" + + "\002 \001(\0132\032.google.protobuf.FieldMask\"$\n\024Del" + + "eteServiceRequest\022\014\n\004name\030\001 \001(\t\"\246\001\n\"Crea" + + "teServiceLevelObjectiveRequest\022\016\n\006parent" + + "\030\001 \001(\t\022\"\n\032service_level_objective_id\030\003 \001" + + "(\t\022L\n\027service_level_objective\030\002 \001(\0132+.go" + + "ogle.monitoring.v3.ServiceLevelObjective" + + "\"o\n\037GetServiceLevelObjectiveRequest\022\014\n\004n" + + "ame\030\001 \001(\t\022>\n\004view\030\002 \001(\01620.google.monitor" + + "ing.v3.ServiceLevelObjective.View\"\252\001\n!Li" + + "stServiceLevelObjectivesRequest\022\016\n\006paren" + + "t\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001" + + "(\005\022\022\n\npage_token\030\004 \001(\t\022>\n\004view\030\005 \001(\01620.g" + + "oogle.monitoring.v3.ServiceLevelObjectiv" + + "e.View\"\214\001\n\"ListServiceLevelObjectivesRes" + + "ponse\022M\n\030service_level_objectives\030\001 \003(\0132" + + "+.google.monitoring.v3.ServiceLevelObjec" + + "tive\022\027\n\017next_page_token\030\002 \001(\t\"\243\001\n\"Update" + + "ServiceLevelObjectiveRequest\022L\n\027service_" + + "level_objective\030\001 \001(\0132+.google.monitorin" + + "g.v3.ServiceLevelObjective\022/\n\013update_mas" + + "k\030\002 \001(\0132\032.google.protobuf.FieldMask\"2\n\"D" + + "eleteServiceLevelObjectiveRequest\022\014\n\004nam" + + "e\030\001 \001(\t2\345\016\n\030ServiceMonitoringService\022\206\001\n" + + "\rCreateService\022*.google.monitoring.v3.Cr" + + "eateServiceRequest\032\035.google.monitoring.v" + + "3.Service\"*\202\323\344\223\002$\"\031/v3/{parent=*/*}/serv" + + "ices:\007service\022w\n\nGetService\022\'.google.mon" + + "itoring.v3.GetServiceRequest\032\035.google.mo" + + "nitoring.v3.Service\"!\202\323\344\223\002\033\022\031/v3/{name=*" + + "/*/services/*}\022\210\001\n\014ListServices\022).google" + + ".monitoring.v3.ListServicesRequest\032*.goo" + + "gle.monitoring.v3.ListServicesResponse\"!" + + "\202\323\344\223\002\033\022\031/v3/{parent=*/*}/services\022\216\001\n\rUp" + + "dateService\022*.google.monitoring.v3.Updat" + + "eServiceRequest\032\035.google.monitoring.v3.S" + + "ervice\"2\202\323\344\223\002,2!/v3/{service.name=*/*/se" + + "rvices/*}:\007service\022v\n\rDeleteService\022*.go" + + "ogle.monitoring.v3.DeleteServiceRequest\032" + + "\026.google.protobuf.Empty\"!\202\323\344\223\002\033*\031/v3/{na" + + "me=*/*/services/*}\022\331\001\n\033CreateServiceLeve" + + "lObjective\0228.google.monitoring.v3.Create" + + "ServiceLevelObjectiveRequest\032+.google.mo" + + "nitoring.v3.ServiceLevelObjective\"S\202\323\344\223\002" + + "M\"2/v3/{parent=*/*/services/*}/serviceLe" + + "velObjectives:\027service_level_objective\022\272" + + "\001\n\030GetServiceLevelObjective\0225.google.mon" + + "itoring.v3.GetServiceLevelObjectiveReque" + + "st\032+.google.monitoring.v3.ServiceLevelOb" + + "jective\":\202\323\344\223\0024\0222/v3/{name=*/*/services/" + + "*/serviceLevelObjectives/*}\022\313\001\n\032ListServ" + + "iceLevelObjectives\0227.google.monitoring.v" + + "3.ListServiceLevelObjectivesRequest\0328.go" + + "ogle.monitoring.v3.ListServiceLevelObjec" + + "tivesResponse\":\202\323\344\223\0024\0222/v3/{parent=*/*/s" + + "ervices/*}/serviceLevelObjectives\022\361\001\n\033Up" + + "dateServiceLevelObjective\0228.google.monit" + + "oring.v3.UpdateServiceLevelObjectiveRequ" + + "est\032+.google.monitoring.v3.ServiceLevelO" + + "bjective\"k\202\323\344\223\002e2J/v3/{service_level_obj" + + "ective.name=*/*/services/*/serviceLevelO" + + "bjectives/*}:\027service_level_objective\022\253\001" + + "\n\033DeleteServiceLevelObjective\0228.google.m" + + "onitoring.v3.DeleteServiceLevelObjective" + + "Request\032\026.google.protobuf.Empty\":\202\323\344\223\0024*" + + "2/v3/{name=*/*/services/*/serviceLevelOb" + + "jectives/*}\032\251\001\312A\031monitoring.googleapis.c" + + "om\322A\211\001https://www.googleapis.com/auth/cl" + + "oud-platform,https://www.googleapis.com/" + + "auth/monitoring,https://www.googleapis.c" + + "om/auth/monitoring.readB\265\001\n\030com.google.m" + + "onitoring.v3B\035ServiceMonitoringServicePr" + + "otoP\001Z>google.golang.org/genproto/google" + + "apis/monitoring/v3;monitoring\252\002\032Google.C" + + "loud.Monitoring.V3\312\002\032Google\\Cloud\\Monito" + + "ring\\V3b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.MonitoredResourceProto.getDescriptor(), + com.google.monitoring.v3.ServiceMonitoringProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }, + assigner); + internal_static_google_monitoring_v3_CreateServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_v3_CreateServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_CreateServiceRequest_descriptor, + new java.lang.String[] { + "Parent", "ServiceId", "Service", + }); + internal_static_google_monitoring_v3_GetServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_monitoring_v3_GetServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_GetServiceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_monitoring_v3_ListServicesRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_monitoring_v3_ListServicesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_ListServicesRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_monitoring_v3_ListServicesResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_monitoring_v3_ListServicesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_ListServicesResponse_descriptor, + new java.lang.String[] { + "Services", "NextPageToken", + }); + internal_static_google_monitoring_v3_UpdateServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_monitoring_v3_UpdateServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_UpdateServiceRequest_descriptor, + new java.lang.String[] { + "Service", "UpdateMask", + }); + internal_static_google_monitoring_v3_DeleteServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_monitoring_v3_DeleteServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_DeleteServiceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_monitoring_v3_CreateServiceLevelObjectiveRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_monitoring_v3_CreateServiceLevelObjectiveRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_CreateServiceLevelObjectiveRequest_descriptor, + new java.lang.String[] { + "Parent", "ServiceLevelObjectiveId", "ServiceLevelObjective", + }); + internal_static_google_monitoring_v3_GetServiceLevelObjectiveRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_monitoring_v3_GetServiceLevelObjectiveRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_GetServiceLevelObjectiveRequest_descriptor, + new java.lang.String[] { + "Name", "View", + }); + internal_static_google_monitoring_v3_ListServiceLevelObjectivesRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_monitoring_v3_ListServiceLevelObjectivesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_ListServiceLevelObjectivesRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", "View", + }); + internal_static_google_monitoring_v3_ListServiceLevelObjectivesResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_monitoring_v3_ListServiceLevelObjectivesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_ListServiceLevelObjectivesResponse_descriptor, + new java.lang.String[] { + "ServiceLevelObjectives", "NextPageToken", + }); + internal_static_google_monitoring_v3_UpdateServiceLevelObjectiveRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_monitoring_v3_UpdateServiceLevelObjectiveRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_UpdateServiceLevelObjectiveRequest_descriptor, + new java.lang.String[] { + "ServiceLevelObjective", "UpdateMask", + }); + internal_static_google_monitoring_v3_DeleteServiceLevelObjectiveRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_monitoring_v3_DeleteServiceLevelObjectiveRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_DeleteServiceLevelObjectiveRequest_descriptor, + new java.lang.String[] { + "Name", + }); + 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.MonitoredResourceProto.getDescriptor(); + com.google.monitoring.v3.ServiceMonitoringProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.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/ServiceName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceName.java new file mode 100644 index 00000000..dcfc4a18 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceName.java @@ -0,0 +1,182 @@ +/* + * Copyright 2019 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.pathtemplate.PathTemplate; +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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ServiceName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/services/{service}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String service; + + public String getProject() { + return project; + } + + public String getService() { + return service; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ServiceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + service = Preconditions.checkNotNull(builder.getService()); + } + + public static ServiceName of(String project, String service) { + return newBuilder().setProject(project).setService(service).build(); + } + + public static String format(String project, String service) { + return newBuilder().setProject(project).setService(service).build().toString(); + } + + public static ServiceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ServiceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("service")); + } + + 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 (ServiceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("service", service); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "service", service); + } + + /** Builder for ServiceName. */ + public static class Builder { + + private String project; + private String service; + + public String getProject() { + return project; + } + + public String getService() { + return service; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + private Builder() {} + + private Builder(ServiceName serviceName) { + project = serviceName.project; + service = serviceName.service; + } + + public ServiceName build() { + return new ServiceName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ServiceName) { + ServiceName that = (ServiceName) o; + return (this.project.equals(that.project)) && (this.service.equals(that.service)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= service.hashCode(); + return h; + } +} 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 new file mode 100644 index 00000000..2f80c0bf --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceOrBuilder.java @@ -0,0 +1,226 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +public interface ServiceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.Service) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name for this Service. Of the form
+   * `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name for this Service. Of the form
+   * `projects/{project_id}/services/{service_id}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Name used for UI elements listing this Service.
+   * 
+ * + * string display_name = 2; + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Name used for UI elements listing this Service.
+   * 
+ * + * string display_name = 2; + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Custom service type.
+   * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + boolean hasCustom(); + /** + * + * + *
+   * Custom service type.
+   * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + com.google.monitoring.v3.Service.Custom getCustom(); + /** + * + * + *
+   * Custom service type.
+   * 
+ * + * .google.monitoring.v3.Service.Custom custom = 6; + */ + com.google.monitoring.v3.Service.CustomOrBuilder getCustomOrBuilder(); + + /** + * + * + *
+   * Type used for App Engine services.
+   * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + boolean hasAppEngine(); + /** + * + * + *
+   * Type used for App Engine services.
+   * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + com.google.monitoring.v3.Service.AppEngine getAppEngine(); + /** + * + * + *
+   * Type used for App Engine services.
+   * 
+ * + * .google.monitoring.v3.Service.AppEngine app_engine = 7; + */ + com.google.monitoring.v3.Service.AppEngineOrBuilder getAppEngineOrBuilder(); + + /** + * + * + *
+   * Type used for Cloud Endpoints services.
+   * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + boolean hasCloudEndpoints(); + /** + * + * + *
+   * Type used for Cloud Endpoints services.
+   * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + com.google.monitoring.v3.Service.CloudEndpoints getCloudEndpoints(); + /** + * + * + *
+   * Type used for Cloud Endpoints services.
+   * 
+ * + * .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + */ + com.google.monitoring.v3.Service.CloudEndpointsOrBuilder getCloudEndpointsOrBuilder(); + + /** + * + * + *
+   * Type used for Istio services that live in a Kubernetes cluster.
+   * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + boolean hasClusterIstio(); + /** + * + * + *
+   * Type used for Istio services that live in a Kubernetes cluster.
+   * 
+ * + * .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + */ + 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; + */ + com.google.monitoring.v3.Service.ClusterIstioOrBuilder getClusterIstioOrBuilder(); + + /** + * + * + *
+   * Configuration for how to query telemetry on a Service.
+   * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + boolean hasTelemetry(); + /** + * + * + *
+   * Configuration for how to query telemetry on a Service.
+   * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + com.google.monitoring.v3.Service.Telemetry getTelemetry(); + /** + * + * + *
+   * Configuration for how to query telemetry on a Service.
+   * 
+ * + * .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + com.google.monitoring.v3.Service.TelemetryOrBuilder getTelemetryOrBuilder(); + + public com.google.monitoring.v3.Service.IdentifierCase getIdentifierCase(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesRatio.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesRatio.java new file mode 100644 index 00000000..651743b9 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesRatio.java @@ -0,0 +1,1012 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * A `TimeSeriesRatio` specifies two `TimeSeries` to use for computing the
+ * `good_service / total_service` ratio. The specified `TimeSeries` must have
+ * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+ * DELTA` or `MetricKind = CUMULATIVE`. The `TimeSeriesRatio` must specify
+ * exactly two of good, bad, and total, and the relationship `good_service +
+ * bad_service = total_service` will be assumed.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.TimeSeriesRatio} + */ +public final class TimeSeriesRatio extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.TimeSeriesRatio) + TimeSeriesRatioOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeSeriesRatio.newBuilder() to construct. + private TimeSeriesRatio(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeSeriesRatio() { + goodServiceFilter_ = ""; + badServiceFilter_ = ""; + totalServiceFilter_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TimeSeriesRatio( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + goodServiceFilter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + badServiceFilter_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + totalServiceFilter_ = 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_TimeSeriesRatio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_TimeSeriesRatio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.TimeSeriesRatio.class, + com.google.monitoring.v3.TimeSeriesRatio.Builder.class); + } + + public static final int GOOD_SERVICE_FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object goodServiceFilter_; + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying good service provided. Must have
+   * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+   * DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string good_service_filter = 4; + */ + public java.lang.String getGoodServiceFilter() { + java.lang.Object ref = goodServiceFilter_; + 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(); + goodServiceFilter_ = s; + return s; + } + } + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying good service provided. Must have
+   * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+   * DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string good_service_filter = 4; + */ + public com.google.protobuf.ByteString getGoodServiceFilterBytes() { + java.lang.Object ref = goodServiceFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + goodServiceFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BAD_SERVICE_FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object badServiceFilter_; + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying bad service, either demanded service
+   * that was not provided or demanded service that was of inadequate quality.
+   * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have
+   * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string bad_service_filter = 5; + */ + public java.lang.String getBadServiceFilter() { + java.lang.Object ref = badServiceFilter_; + 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(); + badServiceFilter_ = s; + return s; + } + } + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying bad service, either demanded service
+   * that was not provided or demanded service that was of inadequate quality.
+   * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have
+   * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string bad_service_filter = 5; + */ + public com.google.protobuf.ByteString getBadServiceFilterBytes() { + java.lang.Object ref = badServiceFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + badServiceFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOTAL_SERVICE_FILTER_FIELD_NUMBER = 6; + private volatile java.lang.Object totalServiceFilter_; + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying total demanded service. Must have
+   * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+   * DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string total_service_filter = 6; + */ + public java.lang.String getTotalServiceFilter() { + java.lang.Object ref = totalServiceFilter_; + 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(); + totalServiceFilter_ = s; + return s; + } + } + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying total demanded service. Must have
+   * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+   * DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string total_service_filter = 6; + */ + public com.google.protobuf.ByteString getTotalServiceFilterBytes() { + java.lang.Object ref = totalServiceFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + totalServiceFilter_ = 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 (!getGoodServiceFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, goodServiceFilter_); + } + if (!getBadServiceFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, badServiceFilter_); + } + if (!getTotalServiceFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, totalServiceFilter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getGoodServiceFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, goodServiceFilter_); + } + if (!getBadServiceFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, badServiceFilter_); + } + if (!getTotalServiceFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, totalServiceFilter_); + } + 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.TimeSeriesRatio)) { + return super.equals(obj); + } + com.google.monitoring.v3.TimeSeriesRatio other = (com.google.monitoring.v3.TimeSeriesRatio) obj; + + if (!getGoodServiceFilter().equals(other.getGoodServiceFilter())) return false; + if (!getBadServiceFilter().equals(other.getBadServiceFilter())) return false; + if (!getTotalServiceFilter().equals(other.getTotalServiceFilter())) 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) + GOOD_SERVICE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getGoodServiceFilter().hashCode(); + hash = (37 * hash) + BAD_SERVICE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getBadServiceFilter().hashCode(); + hash = (37 * hash) + TOTAL_SERVICE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getTotalServiceFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.TimeSeriesRatio parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.TimeSeriesRatio 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.TimeSeriesRatio parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.TimeSeriesRatio 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.TimeSeriesRatio parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.TimeSeriesRatio parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.TimeSeriesRatio parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.TimeSeriesRatio 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.TimeSeriesRatio parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.TimeSeriesRatio 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.TimeSeriesRatio parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.TimeSeriesRatio 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.TimeSeriesRatio 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 `TimeSeriesRatio` specifies two `TimeSeries` to use for computing the
+   * `good_service / total_service` ratio. The specified `TimeSeries` must have
+   * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+   * DELTA` or `MetricKind = CUMULATIVE`. The `TimeSeriesRatio` must specify
+   * exactly two of good, bad, and total, and the relationship `good_service +
+   * bad_service = total_service` will be assumed.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.TimeSeriesRatio} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.TimeSeriesRatio) + com.google.monitoring.v3.TimeSeriesRatioOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_TimeSeriesRatio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_TimeSeriesRatio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.TimeSeriesRatio.class, + com.google.monitoring.v3.TimeSeriesRatio.Builder.class); + } + + // Construct using com.google.monitoring.v3.TimeSeriesRatio.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(); + goodServiceFilter_ = ""; + + badServiceFilter_ = ""; + + totalServiceFilter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_TimeSeriesRatio_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.TimeSeriesRatio getDefaultInstanceForType() { + return com.google.monitoring.v3.TimeSeriesRatio.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.TimeSeriesRatio build() { + com.google.monitoring.v3.TimeSeriesRatio result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.TimeSeriesRatio buildPartial() { + com.google.monitoring.v3.TimeSeriesRatio result = + new com.google.monitoring.v3.TimeSeriesRatio(this); + result.goodServiceFilter_ = goodServiceFilter_; + result.badServiceFilter_ = badServiceFilter_; + result.totalServiceFilter_ = totalServiceFilter_; + 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.TimeSeriesRatio) { + return mergeFrom((com.google.monitoring.v3.TimeSeriesRatio) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.TimeSeriesRatio other) { + if (other == com.google.monitoring.v3.TimeSeriesRatio.getDefaultInstance()) return this; + if (!other.getGoodServiceFilter().isEmpty()) { + goodServiceFilter_ = other.goodServiceFilter_; + onChanged(); + } + if (!other.getBadServiceFilter().isEmpty()) { + badServiceFilter_ = other.badServiceFilter_; + onChanged(); + } + if (!other.getTotalServiceFilter().isEmpty()) { + totalServiceFilter_ = other.totalServiceFilter_; + 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.TimeSeriesRatio parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.TimeSeriesRatio) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object goodServiceFilter_ = ""; + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying good service provided. Must have
+     * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+     * DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string good_service_filter = 4; + */ + public java.lang.String getGoodServiceFilter() { + java.lang.Object ref = goodServiceFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + goodServiceFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying good service provided. Must have
+     * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+     * DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string good_service_filter = 4; + */ + public com.google.protobuf.ByteString getGoodServiceFilterBytes() { + java.lang.Object ref = goodServiceFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + goodServiceFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying good service provided. Must have
+     * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+     * DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string good_service_filter = 4; + */ + public Builder setGoodServiceFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + goodServiceFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying good service provided. Must have
+     * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+     * DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string good_service_filter = 4; + */ + public Builder clearGoodServiceFilter() { + + goodServiceFilter_ = getDefaultInstance().getGoodServiceFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying good service provided. Must have
+     * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+     * DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string good_service_filter = 4; + */ + public Builder setGoodServiceFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + goodServiceFilter_ = value; + onChanged(); + return this; + } + + private java.lang.Object badServiceFilter_ = ""; + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying bad service, either demanded service
+     * that was not provided or demanded service that was of inadequate quality.
+     * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have
+     * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string bad_service_filter = 5; + */ + public java.lang.String getBadServiceFilter() { + java.lang.Object ref = badServiceFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + badServiceFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying bad service, either demanded service
+     * that was not provided or demanded service that was of inadequate quality.
+     * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have
+     * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string bad_service_filter = 5; + */ + public com.google.protobuf.ByteString getBadServiceFilterBytes() { + java.lang.Object ref = badServiceFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + badServiceFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying bad service, either demanded service
+     * that was not provided or demanded service that was of inadequate quality.
+     * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have
+     * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string bad_service_filter = 5; + */ + public Builder setBadServiceFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + badServiceFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying bad service, either demanded service
+     * that was not provided or demanded service that was of inadequate quality.
+     * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have
+     * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string bad_service_filter = 5; + */ + public Builder clearBadServiceFilter() { + + badServiceFilter_ = getDefaultInstance().getBadServiceFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying bad service, either demanded service
+     * that was not provided or demanded service that was of inadequate quality.
+     * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have
+     * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string bad_service_filter = 5; + */ + public Builder setBadServiceFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + badServiceFilter_ = value; + onChanged(); + return this; + } + + private java.lang.Object totalServiceFilter_ = ""; + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying total demanded service. Must have
+     * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+     * DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string total_service_filter = 6; + */ + public java.lang.String getTotalServiceFilter() { + java.lang.Object ref = totalServiceFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + totalServiceFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying total demanded service. Must have
+     * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+     * DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string total_service_filter = 6; + */ + public com.google.protobuf.ByteString getTotalServiceFilterBytes() { + java.lang.Object ref = totalServiceFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + totalServiceFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying total demanded service. Must have
+     * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+     * DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string total_service_filter = 6; + */ + public Builder setTotalServiceFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + totalServiceFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying total demanded service. Must have
+     * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+     * DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string total_service_filter = 6; + */ + public Builder clearTotalServiceFilter() { + + totalServiceFilter_ = getDefaultInstance().getTotalServiceFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` quantifying total demanded service. Must have
+     * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+     * DELTA` or `MetricKind = CUMULATIVE`.
+     * 
+ * + * string total_service_filter = 6; + */ + public Builder setTotalServiceFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + totalServiceFilter_ = 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.TimeSeriesRatio) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.TimeSeriesRatio) + private static final com.google.monitoring.v3.TimeSeriesRatio DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.TimeSeriesRatio(); + } + + public static com.google.monitoring.v3.TimeSeriesRatio getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeSeriesRatio parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TimeSeriesRatio(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.TimeSeriesRatio getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesRatioOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesRatioOrBuilder.java new file mode 100644 index 00000000..308296a7 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeSeriesRatioOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +public interface TimeSeriesRatioOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.TimeSeriesRatio) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying good service provided. Must have
+   * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+   * DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string good_service_filter = 4; + */ + java.lang.String getGoodServiceFilter(); + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying good service provided. Must have
+   * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+   * DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string good_service_filter = 4; + */ + com.google.protobuf.ByteString getGoodServiceFilterBytes(); + + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying bad service, either demanded service
+   * that was not provided or demanded service that was of inadequate quality.
+   * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have
+   * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string bad_service_filter = 5; + */ + java.lang.String getBadServiceFilter(); + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying bad service, either demanded service
+   * that was not provided or demanded service that was of inadequate quality.
+   * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have
+   * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string bad_service_filter = 5; + */ + com.google.protobuf.ByteString getBadServiceFilterBytes(); + + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying total demanded service. Must have
+   * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+   * DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string total_service_filter = 6; + */ + java.lang.String getTotalServiceFilter(); + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` quantifying total demanded service. Must have
+   * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
+   * DELTA` or `MetricKind = CUMULATIVE`.
+   * 
+ * + * string total_service_filter = 6; + */ + com.google.protobuf.ByteString getTotalServiceFilterBytes(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceLevelObjectiveRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceLevelObjectiveRequest.java new file mode 100644 index 00000000..39f0e199 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceLevelObjectiveRequest.java @@ -0,0 +1,998 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `UpdateServiceLevelObjective` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.UpdateServiceLevelObjectiveRequest} + */ +public final class UpdateServiceLevelObjectiveRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.UpdateServiceLevelObjectiveRequest) + UpdateServiceLevelObjectiveRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateServiceLevelObjectiveRequest.newBuilder() to construct. + private UpdateServiceLevelObjectiveRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateServiceLevelObjectiveRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateServiceLevelObjectiveRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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: + { + com.google.monitoring.v3.ServiceLevelObjective.Builder subBuilder = null; + if (serviceLevelObjective_ != null) { + subBuilder = serviceLevelObjective_.toBuilder(); + } + serviceLevelObjective_ = + input.readMessage( + com.google.monitoring.v3.ServiceLevelObjective.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceLevelObjective_); + serviceLevelObjective_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = 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.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_UpdateServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_UpdateServiceLevelObjectiveRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest.class, + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest.Builder.class); + } + + public static final int SERVICE_LEVEL_OBJECTIVE_FIELD_NUMBER = 1; + private com.google.monitoring.v3.ServiceLevelObjective serviceLevelObjective_; + /** + * + * + *
+   * The `ServiceLevelObjective` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + public boolean hasServiceLevelObjective() { + return serviceLevelObjective_ != null; + } + /** + * + * + *
+   * The `ServiceLevelObjective` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + public com.google.monitoring.v3.ServiceLevelObjective getServiceLevelObjective() { + return serviceLevelObjective_ == null + ? com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance() + : serviceLevelObjective_; + } + /** + * + * + *
+   * The `ServiceLevelObjective` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + public com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder + getServiceLevelObjectiveOrBuilder() { + return getServiceLevelObjective(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (serviceLevelObjective_ != null) { + output.writeMessage(1, getServiceLevelObjective()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (serviceLevelObjective_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getServiceLevelObjective()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.UpdateServiceLevelObjectiveRequest)) { + return super.equals(obj); + } + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest other = + (com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest) obj; + + if (hasServiceLevelObjective() != other.hasServiceLevelObjective()) return false; + if (hasServiceLevelObjective()) { + if (!getServiceLevelObjective().equals(other.getServiceLevelObjective())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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(); + if (hasServiceLevelObjective()) { + hash = (37 * hash) + SERVICE_LEVEL_OBJECTIVE_FIELD_NUMBER; + hash = (53 * hash) + getServiceLevelObjective().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest 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.UpdateServiceLevelObjectiveRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest 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.UpdateServiceLevelObjectiveRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest 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.UpdateServiceLevelObjectiveRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest 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.UpdateServiceLevelObjectiveRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest 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.UpdateServiceLevelObjectiveRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `UpdateServiceLevelObjective` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.UpdateServiceLevelObjectiveRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.UpdateServiceLevelObjectiveRequest) + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_UpdateServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_UpdateServiceLevelObjectiveRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest.class, + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest.Builder.class); + } + + // Construct using com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest.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(); + if (serviceLevelObjectiveBuilder_ == null) { + serviceLevelObjective_ = null; + } else { + serviceLevelObjective_ = null; + serviceLevelObjectiveBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_UpdateServiceLevelObjectiveRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest getDefaultInstanceForType() { + return com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest build() { + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest buildPartial() { + com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest result = + new com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest(this); + if (serviceLevelObjectiveBuilder_ == null) { + result.serviceLevelObjective_ = serviceLevelObjective_; + } else { + result.serviceLevelObjective_ = serviceLevelObjectiveBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.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.UpdateServiceLevelObjectiveRequest) { + return mergeFrom((com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest other) { + if (other == com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest.getDefaultInstance()) + return this; + if (other.hasServiceLevelObjective()) { + mergeServiceLevelObjective(other.getServiceLevelObjective()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.UpdateServiceLevelObjectiveRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.monitoring.v3.ServiceLevelObjective serviceLevelObjective_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelObjective, + com.google.monitoring.v3.ServiceLevelObjective.Builder, + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder> + serviceLevelObjectiveBuilder_; + /** + * + * + *
+     * The `ServiceLevelObjective` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + public boolean hasServiceLevelObjective() { + return serviceLevelObjectiveBuilder_ != null || serviceLevelObjective_ != null; + } + /** + * + * + *
+     * The `ServiceLevelObjective` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + public com.google.monitoring.v3.ServiceLevelObjective getServiceLevelObjective() { + if (serviceLevelObjectiveBuilder_ == null) { + return serviceLevelObjective_ == null + ? com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance() + : serviceLevelObjective_; + } else { + return serviceLevelObjectiveBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The `ServiceLevelObjective` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + public Builder setServiceLevelObjective(com.google.monitoring.v3.ServiceLevelObjective value) { + if (serviceLevelObjectiveBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceLevelObjective_ = value; + onChanged(); + } else { + serviceLevelObjectiveBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + public Builder setServiceLevelObjective( + com.google.monitoring.v3.ServiceLevelObjective.Builder builderForValue) { + if (serviceLevelObjectiveBuilder_ == null) { + serviceLevelObjective_ = builderForValue.build(); + onChanged(); + } else { + serviceLevelObjectiveBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + public Builder mergeServiceLevelObjective( + com.google.monitoring.v3.ServiceLevelObjective value) { + if (serviceLevelObjectiveBuilder_ == null) { + if (serviceLevelObjective_ != null) { + serviceLevelObjective_ = + com.google.monitoring.v3.ServiceLevelObjective.newBuilder(serviceLevelObjective_) + .mergeFrom(value) + .buildPartial(); + } else { + serviceLevelObjective_ = value; + } + onChanged(); + } else { + serviceLevelObjectiveBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + public Builder clearServiceLevelObjective() { + if (serviceLevelObjectiveBuilder_ == null) { + serviceLevelObjective_ = null; + onChanged(); + } else { + serviceLevelObjective_ = null; + serviceLevelObjectiveBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The `ServiceLevelObjective` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + public com.google.monitoring.v3.ServiceLevelObjective.Builder + getServiceLevelObjectiveBuilder() { + + onChanged(); + return getServiceLevelObjectiveFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The `ServiceLevelObjective` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + public com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder + getServiceLevelObjectiveOrBuilder() { + if (serviceLevelObjectiveBuilder_ != null) { + return serviceLevelObjectiveBuilder_.getMessageOrBuilder(); + } else { + return serviceLevelObjective_ == null + ? com.google.monitoring.v3.ServiceLevelObjective.getDefaultInstance() + : serviceLevelObjective_; + } + } + /** + * + * + *
+     * The `ServiceLevelObjective` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelObjective, + com.google.monitoring.v3.ServiceLevelObjective.Builder, + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder> + getServiceLevelObjectiveFieldBuilder() { + if (serviceLevelObjectiveBuilder_ == null) { + serviceLevelObjectiveBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.ServiceLevelObjective, + com.google.monitoring.v3.ServiceLevelObjective.Builder, + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder>( + getServiceLevelObjective(), getParentForChildren(), isClean()); + serviceLevelObjective_ = null; + } + return serviceLevelObjectiveBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.UpdateServiceLevelObjectiveRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.UpdateServiceLevelObjectiveRequest) + private static final com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest(); + } + + public static com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateServiceLevelObjectiveRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateServiceLevelObjectiveRequest(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.UpdateServiceLevelObjectiveRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceLevelObjectiveRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceLevelObjectiveRequestOrBuilder.java new file mode 100644 index 00000000..c7164db3 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceLevelObjectiveRequestOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface UpdateServiceLevelObjectiveRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.UpdateServiceLevelObjectiveRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The `ServiceLevelObjective` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + boolean hasServiceLevelObjective(); + /** + * + * + *
+   * The `ServiceLevelObjective` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + com.google.monitoring.v3.ServiceLevelObjective getServiceLevelObjective(); + /** + * + * + *
+   * The `ServiceLevelObjective` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1; + */ + com.google.monitoring.v3.ServiceLevelObjectiveOrBuilder getServiceLevelObjectiveOrBuilder(); + + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceRequest.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceRequest.java new file mode 100644 index 00000000..695b8c86 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceRequest.java @@ -0,0 +1,979 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * The `UpdateService` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.UpdateServiceRequest} + */ +public final class UpdateServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.UpdateServiceRequest) + UpdateServiceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateServiceRequest.newBuilder() to construct. + private UpdateServiceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateServiceRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateServiceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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: + { + com.google.monitoring.v3.Service.Builder subBuilder = null; + if (service_ != null) { + subBuilder = service_.toBuilder(); + } + service_ = + input.readMessage(com.google.monitoring.v3.Service.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(service_); + service_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = 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.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_UpdateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_UpdateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.UpdateServiceRequest.class, + com.google.monitoring.v3.UpdateServiceRequest.Builder.class); + } + + public static final int SERVICE_FIELD_NUMBER = 1; + private com.google.monitoring.v3.Service service_; + /** + * + * + *
+   * The `Service` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + public boolean hasService() { + return service_ != null; + } + /** + * + * + *
+   * The `Service` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + public com.google.monitoring.v3.Service getService() { + return service_ == null ? com.google.monitoring.v3.Service.getDefaultInstance() : service_; + } + /** + * + * + *
+   * The `Service` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + public com.google.monitoring.v3.ServiceOrBuilder getServiceOrBuilder() { + return getService(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (service_ != null) { + output.writeMessage(1, getService()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (service_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getService()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.UpdateServiceRequest)) { + return super.equals(obj); + } + com.google.monitoring.v3.UpdateServiceRequest other = + (com.google.monitoring.v3.UpdateServiceRequest) obj; + + if (hasService() != other.hasService()) return false; + if (hasService()) { + if (!getService().equals(other.getService())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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(); + if (hasService()) { + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.UpdateServiceRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.UpdateServiceRequest 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.UpdateServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.UpdateServiceRequest 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.UpdateServiceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.UpdateServiceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.UpdateServiceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.UpdateServiceRequest 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.UpdateServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.UpdateServiceRequest 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.UpdateServiceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.UpdateServiceRequest 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.UpdateServiceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `UpdateService` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.UpdateServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.UpdateServiceRequest) + com.google.monitoring.v3.UpdateServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_UpdateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_UpdateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.UpdateServiceRequest.class, + com.google.monitoring.v3.UpdateServiceRequest.Builder.class); + } + + // Construct using com.google.monitoring.v3.UpdateServiceRequest.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(); + if (serviceBuilder_ == null) { + service_ = null; + } else { + service_ = null; + serviceBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringServiceProto + .internal_static_google_monitoring_v3_UpdateServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.UpdateServiceRequest getDefaultInstanceForType() { + return com.google.monitoring.v3.UpdateServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.UpdateServiceRequest build() { + com.google.monitoring.v3.UpdateServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.UpdateServiceRequest buildPartial() { + com.google.monitoring.v3.UpdateServiceRequest result = + new com.google.monitoring.v3.UpdateServiceRequest(this); + if (serviceBuilder_ == null) { + result.service_ = service_; + } else { + result.service_ = serviceBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.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.UpdateServiceRequest) { + return mergeFrom((com.google.monitoring.v3.UpdateServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.UpdateServiceRequest other) { + if (other == com.google.monitoring.v3.UpdateServiceRequest.getDefaultInstance()) return this; + if (other.hasService()) { + mergeService(other.getService()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.UpdateServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.UpdateServiceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.monitoring.v3.Service service_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service, + com.google.monitoring.v3.Service.Builder, + com.google.monitoring.v3.ServiceOrBuilder> + serviceBuilder_; + /** + * + * + *
+     * The `Service` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + public boolean hasService() { + return serviceBuilder_ != null || service_ != null; + } + /** + * + * + *
+     * The `Service` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + public com.google.monitoring.v3.Service getService() { + if (serviceBuilder_ == null) { + return service_ == null ? com.google.monitoring.v3.Service.getDefaultInstance() : service_; + } else { + return serviceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The `Service` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + public Builder setService(com.google.monitoring.v3.Service value) { + if (serviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + onChanged(); + } else { + serviceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The `Service` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + public Builder setService(com.google.monitoring.v3.Service.Builder builderForValue) { + if (serviceBuilder_ == null) { + service_ = builderForValue.build(); + onChanged(); + } else { + serviceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The `Service` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + public Builder mergeService(com.google.monitoring.v3.Service value) { + if (serviceBuilder_ == null) { + if (service_ != null) { + service_ = + com.google.monitoring.v3.Service.newBuilder(service_).mergeFrom(value).buildPartial(); + } else { + service_ = value; + } + onChanged(); + } else { + serviceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The `Service` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + public Builder clearService() { + if (serviceBuilder_ == null) { + service_ = null; + onChanged(); + } else { + service_ = null; + serviceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The `Service` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + public com.google.monitoring.v3.Service.Builder getServiceBuilder() { + + onChanged(); + return getServiceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The `Service` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + public com.google.monitoring.v3.ServiceOrBuilder getServiceOrBuilder() { + if (serviceBuilder_ != null) { + return serviceBuilder_.getMessageOrBuilder(); + } else { + return service_ == null ? com.google.monitoring.v3.Service.getDefaultInstance() : service_; + } + } + /** + * + * + *
+     * The `Service` to draw updates from.
+     * The given `name` specifies the resource to update.
+     * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service, + com.google.monitoring.v3.Service.Builder, + com.google.monitoring.v3.ServiceOrBuilder> + getServiceFieldBuilder() { + if (serviceBuilder_ == null) { + serviceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Service, + com.google.monitoring.v3.Service.Builder, + com.google.monitoring.v3.ServiceOrBuilder>( + getService(), getParentForChildren(), isClean()); + service_ = null; + } + return serviceBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * A set of field paths defining which fields to use for the update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.UpdateServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.UpdateServiceRequest) + private static final com.google.monitoring.v3.UpdateServiceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.UpdateServiceRequest(); + } + + public static com.google.monitoring.v3.UpdateServiceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateServiceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateServiceRequest(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.UpdateServiceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceRequestOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceRequestOrBuilder.java new file mode 100644 index 00000000..1b797c93 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UpdateServiceRequestOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2019 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/service_service.proto + +package com.google.monitoring.v3; + +public interface UpdateServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.UpdateServiceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The `Service` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + boolean hasService(); + /** + * + * + *
+   * The `Service` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + com.google.monitoring.v3.Service getService(); + /** + * + * + *
+   * The `Service` to draw updates from.
+   * The given `name` specifies the resource to update.
+   * 
+ * + * .google.monitoring.v3.Service service = 1; + */ + com.google.monitoring.v3.ServiceOrBuilder getServiceOrBuilder(); + + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * A set of field paths defining which fields to use for the update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} 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 a06b4e62..013ec142 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 @@ -4377,7 +4377,8 @@ public interface ContentMatcherOrBuilder * * *
-     * String or regex content to match (max 1024 bytes)
+     * String or regex content to match. Maximum 1024 bytes. An empty `content`
+     * string indicates no content matching is to be performed.
      * 
* * string content = 1; @@ -4387,7 +4388,8 @@ public interface ContentMatcherOrBuilder * * *
-     * String or regex content to match (max 1024 bytes)
+     * String or regex content to match. Maximum 1024 bytes. An empty `content`
+     * string indicates no content matching is to be performed.
      * 
* * string content = 1; @@ -4425,8 +4427,11 @@ public interface ContentMatcherOrBuilder * * *
-   * Used to perform string matching. It allows substring and regular
-   * expressions, together with their negations.
+   * Optional. Used to perform content matching. This allows matching based on
+   * substrings and regular expressions, together with their negations. Only the
+   * first 4&nbsp;MB of an HTTP or HTTPS check's response (and the first
+   * 1&nbsp;MB of a TCP check's response) are examined for purposes of content
+   * matching.
    * 
* * Protobuf type {@code google.monitoring.v3.UptimeCheckConfig.ContentMatcher} @@ -4545,8 +4550,8 @@ public enum ContentMatcherOption implements com.google.protobuf.ProtocolMessageE * * *
-       * Selects substring matching (there is a match if the output contains
-       * the `content` string).  This is the default value for checks without
+       * Selects substring matching. The match succeeds if the output contains
+       * the `content` string.  This is the default value for checks without
        * a `matcher` option, or where the value of `matcher` is
        * `CONTENT_MATCHER_OPTION_UNSPECIFIED`.
        * 
@@ -4558,8 +4563,8 @@ public enum ContentMatcherOption implements com.google.protobuf.ProtocolMessageE * * *
-       * Selects negation of substring matching (there is a match if the output
-       * does NOT contain the `content` string).
+       * Selects negation of substring matching. The match succeeds if the
+       * output does _NOT_ contain the `content` string.
        * 
* * NOT_CONTAINS_STRING = 2; @@ -4569,8 +4574,8 @@ public enum ContentMatcherOption implements com.google.protobuf.ProtocolMessageE * * *
-       * Selects regular expression matching (there is a match of the output
-       * matches the regular expression specified in the `content` string).
+       * Selects regular-expression matching. The match succeeds of the output
+       * matches the regular expression specified in the `content` string.
        * 
* * MATCHES_REGEX = 3; @@ -4580,9 +4585,9 @@ public enum ContentMatcherOption implements com.google.protobuf.ProtocolMessageE * * *
-       * Selects negation of regular expression matching (there is a match if
-       * the output does NOT match the regular expression specified in the
-       * `content` string).
+       * Selects negation of regular-expression matching. The match succeeds if
+       * the output does _NOT_ match the regular expression specified in the
+       * `content` string.
        * 
* * NOT_MATCHES_REGEX = 4; @@ -4607,8 +4612,8 @@ public enum ContentMatcherOption implements com.google.protobuf.ProtocolMessageE * * *
-       * Selects substring matching (there is a match if the output contains
-       * the `content` string).  This is the default value for checks without
+       * Selects substring matching. The match succeeds if the output contains
+       * the `content` string.  This is the default value for checks without
        * a `matcher` option, or where the value of `matcher` is
        * `CONTENT_MATCHER_OPTION_UNSPECIFIED`.
        * 
@@ -4620,8 +4625,8 @@ public enum ContentMatcherOption implements com.google.protobuf.ProtocolMessageE * * *
-       * Selects negation of substring matching (there is a match if the output
-       * does NOT contain the `content` string).
+       * Selects negation of substring matching. The match succeeds if the
+       * output does _NOT_ contain the `content` string.
        * 
* * NOT_CONTAINS_STRING = 2; @@ -4631,8 +4636,8 @@ public enum ContentMatcherOption implements com.google.protobuf.ProtocolMessageE * * *
-       * Selects regular expression matching (there is a match of the output
-       * matches the regular expression specified in the `content` string).
+       * Selects regular-expression matching. The match succeeds of the output
+       * matches the regular expression specified in the `content` string.
        * 
* * MATCHES_REGEX = 3; @@ -4642,9 +4647,9 @@ public enum ContentMatcherOption implements com.google.protobuf.ProtocolMessageE * * *
-       * Selects negation of regular expression matching (there is a match if
-       * the output does NOT match the regular expression specified in the
-       * `content` string).
+       * Selects negation of regular-expression matching. The match succeeds if
+       * the output does _NOT_ match the regular expression specified in the
+       * `content` string.
        * 
* * NOT_MATCHES_REGEX = 4; @@ -4737,7 +4742,8 @@ private ContentMatcherOption(int value) { * * *
-     * String or regex content to match (max 1024 bytes)
+     * String or regex content to match. Maximum 1024 bytes. An empty `content`
+     * string indicates no content matching is to be performed.
      * 
* * string content = 1; @@ -4757,7 +4763,8 @@ public java.lang.String getContent() { * * *
-     * String or regex content to match (max 1024 bytes)
+     * String or regex content to match. Maximum 1024 bytes. An empty `content`
+     * string indicates no content matching is to be performed.
      * 
* * string content = 1; @@ -4995,8 +5002,11 @@ protected Builder newBuilderForType( * * *
-     * Used to perform string matching. It allows substring and regular
-     * expressions, together with their negations.
+     * Optional. Used to perform content matching. This allows matching based on
+     * substrings and regular expressions, together with their negations. Only the
+     * first 4&nbsp;MB of an HTTP or HTTPS check's response (and the first
+     * 1&nbsp;MB of a TCP check's response) are examined for purposes of content
+     * matching.
      * 
* * Protobuf type {@code google.monitoring.v3.UptimeCheckConfig.ContentMatcher} @@ -5165,7 +5175,8 @@ public Builder mergeFrom( * * *
-       * String or regex content to match (max 1024 bytes)
+       * String or regex content to match. Maximum 1024 bytes. An empty `content`
+       * string indicates no content matching is to be performed.
        * 
* * string content = 1; @@ -5185,7 +5196,8 @@ public java.lang.String getContent() { * * *
-       * String or regex content to match (max 1024 bytes)
+       * String or regex content to match. Maximum 1024 bytes. An empty `content`
+       * string indicates no content matching is to be performed.
        * 
* * string content = 1; @@ -5205,7 +5217,8 @@ public com.google.protobuf.ByteString getContentBytes() { * * *
-       * String or regex content to match (max 1024 bytes)
+       * String or regex content to match. Maximum 1024 bytes. An empty `content`
+       * string indicates no content matching is to be performed.
        * 
* * string content = 1; @@ -5223,7 +5236,8 @@ public Builder setContent(java.lang.String value) { * * *
-       * String or regex content to match (max 1024 bytes)
+       * String or regex content to match. Maximum 1024 bytes. An empty `content`
+       * string indicates no content matching is to be performed.
        * 
* * string content = 1; @@ -5238,7 +5252,8 @@ public Builder clearContent() { * * *
-       * String or regex content to match (max 1024 bytes)
+       * String or regex content to match. Maximum 1024 bytes. An empty `content`
+       * string indicates no content matching is to be performed.
        * 
* * string content = 1; diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/WindowsBasedSli.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/WindowsBasedSli.java new file mode 100644 index 00000000..5a20d3b2 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/WindowsBasedSli.java @@ -0,0 +1,4166 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * A `WindowsBasedSli` defines `good_service` as the count of time windows for
+ * which the provided service was of good quality. Criteria for determining
+ * if service was good are embedded in the `window_criterion`.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.WindowsBasedSli} + */ +public final class WindowsBasedSli extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.WindowsBasedSli) + WindowsBasedSliOrBuilder { + private static final long serialVersionUID = 0L; + // Use WindowsBasedSli.newBuilder() to construct. + private WindowsBasedSli(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WindowsBasedSli() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WindowsBasedSli( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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 18: + { + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.Builder subBuilder = + null; + if (windowCriterionCase_ == 2) { + subBuilder = + ((com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) + windowCriterion_) + .toBuilder(); + } + windowCriterion_ = + input.readMessage( + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) + windowCriterion_); + windowCriterion_ = subBuilder.buildPartial(); + } + windowCriterionCase_ = 2; + break; + } + case 34: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (windowPeriod_ != null) { + subBuilder = windowPeriod_.toBuilder(); + } + windowPeriod_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(windowPeriod_); + windowPeriod_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + windowCriterionCase_ = 5; + windowCriterion_ = s; + break; + } + case 50: + { + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder subBuilder = null; + if (windowCriterionCase_ == 6) { + subBuilder = + ((com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_) + .toBuilder(); + } + windowCriterion_ = + input.readMessage( + com.google.monitoring.v3.WindowsBasedSli.MetricRange.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_); + windowCriterion_ = subBuilder.buildPartial(); + } + windowCriterionCase_ = 6; + break; + } + case 58: + { + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder subBuilder = null; + if (windowCriterionCase_ == 7) { + subBuilder = + ((com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_) + .toBuilder(); + } + windowCriterion_ = + input.readMessage( + com.google.monitoring.v3.WindowsBasedSli.MetricRange.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_); + windowCriterion_ = subBuilder.buildPartial(); + } + windowCriterionCase_ = 7; + 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_WindowsBasedSli_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.WindowsBasedSli.class, + com.google.monitoring.v3.WindowsBasedSli.Builder.class); + } + + public interface PerformanceThresholdOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * `RequestBasedSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + boolean hasPerformance(); + /** + * + * + *
+     * `RequestBasedSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + com.google.monitoring.v3.RequestBasedSli getPerformance(); + /** + * + * + *
+     * `RequestBasedSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + com.google.monitoring.v3.RequestBasedSliOrBuilder getPerformanceOrBuilder(); + + /** + * + * + *
+     * `BasicSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + boolean hasBasicSliPerformance(); + /** + * + * + *
+     * `BasicSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + com.google.monitoring.v3.BasicSli getBasicSliPerformance(); + /** + * + * + *
+     * `BasicSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + com.google.monitoring.v3.BasicSliOrBuilder getBasicSliPerformanceOrBuilder(); + + /** + * + * + *
+     * If window `performance >= threshold`, the window is counted as good.
+     * 
+ * + * double threshold = 2; + */ + double getThreshold(); + + public com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.TypeCase getTypeCase(); + } + /** + * + * + *
+   * A `PerformanceThreshold` is used when each window is good when that window
+   * has a sufficiently high `performance`.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} + */ + public static final class PerformanceThreshold extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) + PerformanceThresholdOrBuilder { + private static final long serialVersionUID = 0L; + // Use PerformanceThreshold.newBuilder() to construct. + private PerformanceThreshold(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PerformanceThreshold() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PerformanceThreshold( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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: + { + com.google.monitoring.v3.RequestBasedSli.Builder subBuilder = null; + if (typeCase_ == 1) { + subBuilder = ((com.google.monitoring.v3.RequestBasedSli) type_).toBuilder(); + } + type_ = + input.readMessage( + com.google.monitoring.v3.RequestBasedSli.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.v3.RequestBasedSli) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 1; + break; + } + case 17: + { + threshold_ = input.readDouble(); + break; + } + case 26: + { + com.google.monitoring.v3.BasicSli.Builder subBuilder = null; + if (typeCase_ == 3) { + subBuilder = ((com.google.monitoring.v3.BasicSli) type_).toBuilder(); + } + type_ = + input.readMessage( + com.google.monitoring.v3.BasicSli.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.v3.BasicSli) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 3; + 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_WindowsBasedSli_PerformanceThreshold_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_PerformanceThreshold_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.class, + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.Builder.class); + } + + private int typeCase_ = 0; + private java.lang.Object type_; + + public enum TypeCase implements com.google.protobuf.Internal.EnumLite { + PERFORMANCE(1), + BASIC_SLI_PERFORMANCE(3), + TYPE_NOT_SET(0); + private final int value; + + private TypeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static TypeCase valueOf(int value) { + return forNumber(value); + } + + public static TypeCase forNumber(int value) { + switch (value) { + case 1: + return PERFORMANCE; + case 3: + return BASIC_SLI_PERFORMANCE; + case 0: + return TYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public static final int PERFORMANCE_FIELD_NUMBER = 1; + /** + * + * + *
+     * `RequestBasedSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + public boolean hasPerformance() { + return typeCase_ == 1; + } + /** + * + * + *
+     * `RequestBasedSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + public com.google.monitoring.v3.RequestBasedSli getPerformance() { + if (typeCase_ == 1) { + return (com.google.monitoring.v3.RequestBasedSli) type_; + } + return com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } + /** + * + * + *
+     * `RequestBasedSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + public com.google.monitoring.v3.RequestBasedSliOrBuilder getPerformanceOrBuilder() { + if (typeCase_ == 1) { + return (com.google.monitoring.v3.RequestBasedSli) type_; + } + return com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } + + public static final int BASIC_SLI_PERFORMANCE_FIELD_NUMBER = 3; + /** + * + * + *
+     * `BasicSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + public boolean hasBasicSliPerformance() { + return typeCase_ == 3; + } + /** + * + * + *
+     * `BasicSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + public com.google.monitoring.v3.BasicSli getBasicSliPerformance() { + if (typeCase_ == 3) { + return (com.google.monitoring.v3.BasicSli) type_; + } + return com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } + /** + * + * + *
+     * `BasicSli` to evaluate to judge window quality.
+     * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + public com.google.monitoring.v3.BasicSliOrBuilder getBasicSliPerformanceOrBuilder() { + if (typeCase_ == 3) { + return (com.google.monitoring.v3.BasicSli) type_; + } + return com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } + + public static final int THRESHOLD_FIELD_NUMBER = 2; + private double threshold_; + /** + * + * + *
+     * If window `performance >= threshold`, the window is counted as good.
+     * 
+ * + * double threshold = 2; + */ + public double getThreshold() { + return threshold_; + } + + 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 (typeCase_ == 1) { + output.writeMessage(1, (com.google.monitoring.v3.RequestBasedSli) type_); + } + if (threshold_ != 0D) { + output.writeDouble(2, threshold_); + } + if (typeCase_ == 3) { + output.writeMessage(3, (com.google.monitoring.v3.BasicSli) type_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (typeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.monitoring.v3.RequestBasedSli) type_); + } + if (threshold_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, threshold_); + } + if (typeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.monitoring.v3.BasicSli) type_); + } + 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.WindowsBasedSli.PerformanceThreshold)) { + return super.equals(obj); + } + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold other = + (com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) obj; + + if (java.lang.Double.doubleToLongBits(getThreshold()) + != java.lang.Double.doubleToLongBits(other.getThreshold())) return false; + if (!getTypeCase().equals(other.getTypeCase())) return false; + switch (typeCase_) { + case 1: + if (!getPerformance().equals(other.getPerformance())) return false; + break; + case 3: + if (!getBasicSliPerformance().equals(other.getBasicSliPerformance())) return false; + break; + case 0: + default: + } + 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) + THRESHOLD_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getThreshold())); + switch (typeCase_) { + case 1: + hash = (37 * hash) + PERFORMANCE_FIELD_NUMBER; + hash = (53 * hash) + getPerformance().hashCode(); + break; + case 3: + hash = (37 * hash) + BASIC_SLI_PERFORMANCE_FIELD_NUMBER; + hash = (53 * hash) + getBasicSliPerformance().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold 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.WindowsBasedSli.PerformanceThreshold parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold 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.WindowsBasedSli.PerformanceThreshold parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold 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.WindowsBasedSli.PerformanceThreshold parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold 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.WindowsBasedSli.PerformanceThreshold parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold 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.WindowsBasedSli.PerformanceThreshold 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 `PerformanceThreshold` is used when each window is good when that window
+     * has a sufficiently high `performance`.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) + com.google.monitoring.v3.WindowsBasedSli.PerformanceThresholdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_PerformanceThreshold_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_PerformanceThreshold_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.class, + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.Builder.class); + } + + // Construct using com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.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(); + threshold_ = 0D; + + typeCase_ = 0; + type_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_PerformanceThreshold_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + getDefaultInstanceForType() { + return com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold build() { + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold buildPartial() { + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold result = + new com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold(this); + if (typeCase_ == 1) { + if (performanceBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = performanceBuilder_.build(); + } + } + if (typeCase_ == 3) { + if (basicSliPerformanceBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = basicSliPerformanceBuilder_.build(); + } + } + result.threshold_ = threshold_; + result.typeCase_ = typeCase_; + 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.WindowsBasedSli.PerformanceThreshold) { + return mergeFrom((com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold other) { + if (other + == com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.getDefaultInstance()) + return this; + if (other.getThreshold() != 0D) { + setThreshold(other.getThreshold()); + } + switch (other.getTypeCase()) { + case PERFORMANCE: + { + mergePerformance(other.getPerformance()); + break; + } + case BASIC_SLI_PERFORMANCE: + { + mergeBasicSliPerformance(other.getBasicSliPerformance()); + break; + } + case TYPE_NOT_SET: + { + break; + } + } + 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.WindowsBasedSli.PerformanceThreshold parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int typeCase_ = 0; + private java.lang.Object type_; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public Builder clearType() { + typeCase_ = 0; + type_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.RequestBasedSli, + com.google.monitoring.v3.RequestBasedSli.Builder, + com.google.monitoring.v3.RequestBasedSliOrBuilder> + performanceBuilder_; + /** + * + * + *
+       * `RequestBasedSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + public boolean hasPerformance() { + return typeCase_ == 1; + } + /** + * + * + *
+       * `RequestBasedSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + public com.google.monitoring.v3.RequestBasedSli getPerformance() { + if (performanceBuilder_ == null) { + if (typeCase_ == 1) { + return (com.google.monitoring.v3.RequestBasedSli) type_; + } + return com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } else { + if (typeCase_ == 1) { + return performanceBuilder_.getMessage(); + } + return com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } + } + /** + * + * + *
+       * `RequestBasedSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + public Builder setPerformance(com.google.monitoring.v3.RequestBasedSli value) { + if (performanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + performanceBuilder_.setMessage(value); + } + typeCase_ = 1; + return this; + } + /** + * + * + *
+       * `RequestBasedSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + public Builder setPerformance( + com.google.monitoring.v3.RequestBasedSli.Builder builderForValue) { + if (performanceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + performanceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 1; + return this; + } + /** + * + * + *
+       * `RequestBasedSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + public Builder mergePerformance(com.google.monitoring.v3.RequestBasedSli value) { + if (performanceBuilder_ == null) { + if (typeCase_ == 1 + && type_ != com.google.monitoring.v3.RequestBasedSli.getDefaultInstance()) { + type_ = + com.google.monitoring.v3.RequestBasedSli.newBuilder( + (com.google.monitoring.v3.RequestBasedSli) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 1) { + performanceBuilder_.mergeFrom(value); + } + performanceBuilder_.setMessage(value); + } + typeCase_ = 1; + return this; + } + /** + * + * + *
+       * `RequestBasedSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + public Builder clearPerformance() { + if (performanceBuilder_ == null) { + if (typeCase_ == 1) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 1) { + typeCase_ = 0; + type_ = null; + } + performanceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * `RequestBasedSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + public com.google.monitoring.v3.RequestBasedSli.Builder getPerformanceBuilder() { + return getPerformanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * `RequestBasedSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + public com.google.monitoring.v3.RequestBasedSliOrBuilder getPerformanceOrBuilder() { + if ((typeCase_ == 1) && (performanceBuilder_ != null)) { + return performanceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 1) { + return (com.google.monitoring.v3.RequestBasedSli) type_; + } + return com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } + } + /** + * + * + *
+       * `RequestBasedSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.RequestBasedSli performance = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.RequestBasedSli, + com.google.monitoring.v3.RequestBasedSli.Builder, + com.google.monitoring.v3.RequestBasedSliOrBuilder> + getPerformanceFieldBuilder() { + if (performanceBuilder_ == null) { + if (!(typeCase_ == 1)) { + type_ = com.google.monitoring.v3.RequestBasedSli.getDefaultInstance(); + } + performanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.RequestBasedSli, + com.google.monitoring.v3.RequestBasedSli.Builder, + com.google.monitoring.v3.RequestBasedSliOrBuilder>( + (com.google.monitoring.v3.RequestBasedSli) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 1; + onChanged(); + ; + return performanceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli, + com.google.monitoring.v3.BasicSli.Builder, + com.google.monitoring.v3.BasicSliOrBuilder> + basicSliPerformanceBuilder_; + /** + * + * + *
+       * `BasicSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + public boolean hasBasicSliPerformance() { + return typeCase_ == 3; + } + /** + * + * + *
+       * `BasicSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + public com.google.monitoring.v3.BasicSli getBasicSliPerformance() { + if (basicSliPerformanceBuilder_ == null) { + if (typeCase_ == 3) { + return (com.google.monitoring.v3.BasicSli) type_; + } + return com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } else { + if (typeCase_ == 3) { + return basicSliPerformanceBuilder_.getMessage(); + } + return com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } + } + /** + * + * + *
+       * `BasicSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + public Builder setBasicSliPerformance(com.google.monitoring.v3.BasicSli value) { + if (basicSliPerformanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + basicSliPerformanceBuilder_.setMessage(value); + } + typeCase_ = 3; + return this; + } + /** + * + * + *
+       * `BasicSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + public Builder setBasicSliPerformance( + com.google.monitoring.v3.BasicSli.Builder builderForValue) { + if (basicSliPerformanceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + basicSliPerformanceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 3; + return this; + } + /** + * + * + *
+       * `BasicSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + public Builder mergeBasicSliPerformance(com.google.monitoring.v3.BasicSli value) { + if (basicSliPerformanceBuilder_ == null) { + if (typeCase_ == 3 && type_ != com.google.monitoring.v3.BasicSli.getDefaultInstance()) { + type_ = + com.google.monitoring.v3.BasicSli.newBuilder( + (com.google.monitoring.v3.BasicSli) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 3) { + basicSliPerformanceBuilder_.mergeFrom(value); + } + basicSliPerformanceBuilder_.setMessage(value); + } + typeCase_ = 3; + return this; + } + /** + * + * + *
+       * `BasicSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + public Builder clearBasicSliPerformance() { + if (basicSliPerformanceBuilder_ == null) { + if (typeCase_ == 3) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 3) { + typeCase_ = 0; + type_ = null; + } + basicSliPerformanceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * `BasicSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + public com.google.monitoring.v3.BasicSli.Builder getBasicSliPerformanceBuilder() { + return getBasicSliPerformanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * `BasicSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + public com.google.monitoring.v3.BasicSliOrBuilder getBasicSliPerformanceOrBuilder() { + if ((typeCase_ == 3) && (basicSliPerformanceBuilder_ != null)) { + return basicSliPerformanceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 3) { + return (com.google.monitoring.v3.BasicSli) type_; + } + return com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } + } + /** + * + * + *
+       * `BasicSli` to evaluate to judge window quality.
+       * 
+ * + * .google.monitoring.v3.BasicSli basic_sli_performance = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli, + com.google.monitoring.v3.BasicSli.Builder, + com.google.monitoring.v3.BasicSliOrBuilder> + getBasicSliPerformanceFieldBuilder() { + if (basicSliPerformanceBuilder_ == null) { + if (!(typeCase_ == 3)) { + type_ = com.google.monitoring.v3.BasicSli.getDefaultInstance(); + } + basicSliPerformanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.BasicSli, + com.google.monitoring.v3.BasicSli.Builder, + com.google.monitoring.v3.BasicSliOrBuilder>( + (com.google.monitoring.v3.BasicSli) type_, getParentForChildren(), isClean()); + type_ = null; + } + typeCase_ = 3; + onChanged(); + ; + return basicSliPerformanceBuilder_; + } + + private double threshold_; + /** + * + * + *
+       * If window `performance >= threshold`, the window is counted as good.
+       * 
+ * + * double threshold = 2; + */ + public double getThreshold() { + return threshold_; + } + /** + * + * + *
+       * If window `performance >= threshold`, the window is counted as good.
+       * 
+ * + * double threshold = 2; + */ + public Builder setThreshold(double value) { + + threshold_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If window `performance >= threshold`, the window is counted as good.
+       * 
+ * + * double threshold = 2; + */ + public Builder clearThreshold() { + + threshold_ = 0D; + 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.WindowsBasedSli.PerformanceThreshold) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) + private static final com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold(); + } + + public static com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PerformanceThreshold parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PerformanceThreshold(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.WindowsBasedSli.PerformanceThreshold + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MetricRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.WindowsBasedSli.MetricRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying the `TimeSeries` to use for evaluating window quality.
+     * 
+ * + * string time_series = 1; + */ + java.lang.String getTimeSeries(); + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying the `TimeSeries` to use for evaluating window quality.
+     * 
+ * + * string time_series = 1; + */ + com.google.protobuf.ByteString getTimeSeriesBytes(); + + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound
+     * to an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + boolean hasRange(); + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound
+     * to an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + com.google.monitoring.v3.Range getRange(); + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound
+     * to an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + com.google.monitoring.v3.RangeOrBuilder getRangeOrBuilder(); + } + /** + * + * + *
+   * A `MetricRange` is used when each window is good when the value x of a
+   * single `TimeSeries` satisfies `range.min <= x < range.max`. The provided
+   * `TimeSeries` must have `ValueType = INT64` or `ValueType = DOUBLE` and
+   * `MetricKind = GAUGE`.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.WindowsBasedSli.MetricRange} + */ + public static final class MetricRange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.WindowsBasedSli.MetricRange) + MetricRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use MetricRange.newBuilder() to construct. + private MetricRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MetricRange() { + timeSeries_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MetricRange( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + 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(); + + timeSeries_ = s; + break; + } + case 34: + { + com.google.monitoring.v3.Range.Builder subBuilder = null; + if (range_ != null) { + subBuilder = range_.toBuilder(); + } + range_ = + input.readMessage(com.google.monitoring.v3.Range.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(range_); + range_ = 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.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_MetricRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_MetricRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.WindowsBasedSli.MetricRange.class, + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder.class); + } + + public static final int TIME_SERIES_FIELD_NUMBER = 1; + private volatile java.lang.Object timeSeries_; + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying the `TimeSeries` to use for evaluating window quality.
+     * 
+ * + * string time_series = 1; + */ + public java.lang.String getTimeSeries() { + java.lang.Object ref = timeSeries_; + 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(); + timeSeries_ = s; + return s; + } + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying the `TimeSeries` to use for evaluating window quality.
+     * 
+ * + * string time_series = 1; + */ + public com.google.protobuf.ByteString getTimeSeriesBytes() { + java.lang.Object ref = timeSeries_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeSeries_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RANGE_FIELD_NUMBER = 4; + private com.google.monitoring.v3.Range range_; + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound
+     * to an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + public boolean hasRange() { + return range_ != null; + } + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound
+     * to an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + public com.google.monitoring.v3.Range getRange() { + return range_ == null ? com.google.monitoring.v3.Range.getDefaultInstance() : range_; + } + /** + * + * + *
+     * Range of values considered "good." For a one-sided range, set one bound
+     * to an infinite value.
+     * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + public com.google.monitoring.v3.RangeOrBuilder getRangeOrBuilder() { + return getRange(); + } + + 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 (!getTimeSeriesBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, timeSeries_); + } + if (range_ != null) { + output.writeMessage(4, getRange()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTimeSeriesBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, timeSeries_); + } + if (range_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRange()); + } + 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.WindowsBasedSli.MetricRange)) { + return super.equals(obj); + } + com.google.monitoring.v3.WindowsBasedSli.MetricRange other = + (com.google.monitoring.v3.WindowsBasedSli.MetricRange) obj; + + if (!getTimeSeries().equals(other.getTimeSeries())) return false; + if (hasRange() != other.hasRange()) return false; + if (hasRange()) { + if (!getRange().equals(other.getRange())) 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) + TIME_SERIES_FIELD_NUMBER; + hash = (53 * hash) + getTimeSeries().hashCode(); + if (hasRange()) { + hash = (37 * hash) + RANGE_FIELD_NUMBER; + hash = (53 * hash) + getRange().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.WindowsBasedSli.MetricRange parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.WindowsBasedSli.MetricRange 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.WindowsBasedSli.MetricRange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.WindowsBasedSli.MetricRange 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.WindowsBasedSli.MetricRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.WindowsBasedSli.MetricRange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.WindowsBasedSli.MetricRange parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.WindowsBasedSli.MetricRange 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.WindowsBasedSli.MetricRange parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.WindowsBasedSli.MetricRange 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.WindowsBasedSli.MetricRange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.WindowsBasedSli.MetricRange 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.WindowsBasedSli.MetricRange 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 `MetricRange` is used when each window is good when the value x of a
+     * single `TimeSeries` satisfies `range.min <= x < range.max`. The provided
+     * `TimeSeries` must have `ValueType = INT64` or `ValueType = DOUBLE` and
+     * `MetricKind = GAUGE`.
+     * 
+ * + * Protobuf type {@code google.monitoring.v3.WindowsBasedSli.MetricRange} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.WindowsBasedSli.MetricRange) + com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_MetricRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_MetricRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.WindowsBasedSli.MetricRange.class, + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder.class); + } + + // Construct using com.google.monitoring.v3.WindowsBasedSli.MetricRange.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(); + timeSeries_ = ""; + + if (rangeBuilder_ == null) { + range_ = null; + } else { + range_ = null; + rangeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_MetricRange_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.WindowsBasedSli.MetricRange getDefaultInstanceForType() { + return com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.WindowsBasedSli.MetricRange build() { + com.google.monitoring.v3.WindowsBasedSli.MetricRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.WindowsBasedSli.MetricRange buildPartial() { + com.google.monitoring.v3.WindowsBasedSli.MetricRange result = + new com.google.monitoring.v3.WindowsBasedSli.MetricRange(this); + result.timeSeries_ = timeSeries_; + if (rangeBuilder_ == null) { + result.range_ = range_; + } else { + result.range_ = rangeBuilder_.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.WindowsBasedSli.MetricRange) { + return mergeFrom((com.google.monitoring.v3.WindowsBasedSli.MetricRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.WindowsBasedSli.MetricRange other) { + if (other == com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance()) + return this; + if (!other.getTimeSeries().isEmpty()) { + timeSeries_ = other.timeSeries_; + onChanged(); + } + if (other.hasRange()) { + mergeRange(other.getRange()); + } + 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.WindowsBasedSli.MetricRange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.v3.WindowsBasedSli.MetricRange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object timeSeries_ = ""; + /** + * + * + *
+       * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+       * specifying the `TimeSeries` to use for evaluating window quality.
+       * 
+ * + * string time_series = 1; + */ + public java.lang.String getTimeSeries() { + java.lang.Object ref = timeSeries_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeSeries_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+       * specifying the `TimeSeries` to use for evaluating window quality.
+       * 
+ * + * string time_series = 1; + */ + public com.google.protobuf.ByteString getTimeSeriesBytes() { + java.lang.Object ref = timeSeries_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeSeries_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+       * specifying the `TimeSeries` to use for evaluating window quality.
+       * 
+ * + * string time_series = 1; + */ + public Builder setTimeSeries(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timeSeries_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+       * specifying the `TimeSeries` to use for evaluating window quality.
+       * 
+ * + * string time_series = 1; + */ + public Builder clearTimeSeries() { + + timeSeries_ = getDefaultInstance().getTimeSeries(); + onChanged(); + return this; + } + /** + * + * + *
+       * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+       * specifying the `TimeSeries` to use for evaluating window quality.
+       * 
+ * + * string time_series = 1; + */ + public Builder setTimeSeriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timeSeries_ = value; + onChanged(); + return this; + } + + private com.google.monitoring.v3.Range range_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Range, + com.google.monitoring.v3.Range.Builder, + com.google.monitoring.v3.RangeOrBuilder> + rangeBuilder_; + /** + * + * + *
+       * Range of values considered "good." For a one-sided range, set one bound
+       * to an infinite value.
+       * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + public boolean hasRange() { + return rangeBuilder_ != null || range_ != null; + } + /** + * + * + *
+       * Range of values considered "good." For a one-sided range, set one bound
+       * to an infinite value.
+       * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + public com.google.monitoring.v3.Range getRange() { + if (rangeBuilder_ == null) { + return range_ == null ? com.google.monitoring.v3.Range.getDefaultInstance() : range_; + } else { + return rangeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Range of values considered "good." For a one-sided range, set one bound
+       * to an infinite value.
+       * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + public Builder setRange(com.google.monitoring.v3.Range value) { + if (rangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + range_ = value; + onChanged(); + } else { + rangeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Range of values considered "good." For a one-sided range, set one bound
+       * to an infinite value.
+       * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + public Builder setRange(com.google.monitoring.v3.Range.Builder builderForValue) { + if (rangeBuilder_ == null) { + range_ = builderForValue.build(); + onChanged(); + } else { + rangeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Range of values considered "good." For a one-sided range, set one bound
+       * to an infinite value.
+       * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + public Builder mergeRange(com.google.monitoring.v3.Range value) { + if (rangeBuilder_ == null) { + if (range_ != null) { + range_ = + com.google.monitoring.v3.Range.newBuilder(range_).mergeFrom(value).buildPartial(); + } else { + range_ = value; + } + onChanged(); + } else { + rangeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Range of values considered "good." For a one-sided range, set one bound
+       * to an infinite value.
+       * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + public Builder clearRange() { + if (rangeBuilder_ == null) { + range_ = null; + onChanged(); + } else { + range_ = null; + rangeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Range of values considered "good." For a one-sided range, set one bound
+       * to an infinite value.
+       * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + public com.google.monitoring.v3.Range.Builder getRangeBuilder() { + + onChanged(); + return getRangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Range of values considered "good." For a one-sided range, set one bound
+       * to an infinite value.
+       * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + public com.google.monitoring.v3.RangeOrBuilder getRangeOrBuilder() { + if (rangeBuilder_ != null) { + return rangeBuilder_.getMessageOrBuilder(); + } else { + return range_ == null ? com.google.monitoring.v3.Range.getDefaultInstance() : range_; + } + } + /** + * + * + *
+       * Range of values considered "good." For a one-sided range, set one bound
+       * to an infinite value.
+       * 
+ * + * .google.monitoring.v3.Range range = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Range, + com.google.monitoring.v3.Range.Builder, + com.google.monitoring.v3.RangeOrBuilder> + getRangeFieldBuilder() { + if (rangeBuilder_ == null) { + rangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.Range, + com.google.monitoring.v3.Range.Builder, + com.google.monitoring.v3.RangeOrBuilder>( + getRange(), getParentForChildren(), isClean()); + range_ = null; + } + return rangeBuilder_; + } + + @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.WindowsBasedSli.MetricRange) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.WindowsBasedSli.MetricRange) + private static final com.google.monitoring.v3.WindowsBasedSli.MetricRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.WindowsBasedSli.MetricRange(); + } + + public static com.google.monitoring.v3.WindowsBasedSli.MetricRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MetricRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MetricRange(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.WindowsBasedSli.MetricRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int windowCriterionCase_ = 0; + private java.lang.Object windowCriterion_; + + public enum WindowCriterionCase implements com.google.protobuf.Internal.EnumLite { + GOOD_BAD_METRIC_FILTER(5), + GOOD_TOTAL_RATIO_THRESHOLD(2), + METRIC_MEAN_IN_RANGE(6), + METRIC_SUM_IN_RANGE(7), + WINDOWCRITERION_NOT_SET(0); + private final int value; + + private WindowCriterionCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static WindowCriterionCase valueOf(int value) { + return forNumber(value); + } + + public static WindowCriterionCase forNumber(int value) { + switch (value) { + case 5: + return GOOD_BAD_METRIC_FILTER; + case 2: + return GOOD_TOTAL_RATIO_THRESHOLD; + case 6: + return METRIC_MEAN_IN_RANGE; + case 7: + return METRIC_SUM_IN_RANGE; + case 0: + return WINDOWCRITERION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public WindowCriterionCase getWindowCriterionCase() { + return WindowCriterionCase.forNumber(windowCriterionCase_); + } + + public static final int GOOD_BAD_METRIC_FILTER_FIELD_NUMBER = 5; + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if
+   * any `true` values appear in the window.
+   * 
+ * + * string good_bad_metric_filter = 5; + */ + public java.lang.String getGoodBadMetricFilter() { + java.lang.Object ref = ""; + if (windowCriterionCase_ == 5) { + ref = windowCriterion_; + } + 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(); + if (windowCriterionCase_ == 5) { + windowCriterion_ = s; + } + return s; + } + } + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if
+   * any `true` values appear in the window.
+   * 
+ * + * string good_bad_metric_filter = 5; + */ + public com.google.protobuf.ByteString getGoodBadMetricFilterBytes() { + java.lang.Object ref = ""; + if (windowCriterionCase_ == 5) { + ref = windowCriterion_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (windowCriterionCase_ == 5) { + windowCriterion_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GOOD_TOTAL_RATIO_THRESHOLD_FIELD_NUMBER = 2; + /** + * + * + *
+   * A window is good if its `performance` is high enough.
+   * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + public boolean hasGoodTotalRatioThreshold() { + return windowCriterionCase_ == 2; + } + /** + * + * + *
+   * A window is good if its `performance` is high enough.
+   * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + public com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + getGoodTotalRatioThreshold() { + if (windowCriterionCase_ == 2) { + return (com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.getDefaultInstance(); + } + /** + * + * + *
+   * A window is good if its `performance` is high enough.
+   * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + public com.google.monitoring.v3.WindowsBasedSli.PerformanceThresholdOrBuilder + getGoodTotalRatioThresholdOrBuilder() { + if (windowCriterionCase_ == 2) { + return (com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.getDefaultInstance(); + } + + public static final int METRIC_MEAN_IN_RANGE_FIELD_NUMBER = 6; + /** + * + * + *
+   * A window is good if the metric's value is in a good range, averaged
+   * across returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + public boolean hasMetricMeanInRange() { + return windowCriterionCase_ == 6; + } + /** + * + * + *
+   * A window is good if the metric's value is in a good range, averaged
+   * across returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + public com.google.monitoring.v3.WindowsBasedSli.MetricRange getMetricMeanInRange() { + if (windowCriterionCase_ == 6) { + return (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } + /** + * + * + *
+   * A window is good if the metric's value is in a good range, averaged
+   * across returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + public com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder + getMetricMeanInRangeOrBuilder() { + if (windowCriterionCase_ == 6) { + return (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } + + public static final int METRIC_SUM_IN_RANGE_FIELD_NUMBER = 7; + /** + * + * + *
+   * A window is good if the metric's value is in a good range, summed across
+   * returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + public boolean hasMetricSumInRange() { + return windowCriterionCase_ == 7; + } + /** + * + * + *
+   * A window is good if the metric's value is in a good range, summed across
+   * returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + public com.google.monitoring.v3.WindowsBasedSli.MetricRange getMetricSumInRange() { + if (windowCriterionCase_ == 7) { + return (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } + /** + * + * + *
+   * A window is good if the metric's value is in a good range, summed across
+   * returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + public com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder + getMetricSumInRangeOrBuilder() { + if (windowCriterionCase_ == 7) { + return (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } + + public static final int WINDOW_PERIOD_FIELD_NUMBER = 4; + private com.google.protobuf.Duration windowPeriod_; + /** + * + * + *
+   * Duration over which window quality is evaluated. Must be an integer
+   * fraction of a day and at least `60s`.
+   * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + public boolean hasWindowPeriod() { + return windowPeriod_ != null; + } + /** + * + * + *
+   * Duration over which window quality is evaluated. Must be an integer
+   * fraction of a day and at least `60s`.
+   * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + public com.google.protobuf.Duration getWindowPeriod() { + return windowPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : windowPeriod_; + } + /** + * + * + *
+   * Duration over which window quality is evaluated. Must be an integer
+   * fraction of a day and at least `60s`.
+   * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + public com.google.protobuf.DurationOrBuilder getWindowPeriodOrBuilder() { + return getWindowPeriod(); + } + + 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 (windowCriterionCase_ == 2) { + output.writeMessage( + 2, (com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) windowCriterion_); + } + if (windowPeriod_ != null) { + output.writeMessage(4, getWindowPeriod()); + } + if (windowCriterionCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, windowCriterion_); + } + if (windowCriterionCase_ == 6) { + output.writeMessage( + 6, (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_); + } + if (windowCriterionCase_ == 7) { + output.writeMessage( + 7, (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (windowCriterionCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) windowCriterion_); + } + if (windowPeriod_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getWindowPeriod()); + } + if (windowCriterionCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, windowCriterion_); + } + if (windowCriterionCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_); + } + if (windowCriterionCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_); + } + 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.WindowsBasedSli)) { + return super.equals(obj); + } + com.google.monitoring.v3.WindowsBasedSli other = (com.google.monitoring.v3.WindowsBasedSli) obj; + + if (hasWindowPeriod() != other.hasWindowPeriod()) return false; + if (hasWindowPeriod()) { + if (!getWindowPeriod().equals(other.getWindowPeriod())) return false; + } + if (!getWindowCriterionCase().equals(other.getWindowCriterionCase())) return false; + switch (windowCriterionCase_) { + case 5: + if (!getGoodBadMetricFilter().equals(other.getGoodBadMetricFilter())) return false; + break; + case 2: + if (!getGoodTotalRatioThreshold().equals(other.getGoodTotalRatioThreshold())) return false; + break; + case 6: + if (!getMetricMeanInRange().equals(other.getMetricMeanInRange())) return false; + break; + case 7: + if (!getMetricSumInRange().equals(other.getMetricSumInRange())) return false; + break; + case 0: + default: + } + 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(); + if (hasWindowPeriod()) { + hash = (37 * hash) + WINDOW_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getWindowPeriod().hashCode(); + } + switch (windowCriterionCase_) { + case 5: + hash = (37 * hash) + GOOD_BAD_METRIC_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getGoodBadMetricFilter().hashCode(); + break; + case 2: + hash = (37 * hash) + GOOD_TOTAL_RATIO_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getGoodTotalRatioThreshold().hashCode(); + break; + case 6: + hash = (37 * hash) + METRIC_MEAN_IN_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getMetricMeanInRange().hashCode(); + break; + case 7: + hash = (37 * hash) + METRIC_SUM_IN_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getMetricSumInRange().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.WindowsBasedSli parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.WindowsBasedSli 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.WindowsBasedSli parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.WindowsBasedSli 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.WindowsBasedSli parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.WindowsBasedSli parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.WindowsBasedSli parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.WindowsBasedSli 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.WindowsBasedSli parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.WindowsBasedSli 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.WindowsBasedSli parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.WindowsBasedSli 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.WindowsBasedSli 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 `WindowsBasedSli` defines `good_service` as the count of time windows for
+   * which the provided service was of good quality. Criteria for determining
+   * if service was good are embedded in the `window_criterion`.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.WindowsBasedSli} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.WindowsBasedSli) + com.google.monitoring.v3.WindowsBasedSliOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.WindowsBasedSli.class, + com.google.monitoring.v3.WindowsBasedSli.Builder.class); + } + + // Construct using com.google.monitoring.v3.WindowsBasedSli.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(); + if (windowPeriodBuilder_ == null) { + windowPeriod_ = null; + } else { + windowPeriod_ = null; + windowPeriodBuilder_ = null; + } + windowCriterionCase_ = 0; + windowCriterion_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.ServiceMonitoringProto + .internal_static_google_monitoring_v3_WindowsBasedSli_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.WindowsBasedSli getDefaultInstanceForType() { + return com.google.monitoring.v3.WindowsBasedSli.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.WindowsBasedSli build() { + com.google.monitoring.v3.WindowsBasedSli result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.WindowsBasedSli buildPartial() { + com.google.monitoring.v3.WindowsBasedSli result = + new com.google.monitoring.v3.WindowsBasedSli(this); + if (windowCriterionCase_ == 5) { + result.windowCriterion_ = windowCriterion_; + } + if (windowCriterionCase_ == 2) { + if (goodTotalRatioThresholdBuilder_ == null) { + result.windowCriterion_ = windowCriterion_; + } else { + result.windowCriterion_ = goodTotalRatioThresholdBuilder_.build(); + } + } + if (windowCriterionCase_ == 6) { + if (metricMeanInRangeBuilder_ == null) { + result.windowCriterion_ = windowCriterion_; + } else { + result.windowCriterion_ = metricMeanInRangeBuilder_.build(); + } + } + if (windowCriterionCase_ == 7) { + if (metricSumInRangeBuilder_ == null) { + result.windowCriterion_ = windowCriterion_; + } else { + result.windowCriterion_ = metricSumInRangeBuilder_.build(); + } + } + if (windowPeriodBuilder_ == null) { + result.windowPeriod_ = windowPeriod_; + } else { + result.windowPeriod_ = windowPeriodBuilder_.build(); + } + result.windowCriterionCase_ = windowCriterionCase_; + 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.WindowsBasedSli) { + return mergeFrom((com.google.monitoring.v3.WindowsBasedSli) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.WindowsBasedSli other) { + if (other == com.google.monitoring.v3.WindowsBasedSli.getDefaultInstance()) return this; + if (other.hasWindowPeriod()) { + mergeWindowPeriod(other.getWindowPeriod()); + } + switch (other.getWindowCriterionCase()) { + case GOOD_BAD_METRIC_FILTER: + { + windowCriterionCase_ = 5; + windowCriterion_ = other.windowCriterion_; + onChanged(); + break; + } + case GOOD_TOTAL_RATIO_THRESHOLD: + { + mergeGoodTotalRatioThreshold(other.getGoodTotalRatioThreshold()); + break; + } + case METRIC_MEAN_IN_RANGE: + { + mergeMetricMeanInRange(other.getMetricMeanInRange()); + break; + } + case METRIC_SUM_IN_RANGE: + { + mergeMetricSumInRange(other.getMetricSumInRange()); + break; + } + case WINDOWCRITERION_NOT_SET: + { + break; + } + } + 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.WindowsBasedSli parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.WindowsBasedSli) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int windowCriterionCase_ = 0; + private java.lang.Object windowCriterion_; + + public WindowCriterionCase getWindowCriterionCase() { + return WindowCriterionCase.forNumber(windowCriterionCase_); + } + + public Builder clearWindowCriterion() { + windowCriterionCase_ = 0; + windowCriterion_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if
+     * any `true` values appear in the window.
+     * 
+ * + * string good_bad_metric_filter = 5; + */ + public java.lang.String getGoodBadMetricFilter() { + java.lang.Object ref = ""; + if (windowCriterionCase_ == 5) { + ref = windowCriterion_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (windowCriterionCase_ == 5) { + windowCriterion_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if
+     * any `true` values appear in the window.
+     * 
+ * + * string good_bad_metric_filter = 5; + */ + public com.google.protobuf.ByteString getGoodBadMetricFilterBytes() { + java.lang.Object ref = ""; + if (windowCriterionCase_ == 5) { + ref = windowCriterion_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (windowCriterionCase_ == 5) { + windowCriterion_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if
+     * any `true` values appear in the window.
+     * 
+ * + * string good_bad_metric_filter = 5; + */ + public Builder setGoodBadMetricFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + windowCriterionCase_ = 5; + windowCriterion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if
+     * any `true` values appear in the window.
+     * 
+ * + * string good_bad_metric_filter = 5; + */ + public Builder clearGoodBadMetricFilter() { + if (windowCriterionCase_ == 5) { + windowCriterionCase_ = 0; + windowCriterion_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+     * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if
+     * any `true` values appear in the window.
+     * 
+ * + * string good_bad_metric_filter = 5; + */ + public Builder setGoodBadMetricFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + windowCriterionCase_ = 5; + windowCriterion_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold, + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.Builder, + com.google.monitoring.v3.WindowsBasedSli.PerformanceThresholdOrBuilder> + goodTotalRatioThresholdBuilder_; + /** + * + * + *
+     * A window is good if its `performance` is high enough.
+     * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + public boolean hasGoodTotalRatioThreshold() { + return windowCriterionCase_ == 2; + } + /** + * + * + *
+     * A window is good if its `performance` is high enough.
+     * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + public com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + getGoodTotalRatioThreshold() { + if (goodTotalRatioThresholdBuilder_ == null) { + if (windowCriterionCase_ == 2) { + return (com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.getDefaultInstance(); + } else { + if (windowCriterionCase_ == 2) { + return goodTotalRatioThresholdBuilder_.getMessage(); + } + return com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.getDefaultInstance(); + } + } + /** + * + * + *
+     * A window is good if its `performance` is high enough.
+     * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + public Builder setGoodTotalRatioThreshold( + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold value) { + if (goodTotalRatioThresholdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + windowCriterion_ = value; + onChanged(); + } else { + goodTotalRatioThresholdBuilder_.setMessage(value); + } + windowCriterionCase_ = 2; + return this; + } + /** + * + * + *
+     * A window is good if its `performance` is high enough.
+     * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + public Builder setGoodTotalRatioThreshold( + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.Builder builderForValue) { + if (goodTotalRatioThresholdBuilder_ == null) { + windowCriterion_ = builderForValue.build(); + onChanged(); + } else { + goodTotalRatioThresholdBuilder_.setMessage(builderForValue.build()); + } + windowCriterionCase_ = 2; + return this; + } + /** + * + * + *
+     * A window is good if its `performance` is high enough.
+     * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + public Builder mergeGoodTotalRatioThreshold( + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold value) { + if (goodTotalRatioThresholdBuilder_ == null) { + if (windowCriterionCase_ == 2 + && windowCriterion_ + != com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + .getDefaultInstance()) { + windowCriterion_ = + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.newBuilder( + (com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) + windowCriterion_) + .mergeFrom(value) + .buildPartial(); + } else { + windowCriterion_ = value; + } + onChanged(); + } else { + if (windowCriterionCase_ == 2) { + goodTotalRatioThresholdBuilder_.mergeFrom(value); + } + goodTotalRatioThresholdBuilder_.setMessage(value); + } + windowCriterionCase_ = 2; + return this; + } + /** + * + * + *
+     * A window is good if its `performance` is high enough.
+     * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + public Builder clearGoodTotalRatioThreshold() { + if (goodTotalRatioThresholdBuilder_ == null) { + if (windowCriterionCase_ == 2) { + windowCriterionCase_ = 0; + windowCriterion_ = null; + onChanged(); + } + } else { + if (windowCriterionCase_ == 2) { + windowCriterionCase_ = 0; + windowCriterion_ = null; + } + goodTotalRatioThresholdBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A window is good if its `performance` is high enough.
+     * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + public com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.Builder + getGoodTotalRatioThresholdBuilder() { + return getGoodTotalRatioThresholdFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A window is good if its `performance` is high enough.
+     * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + public com.google.monitoring.v3.WindowsBasedSli.PerformanceThresholdOrBuilder + getGoodTotalRatioThresholdOrBuilder() { + if ((windowCriterionCase_ == 2) && (goodTotalRatioThresholdBuilder_ != null)) { + return goodTotalRatioThresholdBuilder_.getMessageOrBuilder(); + } else { + if (windowCriterionCase_ == 2) { + return (com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.getDefaultInstance(); + } + } + /** + * + * + *
+     * A window is good if its `performance` is high enough.
+     * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold, + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.Builder, + com.google.monitoring.v3.WindowsBasedSli.PerformanceThresholdOrBuilder> + getGoodTotalRatioThresholdFieldBuilder() { + if (goodTotalRatioThresholdBuilder_ == null) { + if (!(windowCriterionCase_ == 2)) { + windowCriterion_ = + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.getDefaultInstance(); + } + goodTotalRatioThresholdBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold, + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.Builder, + com.google.monitoring.v3.WindowsBasedSli.PerformanceThresholdOrBuilder>( + (com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) windowCriterion_, + getParentForChildren(), + isClean()); + windowCriterion_ = null; + } + windowCriterionCase_ = 2; + onChanged(); + ; + return goodTotalRatioThresholdBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli.MetricRange, + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder, + com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder> + metricMeanInRangeBuilder_; + /** + * + * + *
+     * A window is good if the metric's value is in a good range, averaged
+     * across returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + public boolean hasMetricMeanInRange() { + return windowCriterionCase_ == 6; + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, averaged
+     * across returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + public com.google.monitoring.v3.WindowsBasedSli.MetricRange getMetricMeanInRange() { + if (metricMeanInRangeBuilder_ == null) { + if (windowCriterionCase_ == 6) { + return (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } else { + if (windowCriterionCase_ == 6) { + return metricMeanInRangeBuilder_.getMessage(); + } + return com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, averaged
+     * across returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + public Builder setMetricMeanInRange( + com.google.monitoring.v3.WindowsBasedSli.MetricRange value) { + if (metricMeanInRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + windowCriterion_ = value; + onChanged(); + } else { + metricMeanInRangeBuilder_.setMessage(value); + } + windowCriterionCase_ = 6; + return this; + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, averaged
+     * across returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + public Builder setMetricMeanInRange( + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder builderForValue) { + if (metricMeanInRangeBuilder_ == null) { + windowCriterion_ = builderForValue.build(); + onChanged(); + } else { + metricMeanInRangeBuilder_.setMessage(builderForValue.build()); + } + windowCriterionCase_ = 6; + return this; + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, averaged
+     * across returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + public Builder mergeMetricMeanInRange( + com.google.monitoring.v3.WindowsBasedSli.MetricRange value) { + if (metricMeanInRangeBuilder_ == null) { + if (windowCriterionCase_ == 6 + && windowCriterion_ + != com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance()) { + windowCriterion_ = + com.google.monitoring.v3.WindowsBasedSli.MetricRange.newBuilder( + (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_) + .mergeFrom(value) + .buildPartial(); + } else { + windowCriterion_ = value; + } + onChanged(); + } else { + if (windowCriterionCase_ == 6) { + metricMeanInRangeBuilder_.mergeFrom(value); + } + metricMeanInRangeBuilder_.setMessage(value); + } + windowCriterionCase_ = 6; + return this; + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, averaged
+     * across returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + public Builder clearMetricMeanInRange() { + if (metricMeanInRangeBuilder_ == null) { + if (windowCriterionCase_ == 6) { + windowCriterionCase_ = 0; + windowCriterion_ = null; + onChanged(); + } + } else { + if (windowCriterionCase_ == 6) { + windowCriterionCase_ = 0; + windowCriterion_ = null; + } + metricMeanInRangeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, averaged
+     * across returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + public com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder + getMetricMeanInRangeBuilder() { + return getMetricMeanInRangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, averaged
+     * across returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + public com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder + getMetricMeanInRangeOrBuilder() { + if ((windowCriterionCase_ == 6) && (metricMeanInRangeBuilder_ != null)) { + return metricMeanInRangeBuilder_.getMessageOrBuilder(); + } else { + if (windowCriterionCase_ == 6) { + return (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, averaged
+     * across returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli.MetricRange, + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder, + com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder> + getMetricMeanInRangeFieldBuilder() { + if (metricMeanInRangeBuilder_ == null) { + if (!(windowCriterionCase_ == 6)) { + windowCriterion_ = + com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } + metricMeanInRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli.MetricRange, + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder, + com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder>( + (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_, + getParentForChildren(), + isClean()); + windowCriterion_ = null; + } + windowCriterionCase_ = 6; + onChanged(); + ; + return metricMeanInRangeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli.MetricRange, + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder, + com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder> + metricSumInRangeBuilder_; + /** + * + * + *
+     * A window is good if the metric's value is in a good range, summed across
+     * returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + public boolean hasMetricSumInRange() { + return windowCriterionCase_ == 7; + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, summed across
+     * returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + public com.google.monitoring.v3.WindowsBasedSli.MetricRange getMetricSumInRange() { + if (metricSumInRangeBuilder_ == null) { + if (windowCriterionCase_ == 7) { + return (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } else { + if (windowCriterionCase_ == 7) { + return metricSumInRangeBuilder_.getMessage(); + } + return com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, summed across
+     * returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + public Builder setMetricSumInRange(com.google.monitoring.v3.WindowsBasedSli.MetricRange value) { + if (metricSumInRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + windowCriterion_ = value; + onChanged(); + } else { + metricSumInRangeBuilder_.setMessage(value); + } + windowCriterionCase_ = 7; + return this; + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, summed across
+     * returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + public Builder setMetricSumInRange( + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder builderForValue) { + if (metricSumInRangeBuilder_ == null) { + windowCriterion_ = builderForValue.build(); + onChanged(); + } else { + metricSumInRangeBuilder_.setMessage(builderForValue.build()); + } + windowCriterionCase_ = 7; + return this; + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, summed across
+     * returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + public Builder mergeMetricSumInRange( + com.google.monitoring.v3.WindowsBasedSli.MetricRange value) { + if (metricSumInRangeBuilder_ == null) { + if (windowCriterionCase_ == 7 + && windowCriterion_ + != com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance()) { + windowCriterion_ = + com.google.monitoring.v3.WindowsBasedSli.MetricRange.newBuilder( + (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_) + .mergeFrom(value) + .buildPartial(); + } else { + windowCriterion_ = value; + } + onChanged(); + } else { + if (windowCriterionCase_ == 7) { + metricSumInRangeBuilder_.mergeFrom(value); + } + metricSumInRangeBuilder_.setMessage(value); + } + windowCriterionCase_ = 7; + return this; + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, summed across
+     * returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + public Builder clearMetricSumInRange() { + if (metricSumInRangeBuilder_ == null) { + if (windowCriterionCase_ == 7) { + windowCriterionCase_ = 0; + windowCriterion_ = null; + onChanged(); + } + } else { + if (windowCriterionCase_ == 7) { + windowCriterionCase_ = 0; + windowCriterion_ = null; + } + metricSumInRangeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, summed across
+     * returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + public com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder + getMetricSumInRangeBuilder() { + return getMetricSumInRangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, summed across
+     * returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + public com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder + getMetricSumInRangeOrBuilder() { + if ((windowCriterionCase_ == 7) && (metricSumInRangeBuilder_ != null)) { + return metricSumInRangeBuilder_.getMessageOrBuilder(); + } else { + if (windowCriterionCase_ == 7) { + return (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_; + } + return com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } + } + /** + * + * + *
+     * A window is good if the metric's value is in a good range, summed across
+     * returned streams.
+     * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli.MetricRange, + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder, + com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder> + getMetricSumInRangeFieldBuilder() { + if (metricSumInRangeBuilder_ == null) { + if (!(windowCriterionCase_ == 7)) { + windowCriterion_ = + com.google.monitoring.v3.WindowsBasedSli.MetricRange.getDefaultInstance(); + } + metricSumInRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.v3.WindowsBasedSli.MetricRange, + com.google.monitoring.v3.WindowsBasedSli.MetricRange.Builder, + com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder>( + (com.google.monitoring.v3.WindowsBasedSli.MetricRange) windowCriterion_, + getParentForChildren(), + isClean()); + windowCriterion_ = null; + } + windowCriterionCase_ = 7; + onChanged(); + ; + return metricSumInRangeBuilder_; + } + + private com.google.protobuf.Duration windowPeriod_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + windowPeriodBuilder_; + /** + * + * + *
+     * Duration over which window quality is evaluated. Must be an integer
+     * fraction of a day and at least `60s`.
+     * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + public boolean hasWindowPeriod() { + return windowPeriodBuilder_ != null || windowPeriod_ != null; + } + /** + * + * + *
+     * Duration over which window quality is evaluated. Must be an integer
+     * fraction of a day and at least `60s`.
+     * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + public com.google.protobuf.Duration getWindowPeriod() { + if (windowPeriodBuilder_ == null) { + return windowPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : windowPeriod_; + } else { + return windowPeriodBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Duration over which window quality is evaluated. Must be an integer
+     * fraction of a day and at least `60s`.
+     * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + public Builder setWindowPeriod(com.google.protobuf.Duration value) { + if (windowPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + windowPeriod_ = value; + onChanged(); + } else { + windowPeriodBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Duration over which window quality is evaluated. Must be an integer
+     * fraction of a day and at least `60s`.
+     * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + public Builder setWindowPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (windowPeriodBuilder_ == null) { + windowPeriod_ = builderForValue.build(); + onChanged(); + } else { + windowPeriodBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Duration over which window quality is evaluated. Must be an integer
+     * fraction of a day and at least `60s`.
+     * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + public Builder mergeWindowPeriod(com.google.protobuf.Duration value) { + if (windowPeriodBuilder_ == null) { + if (windowPeriod_ != null) { + windowPeriod_ = + com.google.protobuf.Duration.newBuilder(windowPeriod_) + .mergeFrom(value) + .buildPartial(); + } else { + windowPeriod_ = value; + } + onChanged(); + } else { + windowPeriodBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Duration over which window quality is evaluated. Must be an integer
+     * fraction of a day and at least `60s`.
+     * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + public Builder clearWindowPeriod() { + if (windowPeriodBuilder_ == null) { + windowPeriod_ = null; + onChanged(); + } else { + windowPeriod_ = null; + windowPeriodBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Duration over which window quality is evaluated. Must be an integer
+     * fraction of a day and at least `60s`.
+     * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + public com.google.protobuf.Duration.Builder getWindowPeriodBuilder() { + + onChanged(); + return getWindowPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Duration over which window quality is evaluated. Must be an integer
+     * fraction of a day and at least `60s`.
+     * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + public com.google.protobuf.DurationOrBuilder getWindowPeriodOrBuilder() { + if (windowPeriodBuilder_ != null) { + return windowPeriodBuilder_.getMessageOrBuilder(); + } else { + return windowPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : windowPeriod_; + } + } + /** + * + * + *
+     * Duration over which window quality is evaluated. Must be an integer
+     * fraction of a day and at least `60s`.
+     * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getWindowPeriodFieldBuilder() { + if (windowPeriodBuilder_ == null) { + windowPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getWindowPeriod(), getParentForChildren(), isClean()); + windowPeriod_ = null; + } + return windowPeriodBuilder_; + } + + @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.WindowsBasedSli) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.WindowsBasedSli) + private static final com.google.monitoring.v3.WindowsBasedSli DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.WindowsBasedSli(); + } + + public static com.google.monitoring.v3.WindowsBasedSli getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WindowsBasedSli parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WindowsBasedSli(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.WindowsBasedSli getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/WindowsBasedSliOrBuilder.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/WindowsBasedSliOrBuilder.java new file mode 100644 index 00000000..e7b27710 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/WindowsBasedSliOrBuilder.java @@ -0,0 +1,192 @@ +/* + * Copyright 2019 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/service.proto + +package com.google.monitoring.v3; + +public interface WindowsBasedSliOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.WindowsBasedSli) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if
+   * any `true` values appear in the window.
+   * 
+ * + * string good_bad_metric_filter = 5; + */ + java.lang.String getGoodBadMetricFilter(); + /** + * + * + *
+   * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
+   * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if
+   * any `true` values appear in the window.
+   * 
+ * + * string good_bad_metric_filter = 5; + */ + com.google.protobuf.ByteString getGoodBadMetricFilterBytes(); + + /** + * + * + *
+   * A window is good if its `performance` is high enough.
+   * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + boolean hasGoodTotalRatioThreshold(); + /** + * + * + *
+   * A window is good if its `performance` is high enough.
+   * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + com.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold getGoodTotalRatioThreshold(); + /** + * + * + *
+   * A window is good if its `performance` is high enough.
+   * 
+ * + * + * .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * + */ + com.google.monitoring.v3.WindowsBasedSli.PerformanceThresholdOrBuilder + getGoodTotalRatioThresholdOrBuilder(); + + /** + * + * + *
+   * A window is good if the metric's value is in a good range, averaged
+   * across returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + boolean hasMetricMeanInRange(); + /** + * + * + *
+   * A window is good if the metric's value is in a good range, averaged
+   * across returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + com.google.monitoring.v3.WindowsBasedSli.MetricRange getMetricMeanInRange(); + /** + * + * + *
+   * A window is good if the metric's value is in a good range, averaged
+   * across returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + */ + com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder getMetricMeanInRangeOrBuilder(); + + /** + * + * + *
+   * A window is good if the metric's value is in a good range, summed across
+   * returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + boolean hasMetricSumInRange(); + /** + * + * + *
+   * A window is good if the metric's value is in a good range, summed across
+   * returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + com.google.monitoring.v3.WindowsBasedSli.MetricRange getMetricSumInRange(); + /** + * + * + *
+   * A window is good if the metric's value is in a good range, summed across
+   * returned streams.
+   * 
+ * + * .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + */ + com.google.monitoring.v3.WindowsBasedSli.MetricRangeOrBuilder getMetricSumInRangeOrBuilder(); + + /** + * + * + *
+   * Duration over which window quality is evaluated. Must be an integer
+   * fraction of a day and at least `60s`.
+   * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + boolean hasWindowPeriod(); + /** + * + * + *
+   * Duration over which window quality is evaluated. Must be an integer
+   * fraction of a day and at least `60s`.
+   * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + com.google.protobuf.Duration getWindowPeriod(); + /** + * + * + *
+   * Duration over which window quality is evaluated. Must be an integer
+   * fraction of a day and at least `60s`.
+   * 
+ * + * .google.protobuf.Duration window_period = 4; + */ + com.google.protobuf.DurationOrBuilder getWindowPeriodOrBuilder(); + + public com.google.monitoring.v3.WindowsBasedSli.WindowCriterionCase getWindowCriterionCase(); +} diff --git a/proto-google-cloud-monitoring-v3/src/main/java/google/monitoring/v3/DroppedLabelsOuterClass.java b/proto-google-cloud-monitoring-v3/src/main/java/google/monitoring/v3/DroppedLabelsOuterClass.java index dbb35725..319dbc00 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/google/monitoring/v3/DroppedLabelsOuterClass.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/google/monitoring/v3/DroppedLabelsOuterClass.java @@ -1,3 +1,19 @@ +/* + * Copyright 2019 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. + */ + /* * Copyright 2019 Google LLC * 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 0f61bddf..a4ea225d 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 @@ -76,7 +76,7 @@ message AlertPolicy { // identifies which time series should be compared with the threshold. // // The filter is similar to the one that is specified in the - // [`MetricService.ListTimeSeries` + // [`ListTimeSeries` // request](/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 @@ -91,8 +91,7 @@ message AlertPolicy { // members of a group of resrouces). Multiple aggregations // are applied in the order specified. // - // This field is similar to the one in the - // [`MetricService.ListTimeSeries` + // This field is similar to the one in the [`ListTimeSeries` // request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It // is advisable to use the `ListTimeSeries` method when debugging this // field. @@ -163,7 +162,7 @@ message AlertPolicy { // identifies which time series should be compared with the threshold. // // The filter is similar to the one that is specified in the - // [`MetricService.ListTimeSeries` + // [`ListTimeSeries` // request](/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 @@ -178,8 +177,7 @@ message AlertPolicy { // members of a group of resrouces). Multiple aggregations // are applied in the order specified. // - // This field is similar to the - // one in the [`MetricService.ListTimeSeries` + // This field is similar to the one in the [`ListTimeSeries` // request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It // is advisable to use the `ListTimeSeries` method when debugging this // field. 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 016ecf7b..9b943ccd 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 @@ -19,10 +19,10 @@ package google.monitoring.v3; option csharp_namespace = "Google.Cloud.Monitoring.V3"; option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring"; -option php_namespace = "Google\\Cloud\\Monitoring\\V3"; option java_multiple_files = true; option java_outer_classname = "DroppedLabelsProto"; option java_package = "com.google.monitoring.v3"; +option php_namespace = "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 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 4c5c0a84..3c202ed4 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 @@ -33,14 +33,14 @@ option php_namespace = "Google\\Cloud\\Monitoring\\V3"; // A single data point in a time series. message Point { // The time interval to which the data point applies. For `GAUGE` metrics, - // the start time is optional, but if it is supplied, it must equal the end - // time. For `DELTA` metrics, the start and end time should specify a - // non-zero interval, with subsequent points specifying contiguous and - // non-overlapping intervals. For `CUMULATIVE` metrics, the start and end - // time should specify 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 start time is optional, but if it is supplied, it must equal the + // end time. For `DELTA` metrics, the start + // and end time should specify a non-zero interval, with subsequent points + // specifying contiguous and non-overlapping intervals. For `CUMULATIVE` + // metrics, the start and end time should specify 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. TimeInterval interval = 1; // The value of the data point. 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 3dc20be9..101dee40 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 @@ -252,13 +252,15 @@ message ListTimeSeriesRequest { // in the response. TimeInterval interval = 4; - // By default, the raw time series data is returned. - // Use this field to combine multiple time series for different - // views of the data. + // Specifies the alignment of data points in individual time series as + // well as how to combine the retrieved time series across specified labels. + // + // By default (if no `aggregation` is explicitly specified), the raw time + // series data is returned. Aggregation aggregation = 5; // Unsupported: must be left blank. The points in each time series are - // returned in reverse time order. + // currently returned in reverse time order (most recent to oldest). string order_by = 6; // Specifies which information is returned about the time series. @@ -308,14 +310,32 @@ message CreateTimeSeriesRequest { repeated TimeSeries time_series = 2; } -// Describes the result of a failed request to write data to a time series. +// DEPRECATED. Used to hold per-time-series error status. message CreateTimeSeriesError { - // The time series, including the `Metric`, `MonitoredResource`, - // and `Point`s (including timestamp and value) that resulted - // in the error. This field provides all of the context that - // would be needed to retry the operation. - TimeSeries time_series = 1; - - // The status of the requested write operation. - google.rpc.Status status = 2; + // DEPRECATED. Time series ID that resulted in the `status` error. + TimeSeries time_series = 1 [deprecated = true]; + + // DEPRECATED. The status of the requested write operation for `time_series`. + google.rpc.Status status = 2 [deprecated = true]; +} + +// Summary of the result of a failed request to write data to a time series. +message CreateTimeSeriesSummary { + // Detailed information about an error category. + message Error { + // The status of the requested write operation. + google.rpc.Status status = 1; + + // The number of points that couldn't be written because of `status`. + int32 point_count = 2; + } + + // The number of points in the request. + int32 total_point_count = 1; + + // The number of points that were successfully written. + int32 success_point_count = 2; + + // The number of points that failed to be written. Order is not guaranteed. + repeated Error errors = 3; } 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 4ee97b8f..939ca267 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 @@ -18,6 +18,7 @@ syntax = "proto3"; package google.monitoring.v3; import "google/api/label.proto"; +import "google/api/launch_stage.proto"; import "google/monitoring/v3/common.proto"; import "google/protobuf/wrappers.proto"; 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 new file mode 100644 index 00000000..7de20331 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service.proto @@ -0,0 +1,379 @@ +// Copyright 2019 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/monitored_resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/calendar_period.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 = "ServiceMonitoringProto"; +option java_package = "com.google.monitoring.v3"; +option php_namespace = "Google\\Cloud\\Monitoring\\V3"; + +// A `Service` is a discrete, autonomous, and network-accessible unit, designed +// to solve an individual concern +// ([Wikipedia](https://en.wikipedia.org/wiki/Service-orientation)). In +// Stackdriver Monitoring, a `Service` acts as the root resource under which +// operational aspects of the service are accessible. +message Service { + // Custom view of service telemetry. Currently a place-holder pending final + // design. + message Custom { + + } + + // App Engine service. Learn more at https://cloud.google.com/appengine. + message AppEngine { + // The ID of the App Engine module underlying this service. Corresponds to + // the `module_id` resource label in the `gae_app` monitored resource: + // https://cloud.google.com/monitoring/api/resources#tag_gae_app + string module_id = 1; + } + + // Cloud Endpoints service. Learn more at https://cloud.google.com/endpoints. + message CloudEndpoints { + // The name of the Cloud Endpoints service underlying this service. + // Corresponds to the `service` resource label in the `api` monitored + // resource: https://cloud.google.com/monitoring/api/resources#tag_api + string service = 1; + } + + // Istio service. Learn more at http://istio.io. + message ClusterIstio { + // The location of the Kubernetes cluster in which this Istio service is + // defined. Corresponds to the `location` resource label in `k8s_cluster` + // resources. + string location = 1; + + // The name of the Kubernetes cluster in which this Istio service is + // defined. Corresponds to the `cluster_name` resource label in + // `k8s_cluster` resources. + string cluster_name = 2; + + // The namespace of the Istio service underlying this service. Corresponds + // to the `destination_service_namespace` metric label in Istio metrics. + string service_namespace = 3; + + // The name of the Istio service underlying this service. Corresponds to the + // `destination_service_name` metric label in Istio metrics. + string service_name = 4; + } + + // Configuration for how to query telemetry on a Service. + message Telemetry { + // 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; + } + + // Resource name for this Service. Of the form + // `projects/{project_id}/services/{service_id}`. + string name = 1; + + // Name used for UI elements listing this Service. + string display_name = 2; + + // REQUIRED. Service-identifying atoms specifying the underlying service. + oneof identifier { + // Custom service type. + Custom custom = 6; + + // Type used for App Engine services. + AppEngine app_engine = 7; + + // Type used for Cloud Endpoints services. + CloudEndpoints cloud_endpoints = 8; + + // Type used for Istio services that live in a Kubernetes cluster. + ClusterIstio cluster_istio = 9; + } + + // Configuration for how to query telemetry on a Service. + Telemetry telemetry = 13; +} + +// A Service-Level Objective (SLO) describes a level of desired good service. It +// consists of a service-level indicator (SLI), a performance goal, and a period +// over which the objective is to be evaluated against that goal. The SLO can +// use SLIs defined in a number of different manners. Typical SLOs might include +// "99% of requests in each rolling week have latency below 200 milliseconds" or +// "99.5% of requests in each calendar month return successfully." +message ServiceLevelObjective { + // `ServiceLevelObjective.View` determines what form of + // `ServiceLevelObjective` is returned from `GetServiceLevelObjective`, + // `ListServiceLevelObjectives`, and `ListServiceLevelObjectiveVersions` RPCs. + enum View { + // Same as FULL. + VIEW_UNSPECIFIED = 0; + + // Return the embedded `ServiceLevelIndicator` in the form in which it was + // defined. If it was defined using a `BasicSli`, return that `BasicSli`. + FULL = 2; + + // For `ServiceLevelIndicator`s using `BasicSli` articulation, instead + // return the `ServiceLevelIndicator` with its mode of computation fully + // spelled out as a `RequestBasedSli`. For `ServiceLevelIndicator`s using + // `RequestBasedSli` or `WindowsBasedSli`, return the + // `ServiceLevelIndicator` as it was provided. + EXPLICIT = 1; + } + + // Resource name for this `ServiceLevelObjective`. + // Of the form + // `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + string name = 1; + + // Name used for UI elements listing this SLO. + string display_name = 11; + + // The definition of good service, used to measure and calculate the quality + // of the `Service`'s performance with respect to a single aspect of service + // quality. + ServiceLevelIndicator service_level_indicator = 3; + + // The fraction of service that must be good in order for this objective to be + // met. `0 < goal <= 1`. + double goal = 4; + + // The time period over which the objective will be evaluated. + oneof period { + // A rolling time period, semantically "in the past ``". + // Must be an integer multiple of 1 day no larger than 30 days. + google.protobuf.Duration rolling_period = 5; + + // A calendar period, semantically "since the start of the current + // ``". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and + // `MONTH` are supported. + google.type.CalendarPeriod calendar_period = 6; + } +} + +// A Service-Level Indicator (SLI) describes the "performance" of a service. For +// some services, the SLI is well-defined. In such cases, the SLI can be +// described easily by referencing the well-known SLI and providing the needed +// parameters. Alternatively, a "custom" SLI can be defined with a query to the +// underlying metric store. An SLI is defined to be `good_service / +// total_service` over any queried time interval. The value of performance +// always falls into the range `0 <= performance <= 1`. A custom SLI describes +// how to compute this ratio, whether this is by dividing values from a pair of +// time series, cutting a `Distribution` into good and bad counts, or counting +// time windows in which the service complies with a criterion. For separation +// of concerns, a single Service-Level Indicator measures performance for only +// one aspect of service quality, such as fraction of successful queries or +// fast-enough queries. +message ServiceLevelIndicator { + // Service level indicators can be grouped by whether the "unit" of service + // being measured is based on counts of good requests or on counts of good + // time windows + oneof type { + // Basic SLI on a well-known service type. + BasicSli basic_sli = 4; + + // Request-based SLIs + RequestBasedSli request_based = 1; + + // Windows-based SLIs + WindowsBasedSli windows_based = 2; + } +} + +// An SLI measuring performance on a well-known service type. Performance will +// be computed on the basis of pre-defined metrics. The type of the +// `service_resource` determines the metrics to use and the +// `service_resource.labels` and `metric_labels` are used to construct a +// monitoring filter to filter that metric down to just the data relevant to +// this service. +message BasicSli { + // Future parameters for the availability SLI. + message AvailabilityCriteria { + + } + + // Parameters for a latency threshold SLI. + message LatencyCriteria { + // Good service is defined to be the count of requests made to this service + // that return in no more than `threshold`. + google.protobuf.Duration threshold = 3; + } + + // OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from + // other methods will not be used to calculate performance for this SLI. If + // omitted, this SLI applies to all the Service's methods. For service types + // that don't support breaking down by method, setting this field will result + // in an error. + repeated string method = 7; + + // OPTIONAL: The set of locations to which this SLI is relevant. Telemetry + // from other locations will not be used to calculate performance for this + // SLI. If omitted, this SLI applies to all locations in which the Service has + // activity. For service types that don't support breaking down by location, + // setting this field will result in an error. + repeated string location = 8; + + // OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry + // from other API versions will not be used to calculate performance for this + // SLI. If omitted, this SLI applies to all API versions. For service types + // that don't support breaking down by version, setting this field will result + // in an error. + repeated string version = 9; + + // This SLI can be evaluated on the basis of availability or latency. + oneof sli_criteria { + // Good service is defined to be the count of requests made to this service + // that return successfully. + AvailabilityCriteria availability = 2; + + // Good service is defined to be the count of requests made to this service + // that are fast enough with respect to `latency.threshold`. + LatencyCriteria latency = 3; + } +} + +// Range of numerical values, inclusive of `min` and exclusive of `max`. If the +// open range "< range.max" is desired, set `range.min = -infinity`. If the open +// range ">= range.min" is desired, set `range.max = infinity`. +message Range { + // Range minimum. + double min = 1; + + // Range maximum. + double max = 2; +} + +// Service Level Indicators for which atomic units of service are counted +// directly. +message RequestBasedSli { + // The means to compute a ratio of `good_service` to `total_service`. + oneof method { + // `good_total_ratio` is used when the ratio of `good_service` to + // `total_service` is computed from two `TimeSeries`. + TimeSeriesRatio good_total_ratio = 1; + + // `distribution_cut` is used when `good_service` is a count of values + // aggregated in a `Distribution` that fall into a good range. The + // `total_service` is the total count of all values aggregated in the + // `Distribution`. + DistributionCut distribution_cut = 3; + } +} + +// A `TimeSeriesRatio` specifies two `TimeSeries` to use for computing the +// `good_service / total_service` ratio. The specified `TimeSeries` must have +// `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = +// DELTA` or `MetricKind = CUMULATIVE`. The `TimeSeriesRatio` must specify +// exactly two of good, bad, and total, and the relationship `good_service + +// bad_service = total_service` will be assumed. +message TimeSeriesRatio { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` quantifying good service provided. Must have + // `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + // DELTA` or `MetricKind = CUMULATIVE`. + string good_service_filter = 4; + + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` quantifying bad service, either demanded service + // that was not provided or demanded service that was of inadequate quality. + // Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have + // `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + string bad_service_filter = 5; + + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` quantifying total demanded service. Must have + // `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + // DELTA` or `MetricKind = CUMULATIVE`. + string total_service_filter = 6; +} + +// A `DistributionCut` defines a `TimeSeries` and thresholds used for measuring +// good service and total service. The `TimeSeries` must have `ValueType = +// DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. The +// computed `good_service` will be the count of values x in the `Distribution` +// such that `range.min <= x < range.max`. +message DistributionCut { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` aggregating values. Must have `ValueType = + // DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + string distribution_filter = 4; + + // Range of values considered "good." For a one-sided range, set one bound to + // an infinite value. + Range range = 5; +} + +// A `WindowsBasedSli` defines `good_service` as the count of time windows for +// which the provided service was of good quality. Criteria for determining +// if service was good are embedded in the `window_criterion`. +message WindowsBasedSli { + // A `PerformanceThreshold` is used when each window is good when that window + // has a sufficiently high `performance`. + message PerformanceThreshold { + // The means, either a request-based SLI or a basic SLI, by which to compute + // performance over a window. + oneof type { + // `RequestBasedSli` to evaluate to judge window quality. + RequestBasedSli performance = 1; + + // `BasicSli` to evaluate to judge window quality. + BasicSli basic_sli_performance = 3; + } + + // If window `performance >= threshold`, the window is counted as good. + double threshold = 2; + } + + // A `MetricRange` is used when each window is good when the value x of a + // single `TimeSeries` satisfies `range.min <= x < range.max`. The provided + // `TimeSeries` must have `ValueType = INT64` or `ValueType = DOUBLE` and + // `MetricKind = GAUGE`. + message MetricRange { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying the `TimeSeries` to use for evaluating window quality. + string time_series = 1; + + // Range of values considered "good." For a one-sided range, set one bound + // to an infinite value. + Range range = 4; + } + + // The criterion to use for evaluating window goodness. + oneof window_criterion { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if + // any `true` values appear in the window. + string good_bad_metric_filter = 5; + + // A window is good if its `performance` is high enough. + PerformanceThreshold good_total_ratio_threshold = 2; + + // A window is good if the metric's value is in a good range, averaged + // across returned streams. + MetricRange metric_mean_in_range = 6; + + // A window is good if the metric's value is in a good range, summed across + // returned streams. + MetricRange metric_sum_in_range = 7; + } + + // Duration over which window quality is evaluated. Must be an integer + // fraction of a day and at least `60s`. + google.protobuf.Duration window_period = 4; +} 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 new file mode 100644 index 00000000..e0a35833 --- /dev/null +++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/service_service.proto @@ -0,0 +1,285 @@ +// Copyright 2019 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/monitored_resource.proto"; +import "google/monitoring/v3/service.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.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 = "ServiceMonitoringServiceProto"; +option java_package = "com.google.monitoring.v3"; +option php_namespace = "Google\\Cloud\\Monitoring\\V3"; + +// The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for +// managing and querying aspects of a workspace's services. These include the +// `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy +// of categorized Health Metrics. +service ServiceMonitoringService { + 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"; + + // Create a `Service`. + rpc CreateService(CreateServiceRequest) returns (Service) { + option (google.api.http) = { + post: "/v3/{parent=*/*}/services" + body: "service" + }; + } + + // Get the named `Service`. + rpc GetService(GetServiceRequest) returns (Service) { + option (google.api.http) = { + get: "/v3/{name=*/*/services/*}" + }; + } + + // List `Service`s for this workspace. + rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { + option (google.api.http) = { + get: "/v3/{parent=*/*}/services" + }; + } + + // Update this `Service`. + rpc UpdateService(UpdateServiceRequest) returns (Service) { + option (google.api.http) = { + patch: "/v3/{service.name=*/*/services/*}" + body: "service" + }; + } + + // Soft delete this `Service`. + rpc DeleteService(DeleteServiceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=*/*/services/*}" + }; + } + + // Create a `ServiceLevelObjective` for the given `Service`. + rpc CreateServiceLevelObjective(CreateServiceLevelObjectiveRequest) returns (ServiceLevelObjective) { + option (google.api.http) = { + post: "/v3/{parent=*/*/services/*}/serviceLevelObjectives" + body: "service_level_objective" + }; + } + + // Get a `ServiceLevelObjective` by name. + rpc GetServiceLevelObjective(GetServiceLevelObjectiveRequest) returns (ServiceLevelObjective) { + option (google.api.http) = { + get: "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + }; + } + + // List the `ServiceLevelObjective`s for the given `Service`. + rpc ListServiceLevelObjectives(ListServiceLevelObjectivesRequest) returns (ListServiceLevelObjectivesResponse) { + option (google.api.http) = { + get: "/v3/{parent=*/*/services/*}/serviceLevelObjectives" + }; + } + + // Update the given `ServiceLevelObjective`. + rpc UpdateServiceLevelObjective(UpdateServiceLevelObjectiveRequest) returns (ServiceLevelObjective) { + option (google.api.http) = { + patch: "/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}" + body: "service_level_objective" + }; + } + + // Delete the given `ServiceLevelObjective`. + rpc DeleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + }; + } +} + +// The `CreateService` request. +message CreateServiceRequest { + // Resource name of the parent workspace. + // Of the form `projects/{project_id}`. + string parent = 1; + + // Optional. The Service id to use for this Service. If omitted, an id will be + // generated instead. Must match the pattern [a-z0-9\-]+ + string service_id = 3; + + // The `Service` to create. + Service service = 2; +} + +// The `GetService` request. +message GetServiceRequest { + // Resource name of the `Service`. + // Of the form `projects/{project_id}/services/{service_id}`. + string name = 1; +} + +// The `ListServices` request. +message ListServicesRequest { + // Resource name of the parent `Workspace`. + // Of the form `projects/{project_id}`. + string parent = 1; + + // A filter specifying what `Service`s to return. The filter currently + // 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` + // + // `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". + string filter = 2; + + // A non-negative number that is the maximum number of results to return. + // When 0, use default page size. + int32 page_size = 3; + + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + string page_token = 4; +} + +// The `ListServices` response. +message ListServicesResponse { + // The `Service`s matching the specified filter. + repeated Service services = 1; + + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `pageToken` in the next call to this method. + string next_page_token = 2; +} + +// The `UpdateService` request. +message UpdateServiceRequest { + // The `Service` to draw updates from. + // The given `name` specifies the resource to update. + Service service = 1; + + // A set of field paths defining which fields to use for the update. + google.protobuf.FieldMask update_mask = 2; +} + +// The `DeleteService` request. +message DeleteServiceRequest { + // Resource name of the `Service` to delete. + // Of the form `projects/{project_id}/service/{service_id}`. + string name = 1; +} + +// The `CreateServiceLevelObjective` request. +message CreateServiceLevelObjectiveRequest { + // Resource name of the parent `Service`. + // Of the form `projects/{project_id}/services/{service_id}`. + string parent = 1; + + // Optional. The ServiceLevelObjective id to use for this + // ServiceLevelObjective. If omitted, an id will be generated instead. Must + // match the pattern [a-z0-9\-]+ + string service_level_objective_id = 3; + + // The `ServiceLevelObjective` to create. + // The provided `name` will be respected if no `ServiceLevelObjective` exists + // with this name. + ServiceLevelObjective service_level_objective = 2; +} + +// The `GetServiceLevelObjective` request. +message GetServiceLevelObjectiveRequest { + // Resource name of the `ServiceLevelObjective` to get. + // Of the form + // `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + string name = 1; + + // View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + ServiceLevelObjective.View view = 2; +} + +// The `ListServiceLevelObjectives` request. +message ListServiceLevelObjectivesRequest { + // Resource name of the parent `Service`. + // Of the form `projects/{project_id}/services/{service_id}`. + string parent = 1; + + // A filter specifying what `ServiceLevelObjective`s to return. + string filter = 2; + + // A non-negative number that is the maximum number of results to return. + // When 0, use default page size. + int32 page_size = 3; + + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + string page_token = 4; + + // View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + ServiceLevelObjective.View view = 5; +} + +// The `ListServiceLevelObjectives` response. +message ListServiceLevelObjectivesResponse { + // The `ServiceLevelObjective`s matching the specified filter. + repeated ServiceLevelObjective service_level_objectives = 1; + + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `pageToken` in the next call to this method. + string next_page_token = 2; +} + +// The `UpdateServiceLevelObjective` request. +message UpdateServiceLevelObjectiveRequest { + // The `ServiceLevelObjective` to draw updates from. + // The given `name` specifies the resource to update. + ServiceLevelObjective service_level_objective = 1; + + // A set of field paths defining which fields to use for the update. + google.protobuf.FieldMask update_mask = 2; +} + +// The `DeleteServiceLevelObjective` request. +message DeleteServiceLevelObjectiveRequest { + // Resource name of the `ServiceLevelObjective` to delete. + // Of the form + // `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + string name = 1; +} 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 2601f531..eb424e97 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 @@ -27,27 +27,6 @@ option java_outer_classname = "UptimeProto"; option java_package = "com.google.monitoring.v3"; option php_namespace = "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 { @@ -104,21 +83,25 @@ message InternalChecker { State state = 7; } -// The supported resource types that can be used as values of -// `group_resource.resource_type`. -// `INSTANCE` includes `gce_instance` and `aws_ec2_instance` resource types. -// The resource types `gae_app` and `uptime_url` are not valid here because -// group checks on App Engine modules and URLs are not allowed. -enum GroupResourceType { - // Default value (not valid). - RESOURCE_TYPE_UNSPECIFIED = 0; +// 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; - // A group of instances from Google Cloud Platform (GCP) or - // Amazon Web Services (AWS). - INSTANCE = 1; + // Allows checks to run from locations within the United States of America. + USA = 1; - // A group of Amazon ELB load balancers. - AWS_ELB_LOAD_BALANCER = 2; + // 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 @@ -202,8 +185,11 @@ message UptimeCheckConfig { int32 port = 1; } - // Used to perform string matching. It allows substring and regular - // expressions, together with their negations. + // Optional. Used to perform content matching. This allows matching based on + // substrings and regular expressions, together with their negations. Only the + // first 4 MB of an HTTP or HTTPS check's response (and the first + // 1 MB of a TCP check's response) are examined for purposes of content + // matching. message ContentMatcher { // Options to perform content matching. enum ContentMatcherOption { @@ -212,27 +198,28 @@ message UptimeCheckConfig { // Treated as `CONTAINS_STRING`. CONTENT_MATCHER_OPTION_UNSPECIFIED = 0; - // Selects substring matching (there is a match if the output contains - // the `content` string). This is the default value for checks without + // Selects substring matching. The match succeeds if the output contains + // the `content` string. This is the default value for checks without // a `matcher` option, or where the value of `matcher` is // `CONTENT_MATCHER_OPTION_UNSPECIFIED`. CONTAINS_STRING = 1; - // Selects negation of substring matching (there is a match if the output - // does NOT contain the `content` string). + // Selects negation of substring matching. The match succeeds if the + // output does _NOT_ contain the `content` string. NOT_CONTAINS_STRING = 2; - // Selects regular expression matching (there is a match of the output - // matches the regular expression specified in the `content` string). + // Selects regular-expression matching. The match succeeds of the output + // matches the regular expression specified in the `content` string. MATCHES_REGEX = 3; - // Selects negation of regular expression matching (there is a match if - // the output does NOT match the regular expression specified in the - // `content` string). + // Selects negation of regular-expression matching. The match succeeds if + // the output does _NOT_ match the regular expression specified in the + // `content` string. NOT_MATCHES_REGEX = 4; } - // String or regex content to match (max 1024 bytes) + // String or regex content to match. Maximum 1024 bytes. An empty `content` + // string indicates no content matching is to be performed. string content = 1; // The type of content matcher that will be applied to the server output, @@ -335,3 +322,20 @@ message UptimeCheckIp { // interpreting this field in either IPv4 or IPv6 format. string ip_address = 3; } + +// The supported resource types that can be used as values of +// `group_resource.resource_type`. +// `INSTANCE` includes `gce_instance` and `aws_ec2_instance` resource types. +// The resource types `gae_app` and `uptime_url` are not valid here because +// group checks on App Engine modules and URLs are not allowed. +enum GroupResourceType { + // Default value (not valid). + RESOURCE_TYPE_UNSPECIFIED = 0; + + // A group of instances from Google Cloud Platform (GCP) or + // Amazon Web Services (AWS). + INSTANCE = 1; + + // A group of Amazon ELB load balancers. + AWS_ELB_LOAD_BALANCER = 2; +} diff --git a/synth.metadata b/synth.metadata index f6c99589..d8a2655a 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,19 +1,26 @@ { - "updateTime": "2019-10-23T07:44:07.189828Z", + "updateTime": "2019-11-15T19:11:22.170983Z", "sources": [ { "generator": { "name": "artman", - "version": "0.40.2", - "dockerImage": "googleapis/artman@sha256:3b8f7d9b4c206843ce08053474f5c64ae4d388ff7d995e68b59fb65edf73eeb9" + "version": "0.41.1", + "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0d0dc5172f16c9815a5eda6e99408fb96282f608", - "internalRef": "276178557" + "sha": "45749a04dac104e986f6cc47da3baf7c8bb6f9b0", + "internalRef": "280685438" + } + }, + { + "template": { + "name": "java_library", + "origin": "synthtool.gcp", + "version": "2019.10.17" } } ], diff --git a/synth.py b/synth.py index 543a5359..87d9c399 100644 --- a/synth.py +++ b/synth.py @@ -25,26 +25,16 @@ config_pattern = '/google/monitoring/artman_monitoring.yaml' for version in versions: - library = gapic.java_library( - service=service, - version=version, - config_path=config_pattern.format(version=version), - artman_output_name='') - - package_name = f'com.google.cloud.{service}.{version}' - java.fix_proto_headers(library / f'proto-google-cloud-{service}-{version}') - java.fix_grpc_headers(library / f'grpc-google-cloud-{service}-{version}', package_name) - - s.copy(library / f'gapic-google-cloud-{service}-{version}/src', f'google-cloud-{service}/src') - s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'grpc-google-cloud-{service}-{version}/src') - s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'proto-google-cloud-{service}-{version}/src') - - java.format_code(f'google-cloud-{service}/src') - java.format_code(f'grpc-google-cloud-{service}-{version}/src') - java.format_code(f'proto-google-cloud-{service}-{version}/src') + java.gapic_library( + service=service, + version=version, + config_pattern=config_pattern, + package_pattern='com.google.{service}.{version}', + gapic=gapic + ) common_templates = gcp.CommonTemplates() templates = common_templates.java_library() s.copy(templates, excludes=[ - 'README.md', + 'README.md', ]) \ No newline at end of file