com.google.cloud.aiplatform.v1beta1.ModelMonitoringServiceClient Maven / Gradle / Ivy
Show all versions of google-cloud-aiplatform Show documentation
/*
* Copyright 2024 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.aiplatform.v1beta1;
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.longrunning.OperationFuture;
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.OperationCallable;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.aiplatform.v1beta1.stub.ModelMonitoringServiceStub;
import com.google.cloud.aiplatform.v1beta1.stub.ModelMonitoringServiceStubSettings;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Service Description: A service for creating and managing Vertex AI Model moitoring. This includes
* `ModelMonitor` resources, `ModelMonitoringJob` resources.
*
* This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
*
*
{@code
* // 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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ModelMonitorName name = ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]");
* ModelMonitor response = modelMonitoringServiceClient.getModelMonitor(name);
* }
* }
*
* Note: close() needs to be called on the ModelMonitoringServiceClient object to clean up
* resources such as threads. In the example above, try-with-resources is used, which automatically
* calls close().
*
*
* Methods
*
* Method
* Description
* Method Variants
*
*
* CreateModelMonitor
* Creates a ModelMonitor.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* createModelMonitorAsync(CreateModelMonitorRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* createModelMonitorAsync(LocationName parent, ModelMonitor modelMonitor)
*
createModelMonitorAsync(String parent, ModelMonitor modelMonitor)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* createModelMonitorOperationCallable()
*
createModelMonitorCallable()
*
*
*
*
* UpdateModelMonitor
* Updates a ModelMonitor.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* updateModelMonitorAsync(UpdateModelMonitorRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* updateModelMonitorAsync(ModelMonitor modelMonitor, FieldMask updateMask)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* updateModelMonitorOperationCallable()
*
updateModelMonitorCallable()
*
*
*
*
* GetModelMonitor
* Gets a ModelMonitor.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* getModelMonitor(GetModelMonitorRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* getModelMonitor(ModelMonitorName name)
*
getModelMonitor(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.
*
* getModelMonitorCallable()
*
*
*
*
* ListModelMonitors
* Lists ModelMonitors in a Location.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* listModelMonitors(ListModelMonitorsRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* listModelMonitors(LocationName parent)
*
listModelMonitors(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.
*
* listModelMonitorsPagedCallable()
*
listModelMonitorsCallable()
*
*
*
*
* DeleteModelMonitor
* Deletes a ModelMonitor.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* deleteModelMonitorAsync(DeleteModelMonitorRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* deleteModelMonitorAsync(ModelMonitorName name)
*
deleteModelMonitorAsync(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.
*
* deleteModelMonitorOperationCallable()
*
deleteModelMonitorCallable()
*
*
*
*
* CreateModelMonitoringJob
* Creates a ModelMonitoringJob.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* createModelMonitoringJob(CreateModelMonitoringJobRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* createModelMonitoringJob(ModelMonitorName parent, ModelMonitoringJob modelMonitoringJob)
*
createModelMonitoringJob(String parent, ModelMonitoringJob modelMonitoringJob)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* createModelMonitoringJobCallable()
*
*
*
*
* GetModelMonitoringJob
* Gets a ModelMonitoringJob.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* getModelMonitoringJob(GetModelMonitoringJobRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* getModelMonitoringJob(ModelMonitoringJobName name)
*
getModelMonitoringJob(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.
*
* getModelMonitoringJobCallable()
*
*
*
*
* ListModelMonitoringJobs
* Lists ModelMonitoringJobs. Callers may choose to read across multiple Monitors as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard character instead of modelMonitor id in the parent. Format `projects/{project_id}/locations/{location}/moodelMonitors/-/modelMonitoringJobs`
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* listModelMonitoringJobs(ListModelMonitoringJobsRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* listModelMonitoringJobs(ModelMonitorName parent)
*
listModelMonitoringJobs(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.
*
* listModelMonitoringJobsPagedCallable()
*
listModelMonitoringJobsCallable()
*
*
*
*
* DeleteModelMonitoringJob
* Deletes a ModelMonitoringJob.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* deleteModelMonitoringJobAsync(DeleteModelMonitoringJobRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* deleteModelMonitoringJobAsync(ModelMonitoringJobName name)
*
deleteModelMonitoringJobAsync(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.
*
* deleteModelMonitoringJobOperationCallable()
*
deleteModelMonitoringJobCallable()
*
*
*
*
* SearchModelMonitoringStats
* Searches Model Monitoring Stats generated within a given time window.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* searchModelMonitoringStats(SearchModelMonitoringStatsRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* searchModelMonitoringStats(ModelMonitorName modelMonitor)
*
searchModelMonitoringStats(String modelMonitor)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* searchModelMonitoringStatsPagedCallable()
*
searchModelMonitoringStatsCallable()
*
*
*
*
* SearchModelMonitoringAlerts
* Returns the Model Monitoring alerts.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* searchModelMonitoringAlerts(SearchModelMonitoringAlertsRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* searchModelMonitoringAlerts(ModelMonitorName modelMonitor)
*
searchModelMonitoringAlerts(String modelMonitor)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* searchModelMonitoringAlertsPagedCallable()
*
searchModelMonitoringAlertsCallable()
*
*
*
*
* ListLocations
* Lists information about the supported locations for this service.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* listLocations(ListLocationsRequest request)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* listLocationsPagedCallable()
*
listLocationsCallable()
*
*
*
*
* GetLocation
* Gets information about a location.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* getLocation(GetLocationRequest request)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* getLocationCallable()
*
*
*
*
* SetIamPolicy
* Sets the access control policy on the specified resource. Replacesany existing policy.
*
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* setIamPolicy(SetIamPolicyRequest request)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* setIamPolicyCallable()
*
*
*
*
* GetIamPolicy
* Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* getIamPolicy(GetIamPolicyRequest request)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* getIamPolicyCallable()
*
*
*
*
* TestIamPermissions
* Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.
*
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* testIamPermissions(TestIamPermissionsRequest request)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* testIamPermissionsCallable()
*
*
*
*
*
* 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 ModelMonitoringServiceSettings
* to create(). For example:
*
*
To customize credentials:
*
*
{@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
* ModelMonitoringServiceSettings modelMonitoringServiceSettings =
* ModelMonitoringServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create(modelMonitoringServiceSettings);
* }
*
* To customize the endpoint:
*
*
{@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
* ModelMonitoringServiceSettings modelMonitoringServiceSettings =
* ModelMonitoringServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
* ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create(modelMonitoringServiceSettings);
* }
*
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
@Generated("by gapic-generator-java")
public class ModelMonitoringServiceClient implements BackgroundResource {
private final ModelMonitoringServiceSettings settings;
private final ModelMonitoringServiceStub stub;
private final OperationsClient operationsClient;
/** Constructs an instance of ModelMonitoringServiceClient with default settings. */
public static final ModelMonitoringServiceClient create() throws IOException {
return create(ModelMonitoringServiceSettings.newBuilder().build());
}
/**
* Constructs an instance of ModelMonitoringServiceClient, 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 ModelMonitoringServiceClient create(ModelMonitoringServiceSettings settings)
throws IOException {
return new ModelMonitoringServiceClient(settings);
}
/**
* Constructs an instance of ModelMonitoringServiceClient, using the given stub for making calls.
* This is for advanced usage - prefer using create(ModelMonitoringServiceSettings).
*/
public static final ModelMonitoringServiceClient create(ModelMonitoringServiceStub stub) {
return new ModelMonitoringServiceClient(stub);
}
/**
* Constructs an instance of ModelMonitoringServiceClient, 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 ModelMonitoringServiceClient(ModelMonitoringServiceSettings settings)
throws IOException {
this.settings = settings;
this.stub = ((ModelMonitoringServiceStubSettings) settings.getStubSettings()).createStub();
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}
protected ModelMonitoringServiceClient(ModelMonitoringServiceStub stub) {
this.settings = null;
this.stub = stub;
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}
public final ModelMonitoringServiceSettings getSettings() {
return settings;
}
public ModelMonitoringServiceStub getStub() {
return stub;
}
/**
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
public final OperationsClient getOperationsClient() {
return operationsClient;
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a ModelMonitor.
*
*
Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* ModelMonitor modelMonitor = ModelMonitor.newBuilder().build();
* ModelMonitor response =
* modelMonitoringServiceClient.createModelMonitorAsync(parent, modelMonitor).get();
* }
* }
*
* @param parent Required. The resource name of the Location to create the ModelMonitor in.
* Format: `projects/{project}/locations/{location}`
* @param modelMonitor Required. The ModelMonitor to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture
createModelMonitorAsync(LocationName parent, ModelMonitor modelMonitor) {
CreateModelMonitorRequest request =
CreateModelMonitorRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setModelMonitor(modelMonitor)
.build();
return createModelMonitorAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
* ModelMonitor modelMonitor = ModelMonitor.newBuilder().build();
* ModelMonitor response =
* modelMonitoringServiceClient.createModelMonitorAsync(parent, modelMonitor).get();
* }
* }
*
* @param parent Required. The resource name of the Location to create the ModelMonitor in.
* Format: `projects/{project}/locations/{location}`
* @param modelMonitor Required. The ModelMonitor to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture
createModelMonitorAsync(String parent, ModelMonitor modelMonitor) {
CreateModelMonitorRequest request =
CreateModelMonitorRequest.newBuilder()
.setParent(parent)
.setModelMonitor(modelMonitor)
.build();
return createModelMonitorAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* CreateModelMonitorRequest request =
* CreateModelMonitorRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setModelMonitor(ModelMonitor.newBuilder().build())
* .setModelMonitorId("modelMonitorId2093120236")
* .build();
* ModelMonitor response = modelMonitoringServiceClient.createModelMonitorAsync(request).get();
* }
* }
*
* @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 OperationFuture
createModelMonitorAsync(CreateModelMonitorRequest request) {
return createModelMonitorOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* CreateModelMonitorRequest request =
* CreateModelMonitorRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setModelMonitor(ModelMonitor.newBuilder().build())
* .setModelMonitorId("modelMonitorId2093120236")
* .build();
* OperationFuture future =
* modelMonitoringServiceClient.createModelMonitorOperationCallable().futureCall(request);
* // Do something.
* ModelMonitor response = future.get();
* }
* }
*/
public final OperationCallable<
CreateModelMonitorRequest, ModelMonitor, CreateModelMonitorOperationMetadata>
createModelMonitorOperationCallable() {
return stub.createModelMonitorOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* CreateModelMonitorRequest request =
* CreateModelMonitorRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setModelMonitor(ModelMonitor.newBuilder().build())
* .setModelMonitorId("modelMonitorId2093120236")
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.createModelMonitorCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable createModelMonitorCallable() {
return stub.createModelMonitorCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ModelMonitor modelMonitor = ModelMonitor.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* ModelMonitor response =
* modelMonitoringServiceClient.updateModelMonitorAsync(modelMonitor, updateMask).get();
* }
* }
*
* @param modelMonitor Required. The model monitoring configuration which replaces the resource on
* the server.
* @param updateMask Required. Mask specifying which fields to update.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture
updateModelMonitorAsync(ModelMonitor modelMonitor, FieldMask updateMask) {
UpdateModelMonitorRequest request =
UpdateModelMonitorRequest.newBuilder()
.setModelMonitor(modelMonitor)
.setUpdateMask(updateMask)
.build();
return updateModelMonitorAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* UpdateModelMonitorRequest request =
* UpdateModelMonitorRequest.newBuilder()
* .setModelMonitor(ModelMonitor.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ModelMonitor response = modelMonitoringServiceClient.updateModelMonitorAsync(request).get();
* }
* }
*
* @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 OperationFuture
updateModelMonitorAsync(UpdateModelMonitorRequest request) {
return updateModelMonitorOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* UpdateModelMonitorRequest request =
* UpdateModelMonitorRequest.newBuilder()
* .setModelMonitor(ModelMonitor.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* OperationFuture future =
* modelMonitoringServiceClient.updateModelMonitorOperationCallable().futureCall(request);
* // Do something.
* ModelMonitor response = future.get();
* }
* }
*/
public final OperationCallable<
UpdateModelMonitorRequest, ModelMonitor, UpdateModelMonitorOperationMetadata>
updateModelMonitorOperationCallable() {
return stub.updateModelMonitorOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* UpdateModelMonitorRequest request =
* UpdateModelMonitorRequest.newBuilder()
* .setModelMonitor(ModelMonitor.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.updateModelMonitorCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable updateModelMonitorCallable() {
return stub.updateModelMonitorCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ModelMonitorName name = ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]");
* ModelMonitor response = modelMonitoringServiceClient.getModelMonitor(name);
* }
* }
*
* @param name Required. The name of the ModelMonitor resource. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ModelMonitor getModelMonitor(ModelMonitorName name) {
GetModelMonitorRequest request =
GetModelMonitorRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return getModelMonitor(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* String name = ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString();
* ModelMonitor response = modelMonitoringServiceClient.getModelMonitor(name);
* }
* }
*
* @param name Required. The name of the ModelMonitor resource. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ModelMonitor getModelMonitor(String name) {
GetModelMonitorRequest request = GetModelMonitorRequest.newBuilder().setName(name).build();
return getModelMonitor(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* GetModelMonitorRequest request =
* GetModelMonitorRequest.newBuilder()
* .setName(ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .build();
* ModelMonitor response = modelMonitoringServiceClient.getModelMonitor(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 ModelMonitor getModelMonitor(GetModelMonitorRequest request) {
return getModelMonitorCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* GetModelMonitorRequest request =
* GetModelMonitorRequest.newBuilder()
* .setName(ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.getModelMonitorCallable().futureCall(request);
* // Do something.
* ModelMonitor response = future.get();
* }
* }
*/
public final UnaryCallable getModelMonitorCallable() {
return stub.getModelMonitorCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelMonitors in a Location.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* for (ModelMonitor element :
* modelMonitoringServiceClient.listModelMonitors(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. The resource name of the Location to list the ModelMonitors from.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListModelMonitorsPagedResponse listModelMonitors(LocationName parent) {
ListModelMonitorsRequest request =
ListModelMonitorsRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listModelMonitors(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelMonitors in a Location.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
* for (ModelMonitor element :
* modelMonitoringServiceClient.listModelMonitors(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. The resource name of the Location to list the ModelMonitors from.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListModelMonitorsPagedResponse listModelMonitors(String parent) {
ListModelMonitorsRequest request =
ListModelMonitorsRequest.newBuilder().setParent(parent).build();
return listModelMonitors(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelMonitors in a Location.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ListModelMonitorsRequest request =
* ListModelMonitorsRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setFilter("filter-1274492040")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setReadMask(FieldMask.newBuilder().build())
* .build();
* for (ModelMonitor element :
* modelMonitoringServiceClient.listModelMonitors(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 ListModelMonitorsPagedResponse listModelMonitors(ListModelMonitorsRequest request) {
return listModelMonitorsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelMonitors in a Location.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ListModelMonitorsRequest request =
* ListModelMonitorsRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setFilter("filter-1274492040")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setReadMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.listModelMonitorsPagedCallable().futureCall(request);
* // Do something.
* for (ModelMonitor element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*/
public final UnaryCallable
listModelMonitorsPagedCallable() {
return stub.listModelMonitorsPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelMonitors in a Location.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ListModelMonitorsRequest request =
* ListModelMonitorsRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setFilter("filter-1274492040")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setReadMask(FieldMask.newBuilder().build())
* .build();
* while (true) {
* ListModelMonitorsResponse response =
* modelMonitoringServiceClient.listModelMonitorsCallable().call(request);
* for (ModelMonitor element : response.getModelMonitorsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }
*/
public final UnaryCallable
listModelMonitorsCallable() {
return stub.listModelMonitorsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ModelMonitorName name = ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]");
* modelMonitoringServiceClient.deleteModelMonitorAsync(name).get();
* }
* }
*
* @param name Required. The name of the ModelMonitor resource to be deleted. Format:
* `projects/{project}/locations/{location}/modelMonitords/{model_monitor}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteModelMonitorAsync(
ModelMonitorName name) {
DeleteModelMonitorRequest request =
DeleteModelMonitorRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
return deleteModelMonitorAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* String name = ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString();
* modelMonitoringServiceClient.deleteModelMonitorAsync(name).get();
* }
* }
*
* @param name Required. The name of the ModelMonitor resource to be deleted. Format:
* `projects/{project}/locations/{location}/modelMonitords/{model_monitor}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteModelMonitorAsync(
String name) {
DeleteModelMonitorRequest request =
DeleteModelMonitorRequest.newBuilder().setName(name).build();
return deleteModelMonitorAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* DeleteModelMonitorRequest request =
* DeleteModelMonitorRequest.newBuilder()
* .setName(ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setForce(true)
* .build();
* modelMonitoringServiceClient.deleteModelMonitorAsync(request).get();
* }
* }
*
* @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 OperationFuture deleteModelMonitorAsync(
DeleteModelMonitorRequest request) {
return deleteModelMonitorOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* DeleteModelMonitorRequest request =
* DeleteModelMonitorRequest.newBuilder()
* .setName(ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setForce(true)
* .build();
* OperationFuture future =
* modelMonitoringServiceClient.deleteModelMonitorOperationCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final OperationCallable
deleteModelMonitorOperationCallable() {
return stub.deleteModelMonitorOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a ModelMonitor.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* DeleteModelMonitorRequest request =
* DeleteModelMonitorRequest.newBuilder()
* .setName(ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setForce(true)
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.deleteModelMonitorCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final UnaryCallable deleteModelMonitorCallable() {
return stub.deleteModelMonitorCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ModelMonitorName parent = ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]");
* ModelMonitoringJob modelMonitoringJob = ModelMonitoringJob.newBuilder().build();
* ModelMonitoringJob response =
* modelMonitoringServiceClient.createModelMonitoringJob(parent, modelMonitoringJob);
* }
* }
*
* @param parent Required. The parent of the ModelMonitoringJob. Format:
* `projects/{project}/locations/{location}/modelMoniitors/{model_monitor}`
* @param modelMonitoringJob Required. The ModelMonitoringJob to create
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ModelMonitoringJob createModelMonitoringJob(
ModelMonitorName parent, ModelMonitoringJob modelMonitoringJob) {
CreateModelMonitoringJobRequest request =
CreateModelMonitoringJobRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setModelMonitoringJob(modelMonitoringJob)
.build();
return createModelMonitoringJob(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* String parent = ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString();
* ModelMonitoringJob modelMonitoringJob = ModelMonitoringJob.newBuilder().build();
* ModelMonitoringJob response =
* modelMonitoringServiceClient.createModelMonitoringJob(parent, modelMonitoringJob);
* }
* }
*
* @param parent Required. The parent of the ModelMonitoringJob. Format:
* `projects/{project}/locations/{location}/modelMoniitors/{model_monitor}`
* @param modelMonitoringJob Required. The ModelMonitoringJob to create
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ModelMonitoringJob createModelMonitoringJob(
String parent, ModelMonitoringJob modelMonitoringJob) {
CreateModelMonitoringJobRequest request =
CreateModelMonitoringJobRequest.newBuilder()
.setParent(parent)
.setModelMonitoringJob(modelMonitoringJob)
.build();
return createModelMonitoringJob(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* CreateModelMonitoringJobRequest request =
* CreateModelMonitoringJobRequest.newBuilder()
* .setParent(
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setModelMonitoringJob(ModelMonitoringJob.newBuilder().build())
* .setModelMonitoringJobId("modelMonitoringJobId-1595185177")
* .build();
* ModelMonitoringJob response = modelMonitoringServiceClient.createModelMonitoringJob(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 ModelMonitoringJob createModelMonitoringJob(
CreateModelMonitoringJobRequest request) {
return createModelMonitoringJobCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* CreateModelMonitoringJobRequest request =
* CreateModelMonitoringJobRequest.newBuilder()
* .setParent(
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setModelMonitoringJob(ModelMonitoringJob.newBuilder().build())
* .setModelMonitoringJobId("modelMonitoringJobId-1595185177")
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.createModelMonitoringJobCallable().futureCall(request);
* // Do something.
* ModelMonitoringJob response = future.get();
* }
* }
*/
public final UnaryCallable
createModelMonitoringJobCallable() {
return stub.createModelMonitoringJobCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ModelMonitoringJobName name =
* ModelMonitoringJobName.of(
* "[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]", "[MODEL_MONITORING_JOB]");
* ModelMonitoringJob response = modelMonitoringServiceClient.getModelMonitoringJob(name);
* }
* }
*
* @param name Required. The resource name of the ModelMonitoringJob. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}/modelMonitoringJobs/{model_monitoring_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ModelMonitoringJob getModelMonitoringJob(ModelMonitoringJobName name) {
GetModelMonitoringJobRequest request =
GetModelMonitoringJobRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
return getModelMonitoringJob(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* String name =
* ModelMonitoringJobName.of(
* "[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]", "[MODEL_MONITORING_JOB]")
* .toString();
* ModelMonitoringJob response = modelMonitoringServiceClient.getModelMonitoringJob(name);
* }
* }
*
* @param name Required. The resource name of the ModelMonitoringJob. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}/modelMonitoringJobs/{model_monitoring_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ModelMonitoringJob getModelMonitoringJob(String name) {
GetModelMonitoringJobRequest request =
GetModelMonitoringJobRequest.newBuilder().setName(name).build();
return getModelMonitoringJob(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* GetModelMonitoringJobRequest request =
* GetModelMonitoringJobRequest.newBuilder()
* .setName(
* ModelMonitoringJobName.of(
* "[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]", "[MODEL_MONITORING_JOB]")
* .toString())
* .build();
* ModelMonitoringJob response = modelMonitoringServiceClient.getModelMonitoringJob(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 ModelMonitoringJob getModelMonitoringJob(GetModelMonitoringJobRequest request) {
return getModelMonitoringJobCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* GetModelMonitoringJobRequest request =
* GetModelMonitoringJobRequest.newBuilder()
* .setName(
* ModelMonitoringJobName.of(
* "[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]", "[MODEL_MONITORING_JOB]")
* .toString())
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.getModelMonitoringJobCallable().futureCall(request);
* // Do something.
* ModelMonitoringJob response = future.get();
* }
* }
*/
public final UnaryCallable
getModelMonitoringJobCallable() {
return stub.getModelMonitoringJobCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelMonitoringJobs. Callers may choose to read across multiple Monitors as per
* [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard
* character instead of modelMonitor id in the parent. Format
* `projects/{project_id}/locations/{location}/moodelMonitors/-/modelMonitoringJobs`
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ModelMonitorName parent = ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]");
* for (ModelMonitoringJob element :
* modelMonitoringServiceClient.listModelMonitoringJobs(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. The parent of the ModelMonitoringJob. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListModelMonitoringJobsPagedResponse listModelMonitoringJobs(
ModelMonitorName parent) {
ListModelMonitoringJobsRequest request =
ListModelMonitoringJobsRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listModelMonitoringJobs(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelMonitoringJobs. Callers may choose to read across multiple Monitors as per
* [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard
* character instead of modelMonitor id in the parent. Format
* `projects/{project_id}/locations/{location}/moodelMonitors/-/modelMonitoringJobs`
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* String parent = ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString();
* for (ModelMonitoringJob element :
* modelMonitoringServiceClient.listModelMonitoringJobs(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. The parent of the ModelMonitoringJob. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListModelMonitoringJobsPagedResponse listModelMonitoringJobs(String parent) {
ListModelMonitoringJobsRequest request =
ListModelMonitoringJobsRequest.newBuilder().setParent(parent).build();
return listModelMonitoringJobs(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelMonitoringJobs. Callers may choose to read across multiple Monitors as per
* [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard
* character instead of modelMonitor id in the parent. Format
* `projects/{project_id}/locations/{location}/moodelMonitors/-/modelMonitoringJobs`
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ListModelMonitoringJobsRequest request =
* ListModelMonitoringJobsRequest.newBuilder()
* .setParent(
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setFilter("filter-1274492040")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setReadMask(FieldMask.newBuilder().build())
* .build();
* for (ModelMonitoringJob element :
* modelMonitoringServiceClient.listModelMonitoringJobs(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 ListModelMonitoringJobsPagedResponse listModelMonitoringJobs(
ListModelMonitoringJobsRequest request) {
return listModelMonitoringJobsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelMonitoringJobs. Callers may choose to read across multiple Monitors as per
* [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard
* character instead of modelMonitor id in the parent. Format
* `projects/{project_id}/locations/{location}/moodelMonitors/-/modelMonitoringJobs`
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ListModelMonitoringJobsRequest request =
* ListModelMonitoringJobsRequest.newBuilder()
* .setParent(
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setFilter("filter-1274492040")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setReadMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.listModelMonitoringJobsPagedCallable().futureCall(request);
* // Do something.
* for (ModelMonitoringJob element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*/
public final UnaryCallable
listModelMonitoringJobsPagedCallable() {
return stub.listModelMonitoringJobsPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelMonitoringJobs. Callers may choose to read across multiple Monitors as per
* [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard
* character instead of modelMonitor id in the parent. Format
* `projects/{project_id}/locations/{location}/moodelMonitors/-/modelMonitoringJobs`
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ListModelMonitoringJobsRequest request =
* ListModelMonitoringJobsRequest.newBuilder()
* .setParent(
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setFilter("filter-1274492040")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setReadMask(FieldMask.newBuilder().build())
* .build();
* while (true) {
* ListModelMonitoringJobsResponse response =
* modelMonitoringServiceClient.listModelMonitoringJobsCallable().call(request);
* for (ModelMonitoringJob element : response.getModelMonitoringJobsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }
*/
public final UnaryCallable
listModelMonitoringJobsCallable() {
return stub.listModelMonitoringJobsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ModelMonitoringJobName name =
* ModelMonitoringJobName.of(
* "[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]", "[MODEL_MONITORING_JOB]");
* modelMonitoringServiceClient.deleteModelMonitoringJobAsync(name).get();
* }
* }
*
* @param name Required. The resource name of the model monitoring job to delete. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}/modelMonitoringJobs/{model_monitoring_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteModelMonitoringJobAsync(
ModelMonitoringJobName name) {
DeleteModelMonitoringJobRequest request =
DeleteModelMonitoringJobRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
return deleteModelMonitoringJobAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* String name =
* ModelMonitoringJobName.of(
* "[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]", "[MODEL_MONITORING_JOB]")
* .toString();
* modelMonitoringServiceClient.deleteModelMonitoringJobAsync(name).get();
* }
* }
*
* @param name Required. The resource name of the model monitoring job to delete. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}/modelMonitoringJobs/{model_monitoring_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteModelMonitoringJobAsync(
String name) {
DeleteModelMonitoringJobRequest request =
DeleteModelMonitoringJobRequest.newBuilder().setName(name).build();
return deleteModelMonitoringJobAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* DeleteModelMonitoringJobRequest request =
* DeleteModelMonitoringJobRequest.newBuilder()
* .setName(
* ModelMonitoringJobName.of(
* "[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]", "[MODEL_MONITORING_JOB]")
* .toString())
* .build();
* modelMonitoringServiceClient.deleteModelMonitoringJobAsync(request).get();
* }
* }
*
* @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 OperationFuture deleteModelMonitoringJobAsync(
DeleteModelMonitoringJobRequest request) {
return deleteModelMonitoringJobOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* DeleteModelMonitoringJobRequest request =
* DeleteModelMonitoringJobRequest.newBuilder()
* .setName(
* ModelMonitoringJobName.of(
* "[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]", "[MODEL_MONITORING_JOB]")
* .toString())
* .build();
* OperationFuture future =
* modelMonitoringServiceClient
* .deleteModelMonitoringJobOperationCallable()
* .futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final OperationCallable
deleteModelMonitoringJobOperationCallable() {
return stub.deleteModelMonitoringJobOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a ModelMonitoringJob.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* DeleteModelMonitoringJobRequest request =
* DeleteModelMonitoringJobRequest.newBuilder()
* .setName(
* ModelMonitoringJobName.of(
* "[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]", "[MODEL_MONITORING_JOB]")
* .toString())
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.deleteModelMonitoringJobCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final UnaryCallable
deleteModelMonitoringJobCallable() {
return stub.deleteModelMonitoringJobCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches Model Monitoring Stats generated within a given time window.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ModelMonitorName modelMonitor =
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]");
* for (ModelMonitoringStats element :
* modelMonitoringServiceClient.searchModelMonitoringStats(modelMonitor).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param modelMonitor Required. ModelMonitor resource name. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SearchModelMonitoringStatsPagedResponse searchModelMonitoringStats(
ModelMonitorName modelMonitor) {
SearchModelMonitoringStatsRequest request =
SearchModelMonitoringStatsRequest.newBuilder()
.setModelMonitor(modelMonitor == null ? null : modelMonitor.toString())
.build();
return searchModelMonitoringStats(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches Model Monitoring Stats generated within a given time window.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* String modelMonitor =
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString();
* for (ModelMonitoringStats element :
* modelMonitoringServiceClient.searchModelMonitoringStats(modelMonitor).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param modelMonitor Required. ModelMonitor resource name. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SearchModelMonitoringStatsPagedResponse searchModelMonitoringStats(
String modelMonitor) {
SearchModelMonitoringStatsRequest request =
SearchModelMonitoringStatsRequest.newBuilder().setModelMonitor(modelMonitor).build();
return searchModelMonitoringStats(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches Model Monitoring Stats generated within a given time window.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* SearchModelMonitoringStatsRequest request =
* SearchModelMonitoringStatsRequest.newBuilder()
* .setModelMonitor(
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setStatsFilter(SearchModelMonitoringStatsFilter.newBuilder().build())
* .setTimeInterval(Interval.newBuilder().build())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* for (ModelMonitoringStats element :
* modelMonitoringServiceClient.searchModelMonitoringStats(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 SearchModelMonitoringStatsPagedResponse searchModelMonitoringStats(
SearchModelMonitoringStatsRequest request) {
return searchModelMonitoringStatsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches Model Monitoring Stats generated within a given time window.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* SearchModelMonitoringStatsRequest request =
* SearchModelMonitoringStatsRequest.newBuilder()
* .setModelMonitor(
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setStatsFilter(SearchModelMonitoringStatsFilter.newBuilder().build())
* .setTimeInterval(Interval.newBuilder().build())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* ApiFuture future =
* modelMonitoringServiceClient
* .searchModelMonitoringStatsPagedCallable()
* .futureCall(request);
* // Do something.
* for (ModelMonitoringStats element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*/
public final UnaryCallable<
SearchModelMonitoringStatsRequest, SearchModelMonitoringStatsPagedResponse>
searchModelMonitoringStatsPagedCallable() {
return stub.searchModelMonitoringStatsPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches Model Monitoring Stats generated within a given time window.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* SearchModelMonitoringStatsRequest request =
* SearchModelMonitoringStatsRequest.newBuilder()
* .setModelMonitor(
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setStatsFilter(SearchModelMonitoringStatsFilter.newBuilder().build())
* .setTimeInterval(Interval.newBuilder().build())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* while (true) {
* SearchModelMonitoringStatsResponse response =
* modelMonitoringServiceClient.searchModelMonitoringStatsCallable().call(request);
* for (ModelMonitoringStats element : response.getMonitoringStatsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }
*/
public final UnaryCallable
searchModelMonitoringStatsCallable() {
return stub.searchModelMonitoringStatsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the Model Monitoring alerts.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ModelMonitorName modelMonitor =
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]");
* for (ModelMonitoringAlert element :
* modelMonitoringServiceClient.searchModelMonitoringAlerts(modelMonitor).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param modelMonitor Required. ModelMonitor resource name. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SearchModelMonitoringAlertsPagedResponse searchModelMonitoringAlerts(
ModelMonitorName modelMonitor) {
SearchModelMonitoringAlertsRequest request =
SearchModelMonitoringAlertsRequest.newBuilder()
.setModelMonitor(modelMonitor == null ? null : modelMonitor.toString())
.build();
return searchModelMonitoringAlerts(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the Model Monitoring alerts.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* String modelMonitor =
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString();
* for (ModelMonitoringAlert element :
* modelMonitoringServiceClient.searchModelMonitoringAlerts(modelMonitor).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param modelMonitor Required. ModelMonitor resource name. Format:
* `projects/{project}/locations/{location}/modelMonitors/{model_monitor}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SearchModelMonitoringAlertsPagedResponse searchModelMonitoringAlerts(
String modelMonitor) {
SearchModelMonitoringAlertsRequest request =
SearchModelMonitoringAlertsRequest.newBuilder().setModelMonitor(modelMonitor).build();
return searchModelMonitoringAlerts(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the Model Monitoring alerts.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* SearchModelMonitoringAlertsRequest request =
* SearchModelMonitoringAlertsRequest.newBuilder()
* .setModelMonitor(
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setModelMonitoringJob("modelMonitoringJob1196104108")
* .setAlertTimeInterval(Interval.newBuilder().build())
* .setStatsName("statsName-2073146422")
* .setObjectiveType("objectiveType1316845587")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* for (ModelMonitoringAlert element :
* modelMonitoringServiceClient.searchModelMonitoringAlerts(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 SearchModelMonitoringAlertsPagedResponse searchModelMonitoringAlerts(
SearchModelMonitoringAlertsRequest request) {
return searchModelMonitoringAlertsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the Model Monitoring alerts.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* SearchModelMonitoringAlertsRequest request =
* SearchModelMonitoringAlertsRequest.newBuilder()
* .setModelMonitor(
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setModelMonitoringJob("modelMonitoringJob1196104108")
* .setAlertTimeInterval(Interval.newBuilder().build())
* .setStatsName("statsName-2073146422")
* .setObjectiveType("objectiveType1316845587")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* ApiFuture future =
* modelMonitoringServiceClient
* .searchModelMonitoringAlertsPagedCallable()
* .futureCall(request);
* // Do something.
* for (ModelMonitoringAlert element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*/
public final UnaryCallable<
SearchModelMonitoringAlertsRequest, SearchModelMonitoringAlertsPagedResponse>
searchModelMonitoringAlertsPagedCallable() {
return stub.searchModelMonitoringAlertsPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the Model Monitoring alerts.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* SearchModelMonitoringAlertsRequest request =
* SearchModelMonitoringAlertsRequest.newBuilder()
* .setModelMonitor(
* ModelMonitorName.of("[PROJECT]", "[LOCATION]", "[MODEL_MONITOR]").toString())
* .setModelMonitoringJob("modelMonitoringJob1196104108")
* .setAlertTimeInterval(Interval.newBuilder().build())
* .setStatsName("statsName-2073146422")
* .setObjectiveType("objectiveType1316845587")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* while (true) {
* SearchModelMonitoringAlertsResponse response =
* modelMonitoringServiceClient.searchModelMonitoringAlertsCallable().call(request);
* for (ModelMonitoringAlert element : response.getModelMonitoringAlertsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }
*/
public final UnaryCallable<
SearchModelMonitoringAlertsRequest, SearchModelMonitoringAlertsResponse>
searchModelMonitoringAlertsCallable() {
return stub.searchModelMonitoringAlertsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists information about the supported locations for this service.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ListLocationsRequest request =
* ListLocationsRequest.newBuilder()
* .setName("name3373707")
* .setFilter("filter-1274492040")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* for (Location element : modelMonitoringServiceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
return listLocationsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists information about the supported locations for this service.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ListLocationsRequest request =
* ListLocationsRequest.newBuilder()
* .setName("name3373707")
* .setFilter("filter-1274492040")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.listLocationsPagedCallable().futureCall(request);
* // Do something.
* for (Location element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*/
public final UnaryCallable
listLocationsPagedCallable() {
return stub.listLocationsPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists information about the supported locations for this service.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* ListLocationsRequest request =
* ListLocationsRequest.newBuilder()
* .setName("name3373707")
* .setFilter("filter-1274492040")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* while (true) {
* ListLocationsResponse response =
* modelMonitoringServiceClient.listLocationsCallable().call(request);
* for (Location element : response.getLocationsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }
*/
public final UnaryCallable listLocationsCallable() {
return stub.listLocationsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets information about a location.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
* Location response = modelMonitoringServiceClient.getLocation(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 Location getLocation(GetLocationRequest request) {
return getLocationCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets information about a location.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
* ApiFuture future =
* modelMonitoringServiceClient.getLocationCallable().futureCall(request);
* // Do something.
* Location response = future.get();
* }
* }
*/
public final UnaryCallable getLocationCallable() {
return stub.getLocationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Sets the access control policy on the specified resource. Replacesany existing policy.
*
* Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
*
*
Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* Policy response = modelMonitoringServiceClient.setIamPolicy(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 Policy setIamPolicy(SetIamPolicyRequest request) {
return setIamPolicyCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Sets the access control policy on the specified resource. Replacesany existing policy.
*
* Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
*
*
Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.setIamPolicyCallable().futureCall(request);
* // Do something.
* Policy response = future.get();
* }
* }
*/
public final UnaryCallable setIamPolicyCallable() {
return stub.setIamPolicyCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the access control policy for a resource. Returns an empty policyif the resource exists
* and does not have a policy set.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* Policy response = modelMonitoringServiceClient.getIamPolicy(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 Policy getIamPolicy(GetIamPolicyRequest request) {
return getIamPolicyCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the access control policy for a resource. Returns an empty policyif the resource exists
* and does not have a policy set.
*
* Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.getIamPolicyCallable().futureCall(request);
* // Do something.
* Policy response = future.get();
* }
* }
*/
public final UnaryCallable getIamPolicyCallable() {
return stub.getIamPolicyCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns permissions that a caller has on the specified resource. If theresource does not exist,
* this will return an empty set ofpermissions, not a `NOT_FOUND` error.
*
* Note: This operation is designed to be used for buildingpermission-aware UIs and
* command-line tools, not for authorizationchecking. This operation may "fail open" without
* warning.
*
*
Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .addAllPermissions(new ArrayList())
* .build();
* TestIamPermissionsResponse response =
* modelMonitoringServiceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
return testIamPermissionsCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns permissions that a caller has on the specified resource. If theresource does not exist,
* this will return an empty set ofpermissions, not a `NOT_FOUND` error.
*
* Note: This operation is designed to be used for buildingpermission-aware UIs and
* command-line tools, not for authorizationchecking. This operation may "fail open" without
* warning.
*
*
Sample code:
*
*
{@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 (ModelMonitoringServiceClient modelMonitoringServiceClient =
* ModelMonitoringServiceClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .addAllPermissions(new ArrayList())
* .build();
* ApiFuture future =
* modelMonitoringServiceClient.testIamPermissionsCallable().futureCall(request);
* // Do something.
* TestIamPermissionsResponse response = future.get();
* }
* }
*/
public final UnaryCallable
testIamPermissionsCallable() {
return stub.testIamPermissionsCallable();
}
@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 ListModelMonitorsPagedResponse
extends AbstractPagedListResponse<
ListModelMonitorsRequest,
ListModelMonitorsResponse,
ModelMonitor,
ListModelMonitorsPage,
ListModelMonitorsFixedSizeCollection> {
public static ApiFuture createAsync(
PageContext context,
ApiFuture futureResponse) {
ApiFuture futurePage =
ListModelMonitorsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
input -> new ListModelMonitorsPagedResponse(input),
MoreExecutors.directExecutor());
}
private ListModelMonitorsPagedResponse(ListModelMonitorsPage page) {
super(page, ListModelMonitorsFixedSizeCollection.createEmptyCollection());
}
}
public static class ListModelMonitorsPage
extends AbstractPage<
ListModelMonitorsRequest,
ListModelMonitorsResponse,
ModelMonitor,
ListModelMonitorsPage> {
private ListModelMonitorsPage(
PageContext context,
ListModelMonitorsResponse response) {
super(context, response);
}
private static ListModelMonitorsPage createEmptyPage() {
return new ListModelMonitorsPage(null, null);
}
@Override
protected ListModelMonitorsPage createPage(
PageContext context,
ListModelMonitorsResponse response) {
return new ListModelMonitorsPage(context, response);
}
@Override
public ApiFuture createPageAsync(
PageContext context,
ApiFuture futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}
public static class ListModelMonitorsFixedSizeCollection
extends AbstractFixedSizeCollection<
ListModelMonitorsRequest,
ListModelMonitorsResponse,
ModelMonitor,
ListModelMonitorsPage,
ListModelMonitorsFixedSizeCollection> {
private ListModelMonitorsFixedSizeCollection(
List pages, int collectionSize) {
super(pages, collectionSize);
}
private static ListModelMonitorsFixedSizeCollection createEmptyCollection() {
return new ListModelMonitorsFixedSizeCollection(null, 0);
}
@Override
protected ListModelMonitorsFixedSizeCollection createCollection(
List pages, int collectionSize) {
return new ListModelMonitorsFixedSizeCollection(pages, collectionSize);
}
}
public static class ListModelMonitoringJobsPagedResponse
extends AbstractPagedListResponse<
ListModelMonitoringJobsRequest,
ListModelMonitoringJobsResponse,
ModelMonitoringJob,
ListModelMonitoringJobsPage,
ListModelMonitoringJobsFixedSizeCollection> {
public static ApiFuture createAsync(
PageContext<
ListModelMonitoringJobsRequest, ListModelMonitoringJobsResponse, ModelMonitoringJob>
context,
ApiFuture futureResponse) {
ApiFuture futurePage =
ListModelMonitoringJobsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
input -> new ListModelMonitoringJobsPagedResponse(input),
MoreExecutors.directExecutor());
}
private ListModelMonitoringJobsPagedResponse(ListModelMonitoringJobsPage page) {
super(page, ListModelMonitoringJobsFixedSizeCollection.createEmptyCollection());
}
}
public static class ListModelMonitoringJobsPage
extends AbstractPage<
ListModelMonitoringJobsRequest,
ListModelMonitoringJobsResponse,
ModelMonitoringJob,
ListModelMonitoringJobsPage> {
private ListModelMonitoringJobsPage(
PageContext<
ListModelMonitoringJobsRequest, ListModelMonitoringJobsResponse, ModelMonitoringJob>
context,
ListModelMonitoringJobsResponse response) {
super(context, response);
}
private static ListModelMonitoringJobsPage createEmptyPage() {
return new ListModelMonitoringJobsPage(null, null);
}
@Override
protected ListModelMonitoringJobsPage createPage(
PageContext<
ListModelMonitoringJobsRequest, ListModelMonitoringJobsResponse, ModelMonitoringJob>
context,
ListModelMonitoringJobsResponse response) {
return new ListModelMonitoringJobsPage(context, response);
}
@Override
public ApiFuture createPageAsync(
PageContext<
ListModelMonitoringJobsRequest, ListModelMonitoringJobsResponse, ModelMonitoringJob>
context,
ApiFuture futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}
public static class ListModelMonitoringJobsFixedSizeCollection
extends AbstractFixedSizeCollection<
ListModelMonitoringJobsRequest,
ListModelMonitoringJobsResponse,
ModelMonitoringJob,
ListModelMonitoringJobsPage,
ListModelMonitoringJobsFixedSizeCollection> {
private ListModelMonitoringJobsFixedSizeCollection(
List pages, int collectionSize) {
super(pages, collectionSize);
}
private static ListModelMonitoringJobsFixedSizeCollection createEmptyCollection() {
return new ListModelMonitoringJobsFixedSizeCollection(null, 0);
}
@Override
protected ListModelMonitoringJobsFixedSizeCollection createCollection(
List pages, int collectionSize) {
return new ListModelMonitoringJobsFixedSizeCollection(pages, collectionSize);
}
}
public static class SearchModelMonitoringStatsPagedResponse
extends AbstractPagedListResponse<
SearchModelMonitoringStatsRequest,
SearchModelMonitoringStatsResponse,
ModelMonitoringStats,
SearchModelMonitoringStatsPage,
SearchModelMonitoringStatsFixedSizeCollection> {
public static ApiFuture createAsync(
PageContext<
SearchModelMonitoringStatsRequest,
SearchModelMonitoringStatsResponse,
ModelMonitoringStats>
context,
ApiFuture futureResponse) {
ApiFuture futurePage =
SearchModelMonitoringStatsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
input -> new SearchModelMonitoringStatsPagedResponse(input),
MoreExecutors.directExecutor());
}
private SearchModelMonitoringStatsPagedResponse(SearchModelMonitoringStatsPage page) {
super(page, SearchModelMonitoringStatsFixedSizeCollection.createEmptyCollection());
}
}
public static class SearchModelMonitoringStatsPage
extends AbstractPage<
SearchModelMonitoringStatsRequest,
SearchModelMonitoringStatsResponse,
ModelMonitoringStats,
SearchModelMonitoringStatsPage> {
private SearchModelMonitoringStatsPage(
PageContext<
SearchModelMonitoringStatsRequest,
SearchModelMonitoringStatsResponse,
ModelMonitoringStats>
context,
SearchModelMonitoringStatsResponse response) {
super(context, response);
}
private static SearchModelMonitoringStatsPage createEmptyPage() {
return new SearchModelMonitoringStatsPage(null, null);
}
@Override
protected SearchModelMonitoringStatsPage createPage(
PageContext<
SearchModelMonitoringStatsRequest,
SearchModelMonitoringStatsResponse,
ModelMonitoringStats>
context,
SearchModelMonitoringStatsResponse response) {
return new SearchModelMonitoringStatsPage(context, response);
}
@Override
public ApiFuture createPageAsync(
PageContext<
SearchModelMonitoringStatsRequest,
SearchModelMonitoringStatsResponse,
ModelMonitoringStats>
context,
ApiFuture futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}
public static class SearchModelMonitoringStatsFixedSizeCollection
extends AbstractFixedSizeCollection<
SearchModelMonitoringStatsRequest,
SearchModelMonitoringStatsResponse,
ModelMonitoringStats,
SearchModelMonitoringStatsPage,
SearchModelMonitoringStatsFixedSizeCollection> {
private SearchModelMonitoringStatsFixedSizeCollection(
List pages, int collectionSize) {
super(pages, collectionSize);
}
private static SearchModelMonitoringStatsFixedSizeCollection createEmptyCollection() {
return new SearchModelMonitoringStatsFixedSizeCollection(null, 0);
}
@Override
protected SearchModelMonitoringStatsFixedSizeCollection createCollection(
List pages, int collectionSize) {
return new SearchModelMonitoringStatsFixedSizeCollection(pages, collectionSize);
}
}
public static class SearchModelMonitoringAlertsPagedResponse
extends AbstractPagedListResponse<
SearchModelMonitoringAlertsRequest,
SearchModelMonitoringAlertsResponse,
ModelMonitoringAlert,
SearchModelMonitoringAlertsPage,
SearchModelMonitoringAlertsFixedSizeCollection> {
public static ApiFuture createAsync(
PageContext<
SearchModelMonitoringAlertsRequest,
SearchModelMonitoringAlertsResponse,
ModelMonitoringAlert>
context,
ApiFuture futureResponse) {
ApiFuture futurePage =
SearchModelMonitoringAlertsPage.createEmptyPage()
.createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
input -> new SearchModelMonitoringAlertsPagedResponse(input),
MoreExecutors.directExecutor());
}
private SearchModelMonitoringAlertsPagedResponse(SearchModelMonitoringAlertsPage page) {
super(page, SearchModelMonitoringAlertsFixedSizeCollection.createEmptyCollection());
}
}
public static class SearchModelMonitoringAlertsPage
extends AbstractPage<
SearchModelMonitoringAlertsRequest,
SearchModelMonitoringAlertsResponse,
ModelMonitoringAlert,
SearchModelMonitoringAlertsPage> {
private SearchModelMonitoringAlertsPage(
PageContext<
SearchModelMonitoringAlertsRequest,
SearchModelMonitoringAlertsResponse,
ModelMonitoringAlert>
context,
SearchModelMonitoringAlertsResponse response) {
super(context, response);
}
private static SearchModelMonitoringAlertsPage createEmptyPage() {
return new SearchModelMonitoringAlertsPage(null, null);
}
@Override
protected SearchModelMonitoringAlertsPage createPage(
PageContext<
SearchModelMonitoringAlertsRequest,
SearchModelMonitoringAlertsResponse,
ModelMonitoringAlert>
context,
SearchModelMonitoringAlertsResponse response) {
return new SearchModelMonitoringAlertsPage(context, response);
}
@Override
public ApiFuture createPageAsync(
PageContext<
SearchModelMonitoringAlertsRequest,
SearchModelMonitoringAlertsResponse,
ModelMonitoringAlert>
context,
ApiFuture futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}
public static class SearchModelMonitoringAlertsFixedSizeCollection
extends AbstractFixedSizeCollection<
SearchModelMonitoringAlertsRequest,
SearchModelMonitoringAlertsResponse,
ModelMonitoringAlert,
SearchModelMonitoringAlertsPage,
SearchModelMonitoringAlertsFixedSizeCollection> {
private SearchModelMonitoringAlertsFixedSizeCollection(
List pages, int collectionSize) {
super(pages, collectionSize);
}
private static SearchModelMonitoringAlertsFixedSizeCollection createEmptyCollection() {
return new SearchModelMonitoringAlertsFixedSizeCollection(null, 0);
}
@Override
protected SearchModelMonitoringAlertsFixedSizeCollection createCollection(
List pages, int collectionSize) {
return new SearchModelMonitoringAlertsFixedSizeCollection(pages, collectionSize);
}
}
public static class ListLocationsPagedResponse
extends AbstractPagedListResponse<
ListLocationsRequest,
ListLocationsResponse,
Location,
ListLocationsPage,
ListLocationsFixedSizeCollection> {
public static ApiFuture createAsync(
PageContext context,
ApiFuture futureResponse) {
ApiFuture futurePage =
ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
input -> new ListLocationsPagedResponse(input),
MoreExecutors.directExecutor());
}
private ListLocationsPagedResponse(ListLocationsPage page) {
super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
}
}
public static class ListLocationsPage
extends AbstractPage<
ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
private ListLocationsPage(
PageContext context,
ListLocationsResponse response) {
super(context, response);
}
private static ListLocationsPage createEmptyPage() {
return new ListLocationsPage(null, null);
}
@Override
protected ListLocationsPage createPage(
PageContext context,
ListLocationsResponse response) {
return new ListLocationsPage(context, response);
}
@Override
public ApiFuture createPageAsync(
PageContext context,
ApiFuture futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}
public static class ListLocationsFixedSizeCollection
extends AbstractFixedSizeCollection<
ListLocationsRequest,
ListLocationsResponse,
Location,
ListLocationsPage,
ListLocationsFixedSizeCollection> {
private ListLocationsFixedSizeCollection(List pages, int collectionSize) {
super(pages, collectionSize);
}
private static ListLocationsFixedSizeCollection createEmptyCollection() {
return new ListLocationsFixedSizeCollection(null, 0);
}
@Override
protected ListLocationsFixedSizeCollection createCollection(
List pages, int collectionSize) {
return new ListLocationsFixedSizeCollection(pages, collectionSize);
}
}
}