# Class ServiceMonitoringServiceClient (3.94.0)

3.94.0 (latest) 3.92.0 3.89.0 3.88.0 3.86.0 3.84.0 3.83.0 3.81.0 3.79.0 3.77.0 3.76.0 3.75.0 3.74.0 3.73.0 3.71.0 3.69.0 3.68.0 3.65.0 3.64.0 3.63.0 3.61.0 3.60.0 3.59.0 3.58.0 3.57.0 3.56.0 3.55.0 3.54.0 3.53.0 3.52.0 3.50.0 3.49.0 3.48.0 3.47.0 3.46.0 3.45.0 3.44.0 3.43.0 3.42.0 3.41.0 3.40.0 3.38.0 3.37.0 3.36.0 3.35.0 3.34.0 3.33.0 3.32.0 3.31.0 3.30.0 3.29.0 3.28.0 3.25.0 3.24.0 3.23.0 3.22.0 3.21.0 3.20.0 3.19.0 3.18.0 3.17.0 3.16.0 3.15.0 3.14.0 3.13.0 3.12.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.6 3.3.6 3.2.10

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-monitoring/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java) | [Product Reference](https://cloud.google.com/monitoring/docs) |

Service Description: The Cloud Monitoring Service-Oriented Monitoring API has endpoints for
managing and querying aspects of a Metrics Scope'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:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ResourceName parent = ResourceName.of("[FOLDER]");
       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().

| Method | Description | Method Variants |
|---|---|---|
| CreateService | Create a `Service`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createService(CreateServiceRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createService(ResourceName parent, Service service) - createService(OrganizationName parent, Service service) - createService(ProjectName parent, Service service) - createService(String parent, Service service) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createServiceCallable() |
| GetService | Get the named `Service`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getService(GetServiceRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getService(ServiceName name) - getService(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getServiceCallable() |
| ListServices | List `Service`s for this Metrics Scope. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listServices(ListServicesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listServices(ResourceName parent) - listServices(OrganizationName parent) - listServices(ProjectName parent) - listServices(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listServicesPagedCallable() - listServicesCallable() |
| UpdateService | Update this `Service`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateService(UpdateServiceRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateService(Service service) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateServiceCallable() |
| DeleteService | Soft delete this `Service`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteService(DeleteServiceRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - deleteService(ServiceName name) - deleteService(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteServiceCallable() |
| CreateServiceLevelObjective | Create a `ServiceLevelObjective` for the given `Service`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createServiceLevelObjective(CreateServiceLevelObjectiveRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createServiceLevelObjective(ServiceName parent, ServiceLevelObjective serviceLevelObjective) - createServiceLevelObjective(String parent, ServiceLevelObjective serviceLevelObjective) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createServiceLevelObjectiveCallable() |
| GetServiceLevelObjective | Get a `ServiceLevelObjective` by name. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getServiceLevelObjective(GetServiceLevelObjectiveRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getServiceLevelObjective(ServiceLevelObjectiveName name) - getServiceLevelObjective(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getServiceLevelObjectiveCallable() |
| ListServiceLevelObjectives | List the `ServiceLevelObjective`s for the given `Service`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listServiceLevelObjectives(ListServiceLevelObjectivesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listServiceLevelObjectives(ServiceName parent) - listServiceLevelObjectives(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listServiceLevelObjectivesPagedCallable() - listServiceLevelObjectivesCallable() |
| UpdateServiceLevelObjective | Update the given `ServiceLevelObjective`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateServiceLevelObjective(UpdateServiceLevelObjectiveRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateServiceLevelObjective(ServiceLevelObjective serviceLevelObjective) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateServiceLevelObjectiveCallable() |
| DeleteServiceLevelObjective | Delete the given `ServiceLevelObjective`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - deleteServiceLevelObjective(ServiceLevelObjectiveName name) - deleteServiceLevelObjective(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteServiceLevelObjectiveCallable() |
[Methods]

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:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     ServiceMonitoringServiceSettings serviceMonitoringServiceSettings =
         ServiceMonitoringServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create(serviceMonitoringServiceSettings);
     
To customize the endpoint:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     ServiceMonitoringServiceSettings serviceMonitoringServiceSettings =
         ServiceMonitoringServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create(serviceMonitoringServiceSettings);
     
Please refer to the GitHub repository's samples for more quickstart code snippets.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> ServiceMonitoringServiceClient

## Static Methods

### create()

    public static final ServiceMonitoringServiceClient create()

Constructs an instance of ServiceMonitoringServiceClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(ServiceMonitoringServiceSettings settings)

    public static final ServiceMonitoringServiceClient create(ServiceMonitoringServiceSettings settings)

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(ServiceMonitoringServiceStub stub)

    public static final ServiceMonitoringServiceClient create(ServiceMonitoringServiceStub stub)

Constructs an instance of ServiceMonitoringServiceClient, using the given stub for making
calls. This is for advanced usage - prefer using create(ServiceMonitoringServiceSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.stub.ServiceMonitoringServiceStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient` |   |

## Constructors

### ServiceMonitoringServiceClient(ServiceMonitoringServiceSettings settings)

    protected ServiceMonitoringServiceClient(ServiceMonitoringServiceSettings settings)

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceSettings` |

### ServiceMonitoringServiceClient(ServiceMonitoringServiceStub stub)

    protected ServiceMonitoringServiceClient(ServiceMonitoringServiceStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.stub.ServiceMonitoringServiceStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### close()

    public final void close()

### createService(ResourceName parent, Service service)

    public final Service createService(ResourceName parent, Service service)

Create a `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ResourceName parent = ResourceName.of("[FOLDER]");
       Service service = Service.newBuilder().build();
       Service response = serviceMonitoringServiceClient.createService(parent, service);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `com.google.api.resourcenames.ResourceName` Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of the parent Metrics Scope. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `service` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` Required. The `Service` to create. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` |   |

### createService(CreateServiceRequest request)

    public final Service createService(CreateServiceRequest request)

Create a `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       CreateServiceRequest request =
           CreateServiceRequest.newBuilder()
               .setParent(ProjectName.of("[PROJECT]").toString())
               .setServiceId("serviceId-194185552")
               .setService(Service.newBuilder().build())
               .build();
       Service response = serviceMonitoringServiceClient.createService(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.CreateServiceRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` |   |

### createService(OrganizationName parent, Service service)

    public final Service createService(OrganizationName parent, Service service)

Create a `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
       Service service = Service.newBuilder().build();
       Service response = serviceMonitoringServiceClient.createService(parent, service);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.OrganizationName` Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of the parent Metrics Scope. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `service` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` Required. The `Service` to create. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` |   |

### createService(ProjectName parent, Service service)

    public final Service createService(ProjectName parent, Service service)

Create a `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ProjectName parent = ProjectName.of("[PROJECT]");
       Service service = Service.newBuilder().build();
       Service response = serviceMonitoringServiceClient.createService(parent, service);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ProjectName` Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of the parent Metrics Scope. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `service` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` Required. The `Service` to create. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` |   |

### createService(String parent, Service service)

    public final Service createService(String parent, Service service)

Create a `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       String parent = ProjectName.of("[PROJECT]").toString();
       Service service = Service.newBuilder().build();
       Service response = serviceMonitoringServiceClient.createService(parent, service);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of the parent Metrics Scope. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `service` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` Required. The `Service` to create. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` |   |

### createServiceCallable()

    public final UnaryCallable<CreateServiceRequest,Service> createServiceCallable()

Create a `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       CreateServiceRequest request =
           CreateServiceRequest.newBuilder()
               .setParent(ProjectName.of("[PROJECT]").toString())
               .setServiceId("serviceId-194185552")
               .setService(Service.newBuilder().build())
               .build();
       ApiFuture<Service> future =
           serviceMonitoringServiceClient.createServiceCallable().futureCall(request);
       // Do something.
       Service response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.CreateServiceRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service>` |   |

### createServiceLevelObjective(CreateServiceLevelObjectiveRequest request)

    public final ServiceLevelObjective createServiceLevelObjective(CreateServiceLevelObjectiveRequest request)

Create a `ServiceLevelObjective` for the given `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       CreateServiceLevelObjectiveRequest request =
           CreateServiceLevelObjectiveRequest.newBuilder()
               .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
               .setServiceLevelObjectiveId("serviceLevelObjectiveId-240792859")
               .setServiceLevelObjective(ServiceLevelObjective.newBuilder().build())
               .build();
       ServiceLevelObjective response =
           serviceMonitoringServiceClient.createServiceLevelObjective(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.CreateServiceLevelObjectiveRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective` |   |

### createServiceLevelObjective(ServiceName parent, ServiceLevelObjective serviceLevelObjective)

    public final ServiceLevelObjective createServiceLevelObjective(ServiceName parent, ServiceLevelObjective serviceLevelObjective)

Create a `ServiceLevelObjective` for the given `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
       ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
       ServiceLevelObjective response =
           serviceMonitoringServiceClient.createServiceLevelObjective(parent, serviceLevelObjective);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceName` Required. Resource name of the parent `Service`. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\] |
| `serviceLevelObjective` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective` Required. The `ServiceLevelObjective` to create. The provided `name` will be respected if no `ServiceLevelObjective` exists with this name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective` |   |

### createServiceLevelObjective(String parent, ServiceLevelObjective serviceLevelObjective)

    public final ServiceLevelObjective createServiceLevelObjective(String parent, ServiceLevelObjective serviceLevelObjective)

Create a `ServiceLevelObjective` for the given `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       String parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString();
       ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
       ServiceLevelObjective response =
           serviceMonitoringServiceClient.createServiceLevelObjective(parent, serviceLevelObjective);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the parent `Service`. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\] |
| `serviceLevelObjective` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective` Required. The `ServiceLevelObjective` to create. The provided `name` will be respected if no `ServiceLevelObjective` exists with this name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective` |   |

### createServiceLevelObjectiveCallable()

    public final UnaryCallable<CreateServiceLevelObjectiveRequest,ServiceLevelObjective> createServiceLevelObjectiveCallable()

Create a `ServiceLevelObjective` for the given `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       CreateServiceLevelObjectiveRequest request =
           CreateServiceLevelObjectiveRequest.newBuilder()
               .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
               .setServiceLevelObjectiveId("serviceLevelObjectiveId-240792859")
               .setServiceLevelObjective(ServiceLevelObjective.newBuilder().build())
               .build();
       ApiFuture<ServiceLevelObjective> future =
           serviceMonitoringServiceClient.createServiceLevelObjectiveCallable().futureCall(request);
       // Do something.
       ServiceLevelObjective response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.CreateServiceLevelObjectiveRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective>` |   |

### deleteService(DeleteServiceRequest request)

    public final void deleteService(DeleteServiceRequest request)

Soft delete this `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       DeleteServiceRequest request =
           DeleteServiceRequest.newBuilder()
               .setName(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
               .build();
       serviceMonitoringServiceClient.deleteService(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.DeleteServiceRequest` The request object containing all of the parameters for the API call. |

### deleteService(ServiceName name)

    public final void deleteService(ServiceName name)

Soft delete this `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
       serviceMonitoringServiceClient.deleteService(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceName` Required. Resource name of the `Service` to delete. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\] |

### deleteService(String name)

    public final void deleteService(String name)

Soft delete this `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       String name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString();
       serviceMonitoringServiceClient.deleteService(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the `Service` to delete. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\] |

### deleteServiceCallable()

    public final UnaryCallable<DeleteServiceRequest,Empty> deleteServiceCallable()

Soft delete this `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       DeleteServiceRequest request =
           DeleteServiceRequest.newBuilder()
               .setName(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
               .build();
       ApiFuture<Empty> future =
           serviceMonitoringServiceClient.deleteServiceCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.DeleteServiceRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest request)

    public final void deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest request)

Delete the given `ServiceLevelObjective`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       DeleteServiceLevelObjectiveRequest request =
           DeleteServiceLevelObjectiveRequest.newBuilder()
               .setName(
                   ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
                           "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
                       .toString())
               .build();
       serviceMonitoringServiceClient.deleteServiceLevelObjective(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest` The request object containing all of the parameters for the API call. |

### deleteServiceLevelObjective(ServiceLevelObjectiveName name)

    public final void deleteServiceLevelObjective(ServiceLevelObjectiveName name)

Delete the given `ServiceLevelObjective`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ServiceLevelObjectiveName name =
           ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
               "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
       serviceMonitoringServiceClient.deleteServiceLevelObjective(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjectiveName` Required. Resource name of the `ServiceLevelObjective` to delete. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\]/serviceLevelObjectives/\[SLO_NAME\] |

### deleteServiceLevelObjective(String name)

    public final void deleteServiceLevelObjective(String name)

Delete the given `ServiceLevelObjective`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       String name =
           ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
                   "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
               .toString();
       serviceMonitoringServiceClient.deleteServiceLevelObjective(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the `ServiceLevelObjective` to delete. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\]/serviceLevelObjectives/\[SLO_NAME\] |

### deleteServiceLevelObjectiveCallable()

    public final UnaryCallable<DeleteServiceLevelObjectiveRequest,Empty> deleteServiceLevelObjectiveCallable()

Delete the given `ServiceLevelObjective`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       DeleteServiceLevelObjectiveRequest request =
           DeleteServiceLevelObjectiveRequest.newBuilder()
               .setName(
                   ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
                           "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
                       .toString())
               .build();
       ApiFuture<Empty> future =
           serviceMonitoringServiceClient.deleteServiceLevelObjectiveCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.DeleteServiceLevelObjectiveRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### getService(GetServiceRequest request)

    public final Service getService(GetServiceRequest request)

Get the named `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       GetServiceRequest request =
           GetServiceRequest.newBuilder()
               .setName(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
               .build();
       Service response = serviceMonitoringServiceClient.getService(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.GetServiceRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` |   |

### getService(ServiceName name)

    public final Service getService(ServiceName name)

Get the named `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
       Service response = serviceMonitoringServiceClient.getService(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceName` Required. Resource name of the `Service`. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` |   |

### getService(String name)

    public final Service getService(String name)

Get the named `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       String name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString();
       Service response = serviceMonitoringServiceClient.getService(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the `Service`. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` |   |

### getServiceCallable()

    public final UnaryCallable<GetServiceRequest,Service> getServiceCallable()

Get the named `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       GetServiceRequest request =
           GetServiceRequest.newBuilder()
               .setName(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
               .build();
       ApiFuture<Service> future =
           serviceMonitoringServiceClient.getServiceCallable().futureCall(request);
       // Do something.
       Service response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.GetServiceRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service>` |   |

### getServiceLevelObjective(GetServiceLevelObjectiveRequest request)

    public final ServiceLevelObjective getServiceLevelObjective(GetServiceLevelObjectiveRequest request)

Get a `ServiceLevelObjective` by name.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       GetServiceLevelObjectiveRequest request =
           GetServiceLevelObjectiveRequest.newBuilder()
               .setName(
                   ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
                           "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
                       .toString())
               .build();
       ServiceLevelObjective response =
           serviceMonitoringServiceClient.getServiceLevelObjective(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.GetServiceLevelObjectiveRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective` |   |

### getServiceLevelObjective(ServiceLevelObjectiveName name)

    public final ServiceLevelObjective getServiceLevelObjective(ServiceLevelObjectiveName name)

Get a `ServiceLevelObjective` by name.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ServiceLevelObjectiveName name =
           ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
               "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
       ServiceLevelObjective response =
           serviceMonitoringServiceClient.getServiceLevelObjective(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjectiveName` Required. Resource name of the `ServiceLevelObjective` to get. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\]/serviceLevelObjectives/\[SLO_NAME\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective` |   |

### getServiceLevelObjective(String name)

    public final ServiceLevelObjective getServiceLevelObjective(String name)

Get a `ServiceLevelObjective` by name.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       String name =
           ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
                   "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
               .toString();
       ServiceLevelObjective response =
           serviceMonitoringServiceClient.getServiceLevelObjective(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the `ServiceLevelObjective` to get. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\]/serviceLevelObjectives/\[SLO_NAME\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective` |   |

### getServiceLevelObjectiveCallable()

    public final UnaryCallable<GetServiceLevelObjectiveRequest,ServiceLevelObjective> getServiceLevelObjectiveCallable()

Get a `ServiceLevelObjective` by name.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       GetServiceLevelObjectiveRequest request =
           GetServiceLevelObjectiveRequest.newBuilder()
               .setName(
                   ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
                           "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
                       .toString())
               .build();
       ApiFuture<ServiceLevelObjective> future =
           serviceMonitoringServiceClient.getServiceLevelObjectiveCallable().futureCall(request);
       // Do something.
       ServiceLevelObjective response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.GetServiceLevelObjectiveRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective>` |   |

### getSettings()

    public final ServiceMonitoringServiceSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceSettings` |   |

### getStub()

    public ServiceMonitoringServiceStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.stub.ServiceMonitoringServiceStub` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### listServiceLevelObjectives(ListServiceLevelObjectivesRequest request)

    public final ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(ListServiceLevelObjectivesRequest request)

List the `ServiceLevelObjective`s for the given `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ListServiceLevelObjectivesRequest request =
           ListServiceLevelObjectivesRequest.newBuilder()
               .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (ServiceLevelObjective element :
           serviceMonitoringServiceClient.listServiceLevelObjectives(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListServiceLevelObjectivesRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse` |   |

### listServiceLevelObjectives(ServiceName parent)

    public final ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(ServiceName parent)

List the `ServiceLevelObjective`s for the given `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
       for (ServiceLevelObjective element :
           serviceMonitoringServiceClient.listServiceLevelObjectives(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceName` Required. Resource name of the parent containing the listed SLOs, either a project or a Monitoring Metrics Scope. The formats are: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\] workspaces/\[HOST_PROJECT_ID_OR_NUMBER\]/services/- |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse` |   |

### listServiceLevelObjectives(String parent)

    public final ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(String parent)

List the `ServiceLevelObjective`s for the given `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       String parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString();
       for (ServiceLevelObjective element :
           serviceMonitoringServiceClient.listServiceLevelObjectives(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the parent containing the listed SLOs, either a project or a Monitoring Metrics Scope. The formats are: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\] workspaces/\[HOST_PROJECT_ID_OR_NUMBER\]/services/- |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse` |   |

### listServiceLevelObjectivesCallable()

    public final UnaryCallable<ListServiceLevelObjectivesRequest,ListServiceLevelObjectivesResponse> listServiceLevelObjectivesCallable()

List the `ServiceLevelObjective`s for the given `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ListServiceLevelObjectivesRequest request =
           ListServiceLevelObjectivesRequest.newBuilder()
               .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .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;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListServiceLevelObjectivesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListServiceLevelObjectivesResponse>` |   |

### listServiceLevelObjectivesPagedCallable()

    public final UnaryCallable<ListServiceLevelObjectivesRequest,ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse> listServiceLevelObjectivesPagedCallable()

List the `ServiceLevelObjective`s for the given `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ListServiceLevelObjectivesRequest request =
           ListServiceLevelObjectivesRequest.newBuilder()
               .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<ServiceLevelObjective> future =
           serviceMonitoringServiceClient
               .listServiceLevelObjectivesPagedCallable()
               .futureCall(request);
       // Do something.
       for (ServiceLevelObjective element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListServiceLevelObjectivesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServiceLevelObjectivesPagedResponse>` |   |

### listServices(ResourceName parent)

    public final ServiceMonitoringServiceClient.ListServicesPagedResponse listServices(ResourceName parent)

List `Service`s for this Metrics Scope.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ResourceName parent = ResourceName.of("[FOLDER]");
       for (Service element : serviceMonitoringServiceClient.listServices(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `com.google.api.resourcenames.ResourceName` Required. Resource name of the parent containing the listed services, either a [project](https://cloud.google.com/monitoring/api/v3#project_name) or a Monitoring Metrics Scope. The formats are: projects/\[PROJECT_ID_OR_NUMBER\] workspaces/\[HOST_PROJECT_ID_OR_NUMBER\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServicesPagedResponse` |   |

### listServices(ListServicesRequest request)

    public final ServiceMonitoringServiceClient.ListServicesPagedResponse listServices(ListServicesRequest request)

List `Service`s for this Metrics Scope.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ListServicesRequest request =
           ListServicesRequest.newBuilder()
               .setParent(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Service element : serviceMonitoringServiceClient.listServices(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListServicesRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServicesPagedResponse` |   |

### listServices(OrganizationName parent)

    public final ServiceMonitoringServiceClient.ListServicesPagedResponse listServices(OrganizationName parent)

List `Service`s for this Metrics Scope.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
       for (Service element : serviceMonitoringServiceClient.listServices(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.OrganizationName` Required. Resource name of the parent containing the listed services, either a [project](https://cloud.google.com/monitoring/api/v3#project_name) or a Monitoring Metrics Scope. The formats are: projects/\[PROJECT_ID_OR_NUMBER\] workspaces/\[HOST_PROJECT_ID_OR_NUMBER\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServicesPagedResponse` |   |

### listServices(ProjectName parent)

    public final ServiceMonitoringServiceClient.ListServicesPagedResponse listServices(ProjectName parent)

List `Service`s for this Metrics Scope.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ProjectName parent = ProjectName.of("[PROJECT]");
       for (Service element : serviceMonitoringServiceClient.listServices(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ProjectName` Required. Resource name of the parent containing the listed services, either a [project](https://cloud.google.com/monitoring/api/v3#project_name) or a Monitoring Metrics Scope. The formats are: projects/\[PROJECT_ID_OR_NUMBER\] workspaces/\[HOST_PROJECT_ID_OR_NUMBER\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServicesPagedResponse` |   |

### listServices(String parent)

    public final ServiceMonitoringServiceClient.ListServicesPagedResponse listServices(String parent)

List `Service`s for this Metrics Scope.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       String parent = ProjectName.of("[PROJECT]").toString();
       for (Service element : serviceMonitoringServiceClient.listServices(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the parent containing the listed services, either a [project](https://cloud.google.com/monitoring/api/v3#project_name) or a Monitoring Metrics Scope. The formats are: projects/\[PROJECT_ID_OR_NUMBER\] workspaces/\[HOST_PROJECT_ID_OR_NUMBER\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServicesPagedResponse` |   |

### listServicesCallable()

    public final UnaryCallable<ListServicesRequest,ListServicesResponse> listServicesCallable()

List `Service`s for this Metrics Scope.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ListServicesRequest request =
           ListServicesRequest.newBuilder()
               .setParent(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .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;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListServicesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListServicesResponse>` |   |

### listServicesPagedCallable()

    public final UnaryCallable<ListServicesRequest,ServiceMonitoringServiceClient.ListServicesPagedResponse> listServicesPagedCallable()

List `Service`s for this Metrics Scope.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ListServicesRequest request =
           ListServicesRequest.newBuilder()
               .setParent(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Service> future =
           serviceMonitoringServiceClient.listServicesPagedCallable().futureCall(request);
       // Do something.
       for (Service element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListServicesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.ServiceMonitoringServiceClient.ListServicesPagedResponse>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### updateService(Service service)

    public final Service updateService(Service service)

Update this `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       Service service = Service.newBuilder().build();
       Service response = serviceMonitoringServiceClient.updateService(service);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `service` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` Required. The `Service` to draw updates from. The given `name` specifies the resource to update. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` |   |

### updateService(UpdateServiceRequest request)

    public final Service updateService(UpdateServiceRequest request)

Update this `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       UpdateServiceRequest request =
           UpdateServiceRequest.newBuilder()
               .setService(Service.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Service response = serviceMonitoringServiceClient.updateService(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.UpdateServiceRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service` |   |

### updateServiceCallable()

    public final UnaryCallable<UpdateServiceRequest,Service> updateServiceCallable()

Update this `Service`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       UpdateServiceRequest request =
           UpdateServiceRequest.newBuilder()
               .setService(Service.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Service> future =
           serviceMonitoringServiceClient.updateServiceCallable().futureCall(request);
       // Do something.
       Service response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.UpdateServiceRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Service>` |   |

### updateServiceLevelObjective(ServiceLevelObjective serviceLevelObjective)

    public final ServiceLevelObjective updateServiceLevelObjective(ServiceLevelObjective serviceLevelObjective)

Update the given `ServiceLevelObjective`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
       ServiceLevelObjective response =
           serviceMonitoringServiceClient.updateServiceLevelObjective(serviceLevelObjective);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `serviceLevelObjective` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective` Required. The `ServiceLevelObjective` to draw updates from. The given `name` specifies the resource to update. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective` |   |

### updateServiceLevelObjective(UpdateServiceLevelObjectiveRequest request)

    public final ServiceLevelObjective updateServiceLevelObjective(UpdateServiceLevelObjectiveRequest request)

Update the given `ServiceLevelObjective`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       UpdateServiceLevelObjectiveRequest request =
           UpdateServiceLevelObjectiveRequest.newBuilder()
               .setServiceLevelObjective(ServiceLevelObjective.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ServiceLevelObjective response =
           serviceMonitoringServiceClient.updateServiceLevelObjective(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective` |   |

### updateServiceLevelObjectiveCallable()

    public final UnaryCallable<UpdateServiceLevelObjectiveRequest,ServiceLevelObjective> updateServiceLevelObjectiveCallable()

Update the given `ServiceLevelObjective`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
         ServiceMonitoringServiceClient.create()) {
       UpdateServiceLevelObjectiveRequest request =
           UpdateServiceLevelObjectiveRequest.newBuilder()
               .setServiceLevelObjective(ServiceLevelObjective.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<ServiceLevelObjective> future =
           serviceMonitoringServiceClient.updateServiceLevelObjectiveCallable().futureCall(request);
       // Do something.
       ServiceLevelObjective response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.UpdateServiceLevelObjectiveRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ServiceLevelObjective>` |   |