All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.notebooks.v1.NotebookServiceClient Maven / Gradle / Ivy

Go to download

is a managed service that offers an integrated and secure JupyterLab environment for data scientists and machine learning developers to experiment, develop, and deploy models into production. Users can create instances running JupyterLab that come pre-installed with the latest data science and machine learning frameworks in a single click.

There is a newer version: 1.54.0
Show newest version
/*
 * 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.notebooks.v1;

import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
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.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.cloud.notebooks.v1.stub.NotebookServiceStub;
import com.google.cloud.notebooks.v1.stub.NotebookServiceStubSettings;
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 java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * Service Description: API v1 service for Cloud AI Platform Notebooks.
 *
 * 

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
 *   String name = "name3373707";
 *   Instance response = notebookServiceClient.getInstance(name);
 * }
 * }
* *

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

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Methods
MethodDescriptionMethod Variants

ListInstances

Lists instances in a given project and location.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • listInstances(ListInstancesRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • listInstances(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.

*
    *
  • listInstancesPagedCallable() *

  • listInstancesCallable() *

*

GetInstance

Gets details of a single Instance.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getInstance(GetInstanceRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • getInstance(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.

*
    *
  • getInstanceCallable() *

*

CreateInstance

Creates a new Instance in a given project and location.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • createInstanceAsync(CreateInstanceRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • createInstanceAsync(String parent, Instance instance, String instanceId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • createInstanceOperationCallable() *

  • createInstanceCallable() *

*

RegisterInstance

Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances are instances created with the legacy Compute Engine calls. They are not manageable by the Notebooks API out of the box. This call makes these instances manageable by the Notebooks API.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • registerInstanceAsync(RegisterInstanceRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • registerInstanceOperationCallable() *

  • registerInstanceCallable() *

*

SetInstanceAccelerator

Updates the guest accelerators of a single Instance.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • setInstanceAcceleratorAsync(SetInstanceAcceleratorRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • setInstanceAcceleratorOperationCallable() *

  • setInstanceAcceleratorCallable() *

*

SetInstanceMachineType

Updates the machine type of a single Instance.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • setInstanceMachineTypeAsync(SetInstanceMachineTypeRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • setInstanceMachineTypeOperationCallable() *

  • setInstanceMachineTypeCallable() *

*

UpdateInstanceConfig

Update Notebook Instance configurations.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • updateInstanceConfigAsync(UpdateInstanceConfigRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • updateInstanceConfigOperationCallable() *

  • updateInstanceConfigCallable() *

*

UpdateShieldedInstanceConfig

Updates the Shielded instance configuration of a single Instance.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • updateShieldedInstanceConfigAsync(UpdateShieldedInstanceConfigRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • updateShieldedInstanceConfigOperationCallable() *

  • updateShieldedInstanceConfigCallable() *

*

SetInstanceLabels

Replaces all the labels of an Instance.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • setInstanceLabelsAsync(SetInstanceLabelsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • setInstanceLabelsOperationCallable() *

  • setInstanceLabelsCallable() *

*

UpdateInstanceMetadataItems

Add/update metadata items for an instance.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • updateInstanceMetadataItems(UpdateInstanceMetadataItemsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • updateInstanceMetadataItemsCallable() *

*

DeleteInstance

Deletes a single Instance.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • deleteInstanceAsync(DeleteInstanceRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • deleteInstanceAsync(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.

*
    *
  • deleteInstanceOperationCallable() *

  • deleteInstanceCallable() *

*

StartInstance

Starts a notebook instance.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • startInstanceAsync(StartInstanceRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • startInstanceOperationCallable() *

  • startInstanceCallable() *

*

StopInstance

Stops a notebook instance.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • stopInstanceAsync(StopInstanceRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • stopInstanceOperationCallable() *

  • stopInstanceCallable() *

*

ResetInstance

Resets a notebook instance.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • resetInstanceAsync(ResetInstanceRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • resetInstanceOperationCallable() *

  • resetInstanceCallable() *

*

ReportInstanceInfo

Allows notebook instances to report their latest instance information to the Notebooks API server. The server will merge the reported information to the instance metadata store. Do not use this method directly.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • reportInstanceInfoAsync(ReportInstanceInfoRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • reportInstanceInfoOperationCallable() *

  • reportInstanceInfoCallable() *

*

IsInstanceUpgradeable

Check if a notebook instance is upgradable.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • isInstanceUpgradeable(IsInstanceUpgradeableRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • isInstanceUpgradeableCallable() *

*

GetInstanceHealth

Check if a notebook instance is healthy.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getInstanceHealth(GetInstanceHealthRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • getInstanceHealth(InstanceName name) *

  • getInstanceHealth(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.

*
    *
  • getInstanceHealthCallable() *

*

UpgradeInstance

Upgrades a notebook instance to the latest version.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • upgradeInstanceAsync(UpgradeInstanceRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • upgradeInstanceOperationCallable() *

  • upgradeInstanceCallable() *

*

RollbackInstance

Rollbacks a notebook instance to the previous version.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • rollbackInstanceAsync(RollbackInstanceRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • rollbackInstanceOperationCallable() *

  • rollbackInstanceCallable() *

*

DiagnoseInstance

Creates a Diagnostic File and runs Diagnostic Tool given an Instance.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • diagnoseInstanceAsync(DiagnoseInstanceRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • diagnoseInstanceAsync(InstanceName name, DiagnosticConfig diagnosticConfig) *

  • diagnoseInstanceAsync(String name, DiagnosticConfig diagnosticConfig) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • diagnoseInstanceOperationCallable() *

  • diagnoseInstanceCallable() *

*

UpgradeInstanceInternal

Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • upgradeInstanceInternalAsync(UpgradeInstanceInternalRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • upgradeInstanceInternalOperationCallable() *

  • upgradeInstanceInternalCallable() *

*

ListEnvironments

Lists environments in a project.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • listEnvironments(ListEnvironmentsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • listEnvironments(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.

*
    *
  • listEnvironmentsPagedCallable() *

  • listEnvironmentsCallable() *

*

GetEnvironment

Gets details of a single Environment.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getEnvironment(GetEnvironmentRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • getEnvironment(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.

*
    *
  • getEnvironmentCallable() *

*

CreateEnvironment

Creates a new Environment.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • createEnvironmentAsync(CreateEnvironmentRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • createEnvironmentAsync(String parent, Environment environment, String environmentId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • createEnvironmentOperationCallable() *

  • createEnvironmentCallable() *

*

DeleteEnvironment

Deletes a single Environment.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • deleteEnvironmentAsync(DeleteEnvironmentRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • deleteEnvironmentAsync(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.

*
    *
  • deleteEnvironmentOperationCallable() *

  • deleteEnvironmentCallable() *

*

ListSchedules

Lists schedules in a given project and location.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • listSchedules(ListSchedulesRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • listSchedules(ScheduleName parent) *

  • listSchedules(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.

*
    *
  • listSchedulesPagedCallable() *

  • listSchedulesCallable() *

*

GetSchedule

Gets details of schedule

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getSchedule(GetScheduleRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • getSchedule(ScheduleName name) *

  • getSchedule(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.

*
    *
  • getScheduleCallable() *

*

DeleteSchedule

Deletes schedule and all underlying jobs

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • deleteScheduleAsync(DeleteScheduleRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • deleteScheduleAsync(ScheduleName name) *

  • deleteScheduleAsync(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.

*
    *
  • deleteScheduleOperationCallable() *

  • deleteScheduleCallable() *

*

CreateSchedule

Creates a new Scheduled Notebook in a given project and location.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • createScheduleAsync(CreateScheduleRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • createScheduleAsync(ScheduleName parent, Schedule schedule, String scheduleId) *

  • createScheduleAsync(String parent, Schedule schedule, String scheduleId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • createScheduleOperationCallable() *

  • createScheduleCallable() *

*

TriggerSchedule

Triggers execution of an existing schedule.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • triggerScheduleAsync(TriggerScheduleRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • triggerScheduleOperationCallable() *

  • triggerScheduleCallable() *

*

ListExecutions

Lists executions in a given project and location

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • listExecutions(ListExecutionsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • listExecutions(ExecutionName parent) *

  • listExecutions(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.

*
    *
  • listExecutionsPagedCallable() *

  • listExecutionsCallable() *

*

GetExecution

Gets details of executions

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getExecution(GetExecutionRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • getExecution(ExecutionName name) *

  • getExecution(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.

*
    *
  • getExecutionCallable() *

*

DeleteExecution

Deletes execution

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • deleteExecutionAsync(DeleteExecutionRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • deleteExecutionAsync(ExecutionName name) *

  • deleteExecutionAsync(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.

*
    *
  • deleteExecutionOperationCallable() *

  • deleteExecutionCallable() *

*

CreateExecution

Creates a new Execution in a given project and location.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • createExecutionAsync(CreateExecutionRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    *
  • createExecutionAsync(ExecutionName parent, Execution execution, String executionId) *

  • createExecutionAsync(String parent, Execution execution, String executionId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • createExecutionOperationCallable() *

  • createExecutionCallable() *

*

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 NotebookServiceSettings 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
 * NotebookServiceSettings notebookServiceSettings =
 *     NotebookServiceSettings.newBuilder()
 *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
 *         .build();
 * NotebookServiceClient notebookServiceClient =
 *     NotebookServiceClient.create(notebookServiceSettings);
 * }
* *

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
 * NotebookServiceSettings notebookServiceSettings =
 *     NotebookServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 * NotebookServiceClient notebookServiceClient =
 *     NotebookServiceClient.create(notebookServiceSettings);
 * }
* *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class NotebookServiceClient implements BackgroundResource { private final NotebookServiceSettings settings; private final NotebookServiceStub stub; private final OperationsClient operationsClient; /** Constructs an instance of NotebookServiceClient with default settings. */ public static final NotebookServiceClient create() throws IOException { return create(NotebookServiceSettings.newBuilder().build()); } /** * Constructs an instance of NotebookServiceClient, 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 NotebookServiceClient create(NotebookServiceSettings settings) throws IOException { return new NotebookServiceClient(settings); } /** * Constructs an instance of NotebookServiceClient, using the given stub for making calls. This is * for advanced usage - prefer using create(NotebookServiceSettings). */ public static final NotebookServiceClient create(NotebookServiceStub stub) { return new NotebookServiceClient(stub); } /** * Constructs an instance of NotebookServiceClient, 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 NotebookServiceClient(NotebookServiceSettings settings) throws IOException { this.settings = settings; this.stub = ((NotebookServiceStubSettings) settings.getStubSettings()).createStub(); this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); } protected NotebookServiceClient(NotebookServiceStub stub) { this.settings = null; this.stub = stub; this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); } public final NotebookServiceSettings getSettings() { return settings; } public NotebookServiceStub 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. /** * Lists instances in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String parent = "parent-995424086";
   *   for (Instance element : notebookServiceClient.listInstances(parent).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListInstancesPagedResponse listInstances(String parent) { ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); return listInstances(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists instances in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListInstancesRequest request =
   *       ListInstancesRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   for (Instance element : notebookServiceClient.listInstances(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 ListInstancesPagedResponse listInstances(ListInstancesRequest request) { return listInstancesPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists instances in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListInstancesRequest request =
   *       ListInstancesRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.listInstancesPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Instance element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listInstancesPagedCallable() { return stub.listInstancesPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists instances in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListInstancesRequest request =
   *       ListInstancesRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   while (true) {
   *     ListInstancesResponse response =
   *         notebookServiceClient.listInstancesCallable().call(request);
   *     for (Instance element : response.getInstancesList()) {
   *       // doThingsWith(element);
   *     }
   *     String nextPageToken = response.getNextPageToken();
   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
   *       request = request.toBuilder().setPageToken(nextPageToken).build();
   *     } else {
   *       break;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable listInstancesCallable() { return stub.listInstancesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String name = "name3373707";
   *   Instance response = notebookServiceClient.getInstance(name);
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/instances/{instance_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Instance getInstance(String name) { GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build(); return getInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetInstanceRequest request = GetInstanceRequest.newBuilder().setName("name3373707").build();
   *   Instance response = notebookServiceClient.getInstance(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 Instance getInstance(GetInstanceRequest request) { return getInstanceCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetInstanceRequest request = GetInstanceRequest.newBuilder().setName("name3373707").build();
   *   ApiFuture future = notebookServiceClient.getInstanceCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final UnaryCallable getInstanceCallable() { return stub.getInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Instance in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String parent = "parent-995424086";
   *   Instance instance = Instance.newBuilder().build();
   *   String instanceId = "instanceId902024336";
   *   Instance response =
   *       notebookServiceClient.createInstanceAsync(parent, instance, instanceId).get();
   * }
   * }
* * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}` * @param instance Required. The instance to be created. * @param instanceId Required. User-defined unique ID of this instance. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createInstanceAsync( String parent, Instance instance, String instanceId) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() .setParent(parent) .setInstance(instance) .setInstanceId(instanceId) .build(); return createInstanceAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Instance in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateInstanceRequest request =
   *       CreateInstanceRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setInstanceId("instanceId902024336")
   *           .setInstance(Instance.newBuilder().build())
   *           .build();
   *   Instance response = notebookServiceClient.createInstanceAsync(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 createInstanceAsync( CreateInstanceRequest request) { return createInstanceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Instance in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateInstanceRequest request =
   *       CreateInstanceRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setInstanceId("instanceId902024336")
   *           .setInstance(Instance.newBuilder().build())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.createInstanceOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable createInstanceOperationCallable() { return stub.createInstanceOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Instance in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateInstanceRequest request =
   *       CreateInstanceRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setInstanceId("instanceId902024336")
   *           .setInstance(Instance.newBuilder().build())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.createInstanceCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable createInstanceCallable() { return stub.createInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances * are instances created with the legacy Compute Engine calls. They are not manageable by the * Notebooks API out of the box. This call makes these instances manageable by the Notebooks API. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   RegisterInstanceRequest request =
   *       RegisterInstanceRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setInstanceId("instanceId902024336")
   *           .build();
   *   Instance response = notebookServiceClient.registerInstanceAsync(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 registerInstanceAsync( RegisterInstanceRequest request) { return registerInstanceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances * are instances created with the legacy Compute Engine calls. They are not manageable by the * Notebooks API out of the box. This call makes these instances manageable by the Notebooks API. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   RegisterInstanceRequest request =
   *       RegisterInstanceRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setInstanceId("instanceId902024336")
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.registerInstanceOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable registerInstanceOperationCallable() { return stub.registerInstanceOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances * are instances created with the legacy Compute Engine calls. They are not manageable by the * Notebooks API out of the box. This call makes these instances manageable by the Notebooks API. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   RegisterInstanceRequest request =
   *       RegisterInstanceRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setInstanceId("instanceId902024336")
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.registerInstanceCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable registerInstanceCallable() { return stub.registerInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the guest accelerators of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   SetInstanceAcceleratorRequest request =
   *       SetInstanceAcceleratorRequest.newBuilder()
   *           .setName("name3373707")
   *           .setCoreCount(-1963855761)
   *           .build();
   *   Instance response = notebookServiceClient.setInstanceAcceleratorAsync(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 setInstanceAcceleratorAsync( SetInstanceAcceleratorRequest request) { return setInstanceAcceleratorOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the guest accelerators of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   SetInstanceAcceleratorRequest request =
   *       SetInstanceAcceleratorRequest.newBuilder()
   *           .setName("name3373707")
   *           .setCoreCount(-1963855761)
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.setInstanceAcceleratorOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable setInstanceAcceleratorOperationCallable() { return stub.setInstanceAcceleratorOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the guest accelerators of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   SetInstanceAcceleratorRequest request =
   *       SetInstanceAcceleratorRequest.newBuilder()
   *           .setName("name3373707")
   *           .setCoreCount(-1963855761)
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.setInstanceAcceleratorCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable setInstanceAcceleratorCallable() { return stub.setInstanceAcceleratorCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the machine type of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   SetInstanceMachineTypeRequest request =
   *       SetInstanceMachineTypeRequest.newBuilder()
   *           .setName("name3373707")
   *           .setMachineType("machineType-218117087")
   *           .build();
   *   Instance response = notebookServiceClient.setInstanceMachineTypeAsync(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 setInstanceMachineTypeAsync( SetInstanceMachineTypeRequest request) { return setInstanceMachineTypeOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the machine type of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   SetInstanceMachineTypeRequest request =
   *       SetInstanceMachineTypeRequest.newBuilder()
   *           .setName("name3373707")
   *           .setMachineType("machineType-218117087")
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.setInstanceMachineTypeOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable setInstanceMachineTypeOperationCallable() { return stub.setInstanceMachineTypeOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the machine type of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   SetInstanceMachineTypeRequest request =
   *       SetInstanceMachineTypeRequest.newBuilder()
   *           .setName("name3373707")
   *           .setMachineType("machineType-218117087")
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.setInstanceMachineTypeCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable setInstanceMachineTypeCallable() { return stub.setInstanceMachineTypeCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update Notebook Instance configurations. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpdateInstanceConfigRequest request =
   *       UpdateInstanceConfigRequest.newBuilder()
   *           .setName("name3373707")
   *           .setConfig(InstanceConfig.newBuilder().build())
   *           .build();
   *   Instance response = notebookServiceClient.updateInstanceConfigAsync(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 updateInstanceConfigAsync( UpdateInstanceConfigRequest request) { return updateInstanceConfigOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update Notebook Instance configurations. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpdateInstanceConfigRequest request =
   *       UpdateInstanceConfigRequest.newBuilder()
   *           .setName("name3373707")
   *           .setConfig(InstanceConfig.newBuilder().build())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.updateInstanceConfigOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable updateInstanceConfigOperationCallable() { return stub.updateInstanceConfigOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update Notebook Instance configurations. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpdateInstanceConfigRequest request =
   *       UpdateInstanceConfigRequest.newBuilder()
   *           .setName("name3373707")
   *           .setConfig(InstanceConfig.newBuilder().build())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.updateInstanceConfigCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable updateInstanceConfigCallable() { return stub.updateInstanceConfigCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the Shielded instance configuration of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpdateShieldedInstanceConfigRequest request =
   *       UpdateShieldedInstanceConfigRequest.newBuilder()
   *           .setName("name3373707")
   *           .setShieldedInstanceConfig(Instance.ShieldedInstanceConfig.newBuilder().build())
   *           .build();
   *   Instance response = notebookServiceClient.updateShieldedInstanceConfigAsync(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 updateShieldedInstanceConfigAsync( UpdateShieldedInstanceConfigRequest request) { return updateShieldedInstanceConfigOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the Shielded instance configuration of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpdateShieldedInstanceConfigRequest request =
   *       UpdateShieldedInstanceConfigRequest.newBuilder()
   *           .setName("name3373707")
   *           .setShieldedInstanceConfig(Instance.ShieldedInstanceConfig.newBuilder().build())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.updateShieldedInstanceConfigOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable updateShieldedInstanceConfigOperationCallable() { return stub.updateShieldedInstanceConfigOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the Shielded instance configuration of a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpdateShieldedInstanceConfigRequest request =
   *       UpdateShieldedInstanceConfigRequest.newBuilder()
   *           .setName("name3373707")
   *           .setShieldedInstanceConfig(Instance.ShieldedInstanceConfig.newBuilder().build())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.updateShieldedInstanceConfigCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable updateShieldedInstanceConfigCallable() { return stub.updateShieldedInstanceConfigCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Replaces all the labels of an Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   SetInstanceLabelsRequest request =
   *       SetInstanceLabelsRequest.newBuilder()
   *           .setName("name3373707")
   *           .putAllLabels(new HashMap())
   *           .build();
   *   Instance response = notebookServiceClient.setInstanceLabelsAsync(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 setInstanceLabelsAsync( SetInstanceLabelsRequest request) { return setInstanceLabelsOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Replaces all the labels of an Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   SetInstanceLabelsRequest request =
   *       SetInstanceLabelsRequest.newBuilder()
   *           .setName("name3373707")
   *           .putAllLabels(new HashMap())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.setInstanceLabelsOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable setInstanceLabelsOperationCallable() { return stub.setInstanceLabelsOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Replaces all the labels of an Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   SetInstanceLabelsRequest request =
   *       SetInstanceLabelsRequest.newBuilder()
   *           .setName("name3373707")
   *           .putAllLabels(new HashMap())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.setInstanceLabelsCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable setInstanceLabelsCallable() { return stub.setInstanceLabelsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Add/update metadata items for an instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpdateInstanceMetadataItemsRequest request =
   *       UpdateInstanceMetadataItemsRequest.newBuilder()
   *           .setName("name3373707")
   *           .putAllItems(new HashMap())
   *           .build();
   *   UpdateInstanceMetadataItemsResponse response =
   *       notebookServiceClient.updateInstanceMetadataItems(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 UpdateInstanceMetadataItemsResponse updateInstanceMetadataItems( UpdateInstanceMetadataItemsRequest request) { return updateInstanceMetadataItemsCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Add/update metadata items for an instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpdateInstanceMetadataItemsRequest request =
   *       UpdateInstanceMetadataItemsRequest.newBuilder()
   *           .setName("name3373707")
   *           .putAllItems(new HashMap())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.updateInstanceMetadataItemsCallable().futureCall(request);
   *   // Do something.
   *   UpdateInstanceMetadataItemsResponse response = future.get();
   * }
   * }
*/ public final UnaryCallable< UpdateInstanceMetadataItemsRequest, UpdateInstanceMetadataItemsResponse> updateInstanceMetadataItemsCallable() { return stub.updateInstanceMetadataItemsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String name = "name3373707";
   *   notebookServiceClient.deleteInstanceAsync(name).get();
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/instances/{instance_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteInstanceAsync(String name) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); return deleteInstanceAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteInstanceRequest request =
   *       DeleteInstanceRequest.newBuilder().setName("name3373707").build();
   *   notebookServiceClient.deleteInstanceAsync(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 deleteInstanceAsync( DeleteInstanceRequest request) { return deleteInstanceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteInstanceRequest request =
   *       DeleteInstanceRequest.newBuilder().setName("name3373707").build();
   *   OperationFuture future =
   *       notebookServiceClient.deleteInstanceOperationCallable().futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final OperationCallable deleteInstanceOperationCallable() { return stub.deleteInstanceOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a single Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteInstanceRequest request =
   *       DeleteInstanceRequest.newBuilder().setName("name3373707").build();
   *   ApiFuture future =
   *       notebookServiceClient.deleteInstanceCallable().futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final UnaryCallable deleteInstanceCallable() { return stub.deleteInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Starts a notebook instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   StartInstanceRequest request =
   *       StartInstanceRequest.newBuilder().setName("name3373707").build();
   *   Instance response = notebookServiceClient.startInstanceAsync(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 startInstanceAsync( StartInstanceRequest request) { return startInstanceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Starts a notebook instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   StartInstanceRequest request =
   *       StartInstanceRequest.newBuilder().setName("name3373707").build();
   *   OperationFuture future =
   *       notebookServiceClient.startInstanceOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable startInstanceOperationCallable() { return stub.startInstanceOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Starts a notebook instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   StartInstanceRequest request =
   *       StartInstanceRequest.newBuilder().setName("name3373707").build();
   *   ApiFuture future =
   *       notebookServiceClient.startInstanceCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable startInstanceCallable() { return stub.startInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Stops a notebook instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build();
   *   Instance response = notebookServiceClient.stopInstanceAsync(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 stopInstanceAsync( StopInstanceRequest request) { return stopInstanceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Stops a notebook instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build();
   *   OperationFuture future =
   *       notebookServiceClient.stopInstanceOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable stopInstanceOperationCallable() { return stub.stopInstanceOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Stops a notebook instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build();
   *   ApiFuture future =
   *       notebookServiceClient.stopInstanceCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable stopInstanceCallable() { return stub.stopInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Resets a notebook instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ResetInstanceRequest request =
   *       ResetInstanceRequest.newBuilder().setName("name3373707").build();
   *   Instance response = notebookServiceClient.resetInstanceAsync(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 resetInstanceAsync( ResetInstanceRequest request) { return resetInstanceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Resets a notebook instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ResetInstanceRequest request =
   *       ResetInstanceRequest.newBuilder().setName("name3373707").build();
   *   OperationFuture future =
   *       notebookServiceClient.resetInstanceOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable resetInstanceOperationCallable() { return stub.resetInstanceOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Resets a notebook instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ResetInstanceRequest request =
   *       ResetInstanceRequest.newBuilder().setName("name3373707").build();
   *   ApiFuture future =
   *       notebookServiceClient.resetInstanceCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable resetInstanceCallable() { return stub.resetInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Allows notebook instances to report their latest instance information to the Notebooks API * server. The server will merge the reported information to the instance metadata store. Do not * use this method directly. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ReportInstanceInfoRequest request =
   *       ReportInstanceInfoRequest.newBuilder()
   *           .setName("name3373707")
   *           .setVmId("vmId3622450")
   *           .putAllMetadata(new HashMap())
   *           .build();
   *   Instance response = notebookServiceClient.reportInstanceInfoAsync(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 reportInstanceInfoAsync( ReportInstanceInfoRequest request) { return reportInstanceInfoOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Allows notebook instances to report their latest instance information to the Notebooks API * server. The server will merge the reported information to the instance metadata store. Do not * use this method directly. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ReportInstanceInfoRequest request =
   *       ReportInstanceInfoRequest.newBuilder()
   *           .setName("name3373707")
   *           .setVmId("vmId3622450")
   *           .putAllMetadata(new HashMap())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.reportInstanceInfoOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable reportInstanceInfoOperationCallable() { return stub.reportInstanceInfoOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Allows notebook instances to report their latest instance information to the Notebooks API * server. The server will merge the reported information to the instance metadata store. Do not * use this method directly. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ReportInstanceInfoRequest request =
   *       ReportInstanceInfoRequest.newBuilder()
   *           .setName("name3373707")
   *           .setVmId("vmId3622450")
   *           .putAllMetadata(new HashMap())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.reportInstanceInfoCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable reportInstanceInfoCallable() { return stub.reportInstanceInfoCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Check if a notebook instance is upgradable. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   IsInstanceUpgradeableRequest request =
   *       IsInstanceUpgradeableRequest.newBuilder()
   *           .setNotebookInstance("notebookInstance-544239728")
   *           .setType(UpgradeType.forNumber(0))
   *           .build();
   *   IsInstanceUpgradeableResponse response = notebookServiceClient.isInstanceUpgradeable(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 IsInstanceUpgradeableResponse isInstanceUpgradeable( IsInstanceUpgradeableRequest request) { return isInstanceUpgradeableCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Check if a notebook instance is upgradable. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   IsInstanceUpgradeableRequest request =
   *       IsInstanceUpgradeableRequest.newBuilder()
   *           .setNotebookInstance("notebookInstance-544239728")
   *           .setType(UpgradeType.forNumber(0))
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.isInstanceUpgradeableCallable().futureCall(request);
   *   // Do something.
   *   IsInstanceUpgradeableResponse response = future.get();
   * }
   * }
*/ public final UnaryCallable isInstanceUpgradeableCallable() { return stub.isInstanceUpgradeableCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Check if a notebook instance is healthy. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
   *   GetInstanceHealthResponse response = notebookServiceClient.getInstanceHealth(name);
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/instances/{instance_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final GetInstanceHealthResponse getInstanceHealth(InstanceName name) { GetInstanceHealthRequest request = GetInstanceHealthRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return getInstanceHealth(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Check if a notebook instance is healthy. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
   *   GetInstanceHealthResponse response = notebookServiceClient.getInstanceHealth(name);
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/instances/{instance_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final GetInstanceHealthResponse getInstanceHealth(String name) { GetInstanceHealthRequest request = GetInstanceHealthRequest.newBuilder().setName(name).build(); return getInstanceHealth(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Check if a notebook instance is healthy. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetInstanceHealthRequest request =
   *       GetInstanceHealthRequest.newBuilder()
   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
   *           .build();
   *   GetInstanceHealthResponse response = notebookServiceClient.getInstanceHealth(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 GetInstanceHealthResponse getInstanceHealth(GetInstanceHealthRequest request) { return getInstanceHealthCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Check if a notebook instance is healthy. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetInstanceHealthRequest request =
   *       GetInstanceHealthRequest.newBuilder()
   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.getInstanceHealthCallable().futureCall(request);
   *   // Do something.
   *   GetInstanceHealthResponse response = future.get();
   * }
   * }
*/ public final UnaryCallable getInstanceHealthCallable() { return stub.getInstanceHealthCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Upgrades a notebook instance to the latest version. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpgradeInstanceRequest request =
   *       UpgradeInstanceRequest.newBuilder()
   *           .setName("name3373707")
   *           .setType(UpgradeType.forNumber(0))
   *           .build();
   *   Instance response = notebookServiceClient.upgradeInstanceAsync(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 upgradeInstanceAsync( UpgradeInstanceRequest request) { return upgradeInstanceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Upgrades a notebook instance to the latest version. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpgradeInstanceRequest request =
   *       UpgradeInstanceRequest.newBuilder()
   *           .setName("name3373707")
   *           .setType(UpgradeType.forNumber(0))
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.upgradeInstanceOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable upgradeInstanceOperationCallable() { return stub.upgradeInstanceOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Upgrades a notebook instance to the latest version. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpgradeInstanceRequest request =
   *       UpgradeInstanceRequest.newBuilder()
   *           .setName("name3373707")
   *           .setType(UpgradeType.forNumber(0))
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.upgradeInstanceCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable upgradeInstanceCallable() { return stub.upgradeInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Rollbacks a notebook instance to the previous version. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   RollbackInstanceRequest request =
   *       RollbackInstanceRequest.newBuilder()
   *           .setName("name3373707")
   *           .setTargetSnapshot("targetSnapshot-1307211147")
   *           .build();
   *   Instance response = notebookServiceClient.rollbackInstanceAsync(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 rollbackInstanceAsync( RollbackInstanceRequest request) { return rollbackInstanceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Rollbacks a notebook instance to the previous version. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   RollbackInstanceRequest request =
   *       RollbackInstanceRequest.newBuilder()
   *           .setName("name3373707")
   *           .setTargetSnapshot("targetSnapshot-1307211147")
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.rollbackInstanceOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable rollbackInstanceOperationCallable() { return stub.rollbackInstanceOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Rollbacks a notebook instance to the previous version. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   RollbackInstanceRequest request =
   *       RollbackInstanceRequest.newBuilder()
   *           .setName("name3373707")
   *           .setTargetSnapshot("targetSnapshot-1307211147")
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.rollbackInstanceCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable rollbackInstanceCallable() { return stub.rollbackInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a Diagnostic File and runs Diagnostic Tool given an Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
   *   DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build();
   *   Instance response = notebookServiceClient.diagnoseInstanceAsync(name, diagnosticConfig).get();
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/instances/{instance_id}` * @param diagnosticConfig Required. Defines flags that are used to run the diagnostic tool * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture diagnoseInstanceAsync( InstanceName name, DiagnosticConfig diagnosticConfig) { DiagnoseInstanceRequest request = DiagnoseInstanceRequest.newBuilder() .setName(name == null ? null : name.toString()) .setDiagnosticConfig(diagnosticConfig) .build(); return diagnoseInstanceAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a Diagnostic File and runs Diagnostic Tool given an Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
   *   DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build();
   *   Instance response = notebookServiceClient.diagnoseInstanceAsync(name, diagnosticConfig).get();
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/instances/{instance_id}` * @param diagnosticConfig Required. Defines flags that are used to run the diagnostic tool * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture diagnoseInstanceAsync( String name, DiagnosticConfig diagnosticConfig) { DiagnoseInstanceRequest request = DiagnoseInstanceRequest.newBuilder() .setName(name) .setDiagnosticConfig(diagnosticConfig) .build(); return diagnoseInstanceAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a Diagnostic File and runs Diagnostic Tool given an Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DiagnoseInstanceRequest request =
   *       DiagnoseInstanceRequest.newBuilder()
   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
   *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
   *           .build();
   *   Instance response = notebookServiceClient.diagnoseInstanceAsync(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 diagnoseInstanceAsync( DiagnoseInstanceRequest request) { return diagnoseInstanceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a Diagnostic File and runs Diagnostic Tool given an Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DiagnoseInstanceRequest request =
   *       DiagnoseInstanceRequest.newBuilder()
   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
   *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.diagnoseInstanceOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable diagnoseInstanceOperationCallable() { return stub.diagnoseInstanceOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a Diagnostic File and runs Diagnostic Tool given an Instance. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DiagnoseInstanceRequest request =
   *       DiagnoseInstanceRequest.newBuilder()
   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
   *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.diagnoseInstanceCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable diagnoseInstanceCallable() { return stub.diagnoseInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method * directly. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpgradeInstanceInternalRequest request =
   *       UpgradeInstanceInternalRequest.newBuilder()
   *           .setName("name3373707")
   *           .setVmId("vmId3622450")
   *           .setType(UpgradeType.forNumber(0))
   *           .build();
   *   Instance response = notebookServiceClient.upgradeInstanceInternalAsync(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 upgradeInstanceInternalAsync( UpgradeInstanceInternalRequest request) { return upgradeInstanceInternalOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method * directly. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpgradeInstanceInternalRequest request =
   *       UpgradeInstanceInternalRequest.newBuilder()
   *           .setName("name3373707")
   *           .setVmId("vmId3622450")
   *           .setType(UpgradeType.forNumber(0))
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.upgradeInstanceInternalOperationCallable().futureCall(request);
   *   // Do something.
   *   Instance response = future.get();
   * }
   * }
*/ public final OperationCallable upgradeInstanceInternalOperationCallable() { return stub.upgradeInstanceInternalOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method * directly. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   UpgradeInstanceInternalRequest request =
   *       UpgradeInstanceInternalRequest.newBuilder()
   *           .setName("name3373707")
   *           .setVmId("vmId3622450")
   *           .setType(UpgradeType.forNumber(0))
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.upgradeInstanceInternalCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable upgradeInstanceInternalCallable() { return stub.upgradeInstanceInternalCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists environments in a project. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String parent = "parent-995424086";
   *   for (Environment element : notebookServiceClient.listEnvironments(parent).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. Format: `projects/{project_id}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListEnvironmentsPagedResponse listEnvironments(String parent) { ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder().setParent(parent).build(); return listEnvironments(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists environments in a project. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListEnvironmentsRequest request =
   *       ListEnvironmentsRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   for (Environment element : notebookServiceClient.listEnvironments(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 ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequest request) { return listEnvironmentsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists environments in a project. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListEnvironmentsRequest request =
   *       ListEnvironmentsRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.listEnvironmentsPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Environment element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listEnvironmentsPagedCallable() { return stub.listEnvironmentsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists environments in a project. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListEnvironmentsRequest request =
   *       ListEnvironmentsRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   while (true) {
   *     ListEnvironmentsResponse response =
   *         notebookServiceClient.listEnvironmentsCallable().call(request);
   *     for (Environment element : response.getEnvironmentsList()) {
   *       // doThingsWith(element);
   *     }
   *     String nextPageToken = response.getNextPageToken();
   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
   *       request = request.toBuilder().setPageToken(nextPageToken).build();
   *     } else {
   *       break;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable listEnvironmentsCallable() { return stub.listEnvironmentsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of a single Environment. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String name = "name3373707";
   *   Environment response = notebookServiceClient.getEnvironment(name);
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/environments/{environment_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Environment getEnvironment(String name) { GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder().setName(name).build(); return getEnvironment(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of a single Environment. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetEnvironmentRequest request =
   *       GetEnvironmentRequest.newBuilder().setName("name3373707").build();
   *   Environment response = notebookServiceClient.getEnvironment(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 Environment getEnvironment(GetEnvironmentRequest request) { return getEnvironmentCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of a single Environment. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetEnvironmentRequest request =
   *       GetEnvironmentRequest.newBuilder().setName("name3373707").build();
   *   ApiFuture future =
   *       notebookServiceClient.getEnvironmentCallable().futureCall(request);
   *   // Do something.
   *   Environment response = future.get();
   * }
   * }
*/ public final UnaryCallable getEnvironmentCallable() { return stub.getEnvironmentCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Environment. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String parent = "parent-995424086";
   *   Environment environment = Environment.newBuilder().build();
   *   String environmentId = "environmentId-950205810";
   *   Environment response =
   *       notebookServiceClient.createEnvironmentAsync(parent, environment, environmentId).get();
   * }
   * }
* * @param parent Required. Format: `projects/{project_id}/locations/{location}` * @param environment Required. The environment to be created. * @param environmentId Required. User-defined unique ID of this environment. The `environment_id` * must be 1 to 63 characters long and contain only lowercase letters, numeric characters, and * dashes. The first character must be a lowercase letter and the last character cannot be a * dash. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createEnvironmentAsync( String parent, Environment environment, String environmentId) { CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder() .setParent(parent) .setEnvironment(environment) .setEnvironmentId(environmentId) .build(); return createEnvironmentAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Environment. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateEnvironmentRequest request =
   *       CreateEnvironmentRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setEnvironmentId("environmentId-950205810")
   *           .setEnvironment(Environment.newBuilder().build())
   *           .build();
   *   Environment response = notebookServiceClient.createEnvironmentAsync(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 createEnvironmentAsync( CreateEnvironmentRequest request) { return createEnvironmentOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Environment. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateEnvironmentRequest request =
   *       CreateEnvironmentRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setEnvironmentId("environmentId-950205810")
   *           .setEnvironment(Environment.newBuilder().build())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.createEnvironmentOperationCallable().futureCall(request);
   *   // Do something.
   *   Environment response = future.get();
   * }
   * }
*/ public final OperationCallable createEnvironmentOperationCallable() { return stub.createEnvironmentOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Environment. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateEnvironmentRequest request =
   *       CreateEnvironmentRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setEnvironmentId("environmentId-950205810")
   *           .setEnvironment(Environment.newBuilder().build())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.createEnvironmentCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable createEnvironmentCallable() { return stub.createEnvironmentCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a single Environment. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String name = "name3373707";
   *   notebookServiceClient.deleteEnvironmentAsync(name).get();
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/environments/{environment_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteEnvironmentAsync(String name) { DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder().setName(name).build(); return deleteEnvironmentAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a single Environment. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteEnvironmentRequest request =
   *       DeleteEnvironmentRequest.newBuilder().setName("name3373707").build();
   *   notebookServiceClient.deleteEnvironmentAsync(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 deleteEnvironmentAsync( DeleteEnvironmentRequest request) { return deleteEnvironmentOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a single Environment. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteEnvironmentRequest request =
   *       DeleteEnvironmentRequest.newBuilder().setName("name3373707").build();
   *   OperationFuture future =
   *       notebookServiceClient.deleteEnvironmentOperationCallable().futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final OperationCallable deleteEnvironmentOperationCallable() { return stub.deleteEnvironmentOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a single Environment. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteEnvironmentRequest request =
   *       DeleteEnvironmentRequest.newBuilder().setName("name3373707").build();
   *   ApiFuture future =
   *       notebookServiceClient.deleteEnvironmentCallable().futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final UnaryCallable deleteEnvironmentCallable() { return stub.deleteEnvironmentCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists schedules in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ScheduleName parent = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]");
   *   for (Schedule element : notebookServiceClient.listSchedules(parent).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListSchedulesPagedResponse listSchedules(ScheduleName parent) { ListSchedulesRequest request = ListSchedulesRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listSchedules(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists schedules in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String parent = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString();
   *   for (Schedule element : notebookServiceClient.listSchedules(parent).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListSchedulesPagedResponse listSchedules(String parent) { ListSchedulesRequest request = ListSchedulesRequest.newBuilder().setParent(parent).build(); return listSchedules(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists schedules in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListSchedulesRequest request =
   *       ListSchedulesRequest.newBuilder()
   *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .setOrderBy("orderBy-1207110587")
   *           .build();
   *   for (Schedule element : notebookServiceClient.listSchedules(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 ListSchedulesPagedResponse listSchedules(ListSchedulesRequest request) { return listSchedulesPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists schedules in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListSchedulesRequest request =
   *       ListSchedulesRequest.newBuilder()
   *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .setOrderBy("orderBy-1207110587")
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.listSchedulesPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Schedule element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listSchedulesPagedCallable() { return stub.listSchedulesPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists schedules in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListSchedulesRequest request =
   *       ListSchedulesRequest.newBuilder()
   *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .setOrderBy("orderBy-1207110587")
   *           .build();
   *   while (true) {
   *     ListSchedulesResponse response =
   *         notebookServiceClient.listSchedulesCallable().call(request);
   *     for (Schedule element : response.getSchedulesList()) {
   *       // doThingsWith(element);
   *     }
   *     String nextPageToken = response.getNextPageToken();
   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
   *       request = request.toBuilder().setPageToken(nextPageToken).build();
   *     } else {
   *       break;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable listSchedulesCallable() { return stub.listSchedulesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of schedule * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ScheduleName name = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]");
   *   Schedule response = notebookServiceClient.getSchedule(name);
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/schedules/{schedule_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Schedule getSchedule(ScheduleName name) { GetScheduleRequest request = GetScheduleRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getSchedule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of schedule * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String name = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString();
   *   Schedule response = notebookServiceClient.getSchedule(name);
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/schedules/{schedule_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Schedule getSchedule(String name) { GetScheduleRequest request = GetScheduleRequest.newBuilder().setName(name).build(); return getSchedule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of schedule * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetScheduleRequest request =
   *       GetScheduleRequest.newBuilder()
   *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .build();
   *   Schedule response = notebookServiceClient.getSchedule(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 Schedule getSchedule(GetScheduleRequest request) { return getScheduleCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of schedule * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetScheduleRequest request =
   *       GetScheduleRequest.newBuilder()
   *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .build();
   *   ApiFuture future = notebookServiceClient.getScheduleCallable().futureCall(request);
   *   // Do something.
   *   Schedule response = future.get();
   * }
   * }
*/ public final UnaryCallable getScheduleCallable() { return stub.getScheduleCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes schedule and all underlying jobs * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ScheduleName name = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]");
   *   notebookServiceClient.deleteScheduleAsync(name).get();
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/schedules/{schedule_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteScheduleAsync(ScheduleName name) { DeleteScheduleRequest request = DeleteScheduleRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return deleteScheduleAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes schedule and all underlying jobs * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String name = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString();
   *   notebookServiceClient.deleteScheduleAsync(name).get();
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/schedules/{schedule_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteScheduleAsync(String name) { DeleteScheduleRequest request = DeleteScheduleRequest.newBuilder().setName(name).build(); return deleteScheduleAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes schedule and all underlying jobs * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteScheduleRequest request =
   *       DeleteScheduleRequest.newBuilder()
   *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .build();
   *   notebookServiceClient.deleteScheduleAsync(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 deleteScheduleAsync( DeleteScheduleRequest request) { return deleteScheduleOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes schedule and all underlying jobs * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteScheduleRequest request =
   *       DeleteScheduleRequest.newBuilder()
   *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.deleteScheduleOperationCallable().futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final OperationCallable deleteScheduleOperationCallable() { return stub.deleteScheduleOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes schedule and all underlying jobs * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteScheduleRequest request =
   *       DeleteScheduleRequest.newBuilder()
   *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.deleteScheduleCallable().futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final UnaryCallable deleteScheduleCallable() { return stub.deleteScheduleCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Scheduled Notebook in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ScheduleName parent = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]");
   *   Schedule schedule = Schedule.newBuilder().build();
   *   String scheduleId = "scheduleId-687058414";
   *   Schedule response =
   *       notebookServiceClient.createScheduleAsync(parent, schedule, scheduleId).get();
   * }
   * }
* * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}` * @param schedule Required. The schedule to be created. * @param scheduleId Required. User-defined unique ID of this schedule. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createScheduleAsync( ScheduleName parent, Schedule schedule, String scheduleId) { CreateScheduleRequest request = CreateScheduleRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setSchedule(schedule) .setScheduleId(scheduleId) .build(); return createScheduleAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Scheduled Notebook in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String parent = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString();
   *   Schedule schedule = Schedule.newBuilder().build();
   *   String scheduleId = "scheduleId-687058414";
   *   Schedule response =
   *       notebookServiceClient.createScheduleAsync(parent, schedule, scheduleId).get();
   * }
   * }
* * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}` * @param schedule Required. The schedule to be created. * @param scheduleId Required. User-defined unique ID of this schedule. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createScheduleAsync( String parent, Schedule schedule, String scheduleId) { CreateScheduleRequest request = CreateScheduleRequest.newBuilder() .setParent(parent) .setSchedule(schedule) .setScheduleId(scheduleId) .build(); return createScheduleAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Scheduled Notebook in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateScheduleRequest request =
   *       CreateScheduleRequest.newBuilder()
   *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .setScheduleId("scheduleId-687058414")
   *           .setSchedule(Schedule.newBuilder().build())
   *           .build();
   *   Schedule response = notebookServiceClient.createScheduleAsync(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 createScheduleAsync( CreateScheduleRequest request) { return createScheduleOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Scheduled Notebook in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateScheduleRequest request =
   *       CreateScheduleRequest.newBuilder()
   *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .setScheduleId("scheduleId-687058414")
   *           .setSchedule(Schedule.newBuilder().build())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.createScheduleOperationCallable().futureCall(request);
   *   // Do something.
   *   Schedule response = future.get();
   * }
   * }
*/ public final OperationCallable createScheduleOperationCallable() { return stub.createScheduleOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Scheduled Notebook in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateScheduleRequest request =
   *       CreateScheduleRequest.newBuilder()
   *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .setScheduleId("scheduleId-687058414")
   *           .setSchedule(Schedule.newBuilder().build())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.createScheduleCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable createScheduleCallable() { return stub.createScheduleCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Triggers execution of an existing schedule. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   TriggerScheduleRequest request =
   *       TriggerScheduleRequest.newBuilder()
   *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .build();
   *   Schedule response = notebookServiceClient.triggerScheduleAsync(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 triggerScheduleAsync( TriggerScheduleRequest request) { return triggerScheduleOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Triggers execution of an existing schedule. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   TriggerScheduleRequest request =
   *       TriggerScheduleRequest.newBuilder()
   *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.triggerScheduleOperationCallable().futureCall(request);
   *   // Do something.
   *   Schedule response = future.get();
   * }
   * }
*/ public final OperationCallable triggerScheduleOperationCallable() { return stub.triggerScheduleOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Triggers execution of an existing schedule. * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   TriggerScheduleRequest request =
   *       TriggerScheduleRequest.newBuilder()
   *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.triggerScheduleCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable triggerScheduleCallable() { return stub.triggerScheduleCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists executions in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ExecutionName parent = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]");
   *   for (Execution element : notebookServiceClient.listExecutions(parent).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListExecutionsPagedResponse listExecutions(ExecutionName parent) { ListExecutionsRequest request = ListExecutionsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listExecutions(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists executions in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String parent = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString();
   *   for (Execution element : notebookServiceClient.listExecutions(parent).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListExecutionsPagedResponse listExecutions(String parent) { ListExecutionsRequest request = ListExecutionsRequest.newBuilder().setParent(parent).build(); return listExecutions(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists executions in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListExecutionsRequest request =
   *       ListExecutionsRequest.newBuilder()
   *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .setOrderBy("orderBy-1207110587")
   *           .build();
   *   for (Execution element : notebookServiceClient.listExecutions(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 ListExecutionsPagedResponse listExecutions(ListExecutionsRequest request) { return listExecutionsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists executions in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListExecutionsRequest request =
   *       ListExecutionsRequest.newBuilder()
   *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .setOrderBy("orderBy-1207110587")
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.listExecutionsPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Execution element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listExecutionsPagedCallable() { return stub.listExecutionsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists executions in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListExecutionsRequest request =
   *       ListExecutionsRequest.newBuilder()
   *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .setOrderBy("orderBy-1207110587")
   *           .build();
   *   while (true) {
   *     ListExecutionsResponse response =
   *         notebookServiceClient.listExecutionsCallable().call(request);
   *     for (Execution element : response.getExecutionsList()) {
   *       // doThingsWith(element);
   *     }
   *     String nextPageToken = response.getNextPageToken();
   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
   *       request = request.toBuilder().setPageToken(nextPageToken).build();
   *     } else {
   *       break;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable listExecutionsCallable() { return stub.listExecutionsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of executions * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]");
   *   Execution response = notebookServiceClient.getExecution(name);
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/executions/{execution_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Execution getExecution(ExecutionName name) { GetExecutionRequest request = GetExecutionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getExecution(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of executions * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString();
   *   Execution response = notebookServiceClient.getExecution(name);
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/executions/{execution_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Execution getExecution(String name) { GetExecutionRequest request = GetExecutionRequest.newBuilder().setName(name).build(); return getExecution(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of executions * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetExecutionRequest request =
   *       GetExecutionRequest.newBuilder()
   *           .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
   *           .build();
   *   Execution response = notebookServiceClient.getExecution(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 Execution getExecution(GetExecutionRequest request) { return getExecutionCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of executions * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetExecutionRequest request =
   *       GetExecutionRequest.newBuilder()
   *           .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.getExecutionCallable().futureCall(request);
   *   // Do something.
   *   Execution response = future.get();
   * }
   * }
*/ public final UnaryCallable getExecutionCallable() { return stub.getExecutionCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes execution * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]");
   *   notebookServiceClient.deleteExecutionAsync(name).get();
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/executions/{execution_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteExecutionAsync(ExecutionName name) { DeleteExecutionRequest request = DeleteExecutionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return deleteExecutionAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes execution * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString();
   *   notebookServiceClient.deleteExecutionAsync(name).get();
   * }
   * }
* * @param name Required. Format: * `projects/{project_id}/locations/{location}/executions/{execution_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteExecutionAsync(String name) { DeleteExecutionRequest request = DeleteExecutionRequest.newBuilder().setName(name).build(); return deleteExecutionAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes execution * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteExecutionRequest request =
   *       DeleteExecutionRequest.newBuilder()
   *           .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
   *           .build();
   *   notebookServiceClient.deleteExecutionAsync(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 deleteExecutionAsync( DeleteExecutionRequest request) { return deleteExecutionOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes execution * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteExecutionRequest request =
   *       DeleteExecutionRequest.newBuilder()
   *           .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.deleteExecutionOperationCallable().futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final OperationCallable deleteExecutionOperationCallable() { return stub.deleteExecutionOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes execution * *

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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   DeleteExecutionRequest request =
   *       DeleteExecutionRequest.newBuilder()
   *           .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.deleteExecutionCallable().futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final UnaryCallable deleteExecutionCallable() { return stub.deleteExecutionCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Execution in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ExecutionName parent = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]");
   *   Execution execution = Execution.newBuilder().build();
   *   String executionId = "executionId-454906285";
   *   Execution response =
   *       notebookServiceClient.createExecutionAsync(parent, execution, executionId).get();
   * }
   * }
* * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}` * @param execution Required. The execution to be created. * @param executionId Required. User-defined unique ID of this execution. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createExecutionAsync( ExecutionName parent, Execution execution, String executionId) { CreateExecutionRequest request = CreateExecutionRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setExecution(execution) .setExecutionId(executionId) .build(); return createExecutionAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Execution in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   String parent = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString();
   *   Execution execution = Execution.newBuilder().build();
   *   String executionId = "executionId-454906285";
   *   Execution response =
   *       notebookServiceClient.createExecutionAsync(parent, execution, executionId).get();
   * }
   * }
* * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}` * @param execution Required. The execution to be created. * @param executionId Required. User-defined unique ID of this execution. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createExecutionAsync( String parent, Execution execution, String executionId) { CreateExecutionRequest request = CreateExecutionRequest.newBuilder() .setParent(parent) .setExecution(execution) .setExecutionId(executionId) .build(); return createExecutionAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Execution in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateExecutionRequest request =
   *       CreateExecutionRequest.newBuilder()
   *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
   *           .setExecutionId("executionId-454906285")
   *           .setExecution(Execution.newBuilder().build())
   *           .build();
   *   Execution response = notebookServiceClient.createExecutionAsync(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 createExecutionAsync( CreateExecutionRequest request) { return createExecutionOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Execution in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateExecutionRequest request =
   *       CreateExecutionRequest.newBuilder()
   *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
   *           .setExecutionId("executionId-454906285")
   *           .setExecution(Execution.newBuilder().build())
   *           .build();
   *   OperationFuture future =
   *       notebookServiceClient.createExecutionOperationCallable().futureCall(request);
   *   // Do something.
   *   Execution response = future.get();
   * }
   * }
*/ public final OperationCallable createExecutionOperationCallable() { return stub.createExecutionOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Execution in a given project and 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   CreateExecutionRequest request =
   *       CreateExecutionRequest.newBuilder()
   *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
   *           .setExecutionId("executionId-454906285")
   *           .setExecution(Execution.newBuilder().build())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.createExecutionCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable createExecutionCallable() { return stub.createExecutionCallable(); } // 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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListLocationsRequest request =
   *       ListLocationsRequest.newBuilder()
   *           .setName("name3373707")
   *           .setFilter("filter-1274492040")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   for (Location element : notebookServiceClient.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListLocationsRequest request =
   *       ListLocationsRequest.newBuilder()
   *           .setName("name3373707")
   *           .setFilter("filter-1274492040")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   ListLocationsRequest request =
   *       ListLocationsRequest.newBuilder()
   *           .setName("name3373707")
   *           .setFilter("filter-1274492040")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   while (true) {
   *     ListLocationsResponse response =
   *         notebookServiceClient.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   *   Location response = notebookServiceClient.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   *   ApiFuture future = notebookServiceClient.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   SetIamPolicyRequest request =
   *       SetIamPolicyRequest.newBuilder()
   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
   *           .setPolicy(Policy.newBuilder().build())
   *           .setUpdateMask(FieldMask.newBuilder().build())
   *           .build();
   *   Policy response = notebookServiceClient.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   SetIamPolicyRequest request =
   *       SetIamPolicyRequest.newBuilder()
   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
   *           .setPolicy(Policy.newBuilder().build())
   *           .setUpdateMask(FieldMask.newBuilder().build())
   *           .build();
   *   ApiFuture future = notebookServiceClient.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetIamPolicyRequest request =
   *       GetIamPolicyRequest.newBuilder()
   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
   *           .setOptions(GetPolicyOptions.newBuilder().build())
   *           .build();
   *   Policy response = notebookServiceClient.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   GetIamPolicyRequest request =
   *       GetIamPolicyRequest.newBuilder()
   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
   *           .setOptions(GetPolicyOptions.newBuilder().build())
   *           .build();
   *   ApiFuture future = notebookServiceClient.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   TestIamPermissionsRequest request =
   *       TestIamPermissionsRequest.newBuilder()
   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
   *           .addAllPermissions(new ArrayList())
   *           .build();
   *   TestIamPermissionsResponse response = notebookServiceClient.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   *   TestIamPermissionsRequest request =
   *       TestIamPermissionsRequest.newBuilder()
   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
   *           .addAllPermissions(new ArrayList())
   *           .build();
   *   ApiFuture future =
   *       notebookServiceClient.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 ListInstancesPagedResponse extends AbstractPagedListResponse< ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage, ListInstancesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListInstancesPagedResponse(input), MoreExecutors.directExecutor()); } private ListInstancesPagedResponse(ListInstancesPage page) { super(page, ListInstancesFixedSizeCollection.createEmptyCollection()); } } public static class ListInstancesPage extends AbstractPage< ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage> { private ListInstancesPage( PageContext context, ListInstancesResponse response) { super(context, response); } private static ListInstancesPage createEmptyPage() { return new ListInstancesPage(null, null); } @Override protected ListInstancesPage createPage( PageContext context, ListInstancesResponse response) { return new ListInstancesPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListInstancesFixedSizeCollection extends AbstractFixedSizeCollection< ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage, ListInstancesFixedSizeCollection> { private ListInstancesFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } private static ListInstancesFixedSizeCollection createEmptyCollection() { return new ListInstancesFixedSizeCollection(null, 0); } @Override protected ListInstancesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInstancesFixedSizeCollection(pages, collectionSize); } } public static class ListEnvironmentsPagedResponse extends AbstractPagedListResponse< ListEnvironmentsRequest, ListEnvironmentsResponse, Environment, ListEnvironmentsPage, ListEnvironmentsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListEnvironmentsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListEnvironmentsPagedResponse(input), MoreExecutors.directExecutor()); } private ListEnvironmentsPagedResponse(ListEnvironmentsPage page) { super(page, ListEnvironmentsFixedSizeCollection.createEmptyCollection()); } } public static class ListEnvironmentsPage extends AbstractPage< ListEnvironmentsRequest, ListEnvironmentsResponse, Environment, ListEnvironmentsPage> { private ListEnvironmentsPage( PageContext context, ListEnvironmentsResponse response) { super(context, response); } private static ListEnvironmentsPage createEmptyPage() { return new ListEnvironmentsPage(null, null); } @Override protected ListEnvironmentsPage createPage( PageContext context, ListEnvironmentsResponse response) { return new ListEnvironmentsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListEnvironmentsFixedSizeCollection extends AbstractFixedSizeCollection< ListEnvironmentsRequest, ListEnvironmentsResponse, Environment, ListEnvironmentsPage, ListEnvironmentsFixedSizeCollection> { private ListEnvironmentsFixedSizeCollection( List pages, int collectionSize) { super(pages, collectionSize); } private static ListEnvironmentsFixedSizeCollection createEmptyCollection() { return new ListEnvironmentsFixedSizeCollection(null, 0); } @Override protected ListEnvironmentsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListEnvironmentsFixedSizeCollection(pages, collectionSize); } } public static class ListSchedulesPagedResponse extends AbstractPagedListResponse< ListSchedulesRequest, ListSchedulesResponse, Schedule, ListSchedulesPage, ListSchedulesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListSchedulesPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListSchedulesPagedResponse(input), MoreExecutors.directExecutor()); } private ListSchedulesPagedResponse(ListSchedulesPage page) { super(page, ListSchedulesFixedSizeCollection.createEmptyCollection()); } } public static class ListSchedulesPage extends AbstractPage< ListSchedulesRequest, ListSchedulesResponse, Schedule, ListSchedulesPage> { private ListSchedulesPage( PageContext context, ListSchedulesResponse response) { super(context, response); } private static ListSchedulesPage createEmptyPage() { return new ListSchedulesPage(null, null); } @Override protected ListSchedulesPage createPage( PageContext context, ListSchedulesResponse response) { return new ListSchedulesPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListSchedulesFixedSizeCollection extends AbstractFixedSizeCollection< ListSchedulesRequest, ListSchedulesResponse, Schedule, ListSchedulesPage, ListSchedulesFixedSizeCollection> { private ListSchedulesFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } private static ListSchedulesFixedSizeCollection createEmptyCollection() { return new ListSchedulesFixedSizeCollection(null, 0); } @Override protected ListSchedulesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListSchedulesFixedSizeCollection(pages, collectionSize); } } public static class ListExecutionsPagedResponse extends AbstractPagedListResponse< ListExecutionsRequest, ListExecutionsResponse, Execution, ListExecutionsPage, ListExecutionsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListExecutionsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListExecutionsPagedResponse(input), MoreExecutors.directExecutor()); } private ListExecutionsPagedResponse(ListExecutionsPage page) { super(page, ListExecutionsFixedSizeCollection.createEmptyCollection()); } } public static class ListExecutionsPage extends AbstractPage< ListExecutionsRequest, ListExecutionsResponse, Execution, ListExecutionsPage> { private ListExecutionsPage( PageContext context, ListExecutionsResponse response) { super(context, response); } private static ListExecutionsPage createEmptyPage() { return new ListExecutionsPage(null, null); } @Override protected ListExecutionsPage createPage( PageContext context, ListExecutionsResponse response) { return new ListExecutionsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListExecutionsFixedSizeCollection extends AbstractFixedSizeCollection< ListExecutionsRequest, ListExecutionsResponse, Execution, ListExecutionsPage, ListExecutionsFixedSizeCollection> { private ListExecutionsFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } private static ListExecutionsFixedSizeCollection createEmptyCollection() { return new ListExecutionsFixedSizeCollection(null, 0); } @Override protected ListExecutionsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListExecutionsFixedSizeCollection(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); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy