Class NotebookServiceClient

java.lang.Object
com.google.cloud.aiplatform.v1beta1.NotebookServiceClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@BetaApi @Generated("by gapic-generator-java") public class NotebookServiceClient extends Object implements BackgroundResource
Service Description: The interface for Vertex Notebook service (a.k.a. Colab on Workbench).

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


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   NotebookRuntimeTemplateName name =
       NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
   NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(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
Method Description Method Variants

CreateNotebookRuntimeTemplate

Creates a NotebookRuntimeTemplate.

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

  • createNotebookRuntimeTemplateAsync(CreateNotebookRuntimeTemplateRequest request)

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

  • createNotebookRuntimeTemplateAsync(LocationName parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)

  • createNotebookRuntimeTemplateAsync(String parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)

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

  • createNotebookRuntimeTemplateOperationCallable()

  • createNotebookRuntimeTemplateCallable()

GetNotebookRuntimeTemplate

Gets a NotebookRuntimeTemplate.

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

  • getNotebookRuntimeTemplate(GetNotebookRuntimeTemplateRequest request)

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

  • getNotebookRuntimeTemplate(NotebookRuntimeTemplateName name)

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

  • getNotebookRuntimeTemplateCallable()

ListNotebookRuntimeTemplates

Lists NotebookRuntimeTemplates in a Location.

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

  • listNotebookRuntimeTemplates(ListNotebookRuntimeTemplatesRequest request)

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

  • listNotebookRuntimeTemplates(LocationName parent)

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

  • listNotebookRuntimeTemplatesPagedCallable()

  • listNotebookRuntimeTemplatesCallable()

DeleteNotebookRuntimeTemplate

Deletes a NotebookRuntimeTemplate.

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

  • deleteNotebookRuntimeTemplateAsync(DeleteNotebookRuntimeTemplateRequest request)

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

  • deleteNotebookRuntimeTemplateAsync(NotebookRuntimeTemplateName name)

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

  • deleteNotebookRuntimeTemplateOperationCallable()

  • deleteNotebookRuntimeTemplateCallable()

UpdateNotebookRuntimeTemplate

Updates a NotebookRuntimeTemplate.

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

  • updateNotebookRuntimeTemplate(UpdateNotebookRuntimeTemplateRequest request)

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

  • updateNotebookRuntimeTemplate(NotebookRuntimeTemplate notebookRuntimeTemplate, FieldMask updateMask)

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

  • updateNotebookRuntimeTemplateCallable()

AssignNotebookRuntime

Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

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

  • assignNotebookRuntimeAsync(AssignNotebookRuntimeRequest request)

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

  • assignNotebookRuntimeAsync(LocationName parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

  • assignNotebookRuntimeAsync(LocationName parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

  • assignNotebookRuntimeAsync(String parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

  • assignNotebookRuntimeAsync(String parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

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

  • assignNotebookRuntimeOperationCallable()

  • assignNotebookRuntimeCallable()

GetNotebookRuntime

Gets a NotebookRuntime.

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

  • getNotebookRuntime(GetNotebookRuntimeRequest request)

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

  • getNotebookRuntime(NotebookRuntimeName name)

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

  • getNotebookRuntimeCallable()

ListNotebookRuntimes

Lists NotebookRuntimes in a Location.

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

  • listNotebookRuntimes(ListNotebookRuntimesRequest request)

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

  • listNotebookRuntimes(LocationName parent)

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

  • listNotebookRuntimesPagedCallable()

  • listNotebookRuntimesCallable()

DeleteNotebookRuntime

Deletes a NotebookRuntime.

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

  • deleteNotebookRuntimeAsync(DeleteNotebookRuntimeRequest request)

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

  • deleteNotebookRuntimeAsync(NotebookRuntimeName name)

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

  • deleteNotebookRuntimeOperationCallable()

  • deleteNotebookRuntimeCallable()

UpgradeNotebookRuntime

Upgrades a NotebookRuntime.

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

  • upgradeNotebookRuntimeAsync(UpgradeNotebookRuntimeRequest request)

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

  • upgradeNotebookRuntimeAsync(NotebookRuntimeName name)

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

  • upgradeNotebookRuntimeOperationCallable()

  • upgradeNotebookRuntimeCallable()

StartNotebookRuntime

Starts a NotebookRuntime.

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

  • startNotebookRuntimeAsync(StartNotebookRuntimeRequest request)

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

  • startNotebookRuntimeAsync(NotebookRuntimeName name)

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

  • startNotebookRuntimeOperationCallable()

  • startNotebookRuntimeCallable()

StopNotebookRuntime

Stops a NotebookRuntime.

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

  • stopNotebookRuntimeAsync(StopNotebookRuntimeRequest request)

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

  • stopNotebookRuntimeAsync(NotebookRuntimeName name)

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

  • stopNotebookRuntimeOperationCallable()

  • stopNotebookRuntimeCallable()

CreateNotebookExecutionJob

Creates a NotebookExecutionJob.

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

  • createNotebookExecutionJobAsync(CreateNotebookExecutionJobRequest request)

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

  • createNotebookExecutionJobAsync(LocationName parent, NotebookExecutionJob notebookExecutionJob, String notebookExecutionJobId)

  • createNotebookExecutionJobAsync(String parent, NotebookExecutionJob notebookExecutionJob, String notebookExecutionJobId)

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

  • createNotebookExecutionJobOperationCallable()

  • createNotebookExecutionJobCallable()

GetNotebookExecutionJob

Gets a NotebookExecutionJob.

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

  • getNotebookExecutionJob(GetNotebookExecutionJobRequest request)

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

  • getNotebookExecutionJob(NotebookExecutionJobName name)

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

  • getNotebookExecutionJobCallable()

ListNotebookExecutionJobs

Lists NotebookExecutionJobs in a Location.

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

  • listNotebookExecutionJobs(ListNotebookExecutionJobsRequest request)

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

  • listNotebookExecutionJobs(LocationName parent)

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

  • listNotebookExecutionJobsPagedCallable()

  • listNotebookExecutionJobsCallable()

DeleteNotebookExecutionJob

Deletes a NotebookExecutionJob.

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

  • deleteNotebookExecutionJobAsync(DeleteNotebookExecutionJobRequest request)

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

  • deleteNotebookExecutionJobAsync(NotebookExecutionJobName name)

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

  • deleteNotebookExecutionJobOperationCallable()

  • deleteNotebookExecutionJobCallable()

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:


 // 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:


 // 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.

  • Constructor Details

    • NotebookServiceClient

      protected NotebookServiceClient(NotebookServiceSettings settings) throws IOException
      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.
      Throws:
      IOException
    • NotebookServiceClient

      protected NotebookServiceClient(NotebookServiceStub stub)
  • Method Details

    • create

      public static final NotebookServiceClient create() throws IOException
      Constructs an instance of NotebookServiceClient with default settings.
      Throws:
      IOException
    • create

      public static final NotebookServiceClient create(NotebookServiceSettings settings) throws IOException
      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.
      Throws:
      IOException
    • create

      public static final NotebookServiceClient create(NotebookServiceStub stub)
      Constructs an instance of NotebookServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(NotebookServiceSettings).
    • getSettings

      public final NotebookServiceSettings getSettings()
    • getStub

      public NotebookServiceStub getStub()
    • getOperationsClient

      public final OperationsClient getOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • createNotebookRuntimeTemplateAsync

      public final OperationFuture<NotebookRuntimeTemplate,CreateNotebookRuntimeTemplateOperationMetadata> createNotebookRuntimeTemplateAsync(LocationName parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)
      Creates a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         NotebookRuntimeTemplate notebookRuntimeTemplate =
             NotebookRuntimeTemplate.newBuilder().build();
         String notebookRuntimeTemplateId = "notebookRuntimeTemplateId-633369454";
         NotebookRuntimeTemplate response =
             notebookServiceClient
                 .createNotebookRuntimeTemplateAsync(
                     parent, notebookRuntimeTemplate, notebookRuntimeTemplateId)
                 .get();
       }
       
      Parameters:
      parent - Required. The resource name of the Location to create the NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}`
      notebookRuntimeTemplate - Required. The NotebookRuntimeTemplate to create.
      notebookRuntimeTemplateId - Optional. User specified ID for the notebook runtime template.
      Throws:
      ApiException - if the remote call fails
    • createNotebookRuntimeTemplateAsync

      public final OperationFuture<NotebookRuntimeTemplate,CreateNotebookRuntimeTemplateOperationMetadata> createNotebookRuntimeTemplateAsync(String parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)
      Creates a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         NotebookRuntimeTemplate notebookRuntimeTemplate =
             NotebookRuntimeTemplate.newBuilder().build();
         String notebookRuntimeTemplateId = "notebookRuntimeTemplateId-633369454";
         NotebookRuntimeTemplate response =
             notebookServiceClient
                 .createNotebookRuntimeTemplateAsync(
                     parent, notebookRuntimeTemplate, notebookRuntimeTemplateId)
                 .get();
       }
       
      Parameters:
      parent - Required. The resource name of the Location to create the NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}`
      notebookRuntimeTemplate - Required. The NotebookRuntimeTemplate to create.
      notebookRuntimeTemplateId - Optional. User specified ID for the notebook runtime template.
      Throws:
      ApiException - if the remote call fails
    • createNotebookRuntimeTemplateAsync

      Creates a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         CreateNotebookRuntimeTemplateRequest request =
             CreateNotebookRuntimeTemplateRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build())
                 .setNotebookRuntimeTemplateId("notebookRuntimeTemplateId-633369454")
                 .build();
         NotebookRuntimeTemplate response =
             notebookServiceClient.createNotebookRuntimeTemplateAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createNotebookRuntimeTemplateOperationCallable

      Creates a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         CreateNotebookRuntimeTemplateRequest request =
             CreateNotebookRuntimeTemplateRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build())
                 .setNotebookRuntimeTemplateId("notebookRuntimeTemplateId-633369454")
                 .build();
         OperationFuture<NotebookRuntimeTemplate, CreateNotebookRuntimeTemplateOperationMetadata>
             future =
                 notebookServiceClient
                     .createNotebookRuntimeTemplateOperationCallable()
                     .futureCall(request);
         // Do something.
         NotebookRuntimeTemplate response = future.get();
       }
       
    • createNotebookRuntimeTemplateCallable

      public final UnaryCallable<CreateNotebookRuntimeTemplateRequest,Operation> createNotebookRuntimeTemplateCallable()
      Creates a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         CreateNotebookRuntimeTemplateRequest request =
             CreateNotebookRuntimeTemplateRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build())
                 .setNotebookRuntimeTemplateId("notebookRuntimeTemplateId-633369454")
                 .build();
         ApiFuture<Operation> future =
             notebookServiceClient.createNotebookRuntimeTemplateCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getNotebookRuntimeTemplate

      public final NotebookRuntimeTemplate getNotebookRuntimeTemplate(NotebookRuntimeTemplateName name)
      Gets a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         NotebookRuntimeTemplateName name =
             NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
         NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(name);
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntimeTemplate resource. Format: `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`
      Throws:
      ApiException - if the remote call fails
    • getNotebookRuntimeTemplate

      public final NotebookRuntimeTemplate getNotebookRuntimeTemplate(String name)
      Gets a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String name =
             NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                 .toString();
         NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(name);
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntimeTemplate resource. Format: `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`
      Throws:
      ApiException - if the remote call fails
    • getNotebookRuntimeTemplate

      public final NotebookRuntimeTemplate getNotebookRuntimeTemplate(GetNotebookRuntimeTemplateRequest request)
      Gets a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         GetNotebookRuntimeTemplateRequest request =
             GetNotebookRuntimeTemplateRequest.newBuilder()
                 .setName(
                     NotebookRuntimeTemplateName.of(
                             "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                         .toString())
                 .build();
         NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getNotebookRuntimeTemplateCallable

      public final UnaryCallable<GetNotebookRuntimeTemplateRequest,NotebookRuntimeTemplate> getNotebookRuntimeTemplateCallable()
      Gets a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         GetNotebookRuntimeTemplateRequest request =
             GetNotebookRuntimeTemplateRequest.newBuilder()
                 .setName(
                     NotebookRuntimeTemplateName.of(
                             "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                         .toString())
                 .build();
         ApiFuture<NotebookRuntimeTemplate> future =
             notebookServiceClient.getNotebookRuntimeTemplateCallable().futureCall(request);
         // Do something.
         NotebookRuntimeTemplate response = future.get();
       }
       
    • listNotebookRuntimeTemplates

      public final NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse listNotebookRuntimeTemplates(LocationName parent)
      Lists NotebookRuntimeTemplates in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (NotebookRuntimeTemplate element :
             notebookServiceClient.listNotebookRuntimeTemplates(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The resource name of the Location from which to list the NotebookRuntimeTemplates. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listNotebookRuntimeTemplates

      public final NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse listNotebookRuntimeTemplates(String parent)
      Lists NotebookRuntimeTemplates in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (NotebookRuntimeTemplate element :
             notebookServiceClient.listNotebookRuntimeTemplates(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The resource name of the Location from which to list the NotebookRuntimeTemplates. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listNotebookRuntimeTemplates

      Lists NotebookRuntimeTemplates in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         ListNotebookRuntimeTemplatesRequest request =
             ListNotebookRuntimeTemplatesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReadMask(FieldMask.newBuilder().build())
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (NotebookRuntimeTemplate element :
             notebookServiceClient.listNotebookRuntimeTemplates(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listNotebookRuntimeTemplatesPagedCallable

      Lists NotebookRuntimeTemplates in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         ListNotebookRuntimeTemplatesRequest request =
             ListNotebookRuntimeTemplatesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReadMask(FieldMask.newBuilder().build())
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<NotebookRuntimeTemplate> future =
             notebookServiceClient.listNotebookRuntimeTemplatesPagedCallable().futureCall(request);
         // Do something.
         for (NotebookRuntimeTemplate element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listNotebookRuntimeTemplatesCallable

      public final UnaryCallable<ListNotebookRuntimeTemplatesRequest,ListNotebookRuntimeTemplatesResponse> listNotebookRuntimeTemplatesCallable()
      Lists NotebookRuntimeTemplates in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         ListNotebookRuntimeTemplatesRequest request =
             ListNotebookRuntimeTemplatesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReadMask(FieldMask.newBuilder().build())
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListNotebookRuntimeTemplatesResponse response =
               notebookServiceClient.listNotebookRuntimeTemplatesCallable().call(request);
           for (NotebookRuntimeTemplate element : response.getNotebookRuntimeTemplatesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • deleteNotebookRuntimeTemplateAsync

      public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookRuntimeTemplateAsync(NotebookRuntimeTemplateName name)
      Deletes a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         NotebookRuntimeTemplateName name =
             NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
         notebookServiceClient.deleteNotebookRuntimeTemplateAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntimeTemplate resource to be deleted. Format: `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`
      Throws:
      ApiException - if the remote call fails
    • deleteNotebookRuntimeTemplateAsync

      public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookRuntimeTemplateAsync(String name)
      Deletes a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String name =
             NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                 .toString();
         notebookServiceClient.deleteNotebookRuntimeTemplateAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntimeTemplate resource to be deleted. Format: `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`
      Throws:
      ApiException - if the remote call fails
    • deleteNotebookRuntimeTemplateAsync

      public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookRuntimeTemplateAsync(DeleteNotebookRuntimeTemplateRequest request)
      Deletes a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         DeleteNotebookRuntimeTemplateRequest request =
             DeleteNotebookRuntimeTemplateRequest.newBuilder()
                 .setName(
                     NotebookRuntimeTemplateName.of(
                             "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                         .toString())
                 .build();
         notebookServiceClient.deleteNotebookRuntimeTemplateAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteNotebookRuntimeTemplateOperationCallable

      public final OperationCallable<DeleteNotebookRuntimeTemplateRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookRuntimeTemplateOperationCallable()
      Deletes a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         DeleteNotebookRuntimeTemplateRequest request =
             DeleteNotebookRuntimeTemplateRequest.newBuilder()
                 .setName(
                     NotebookRuntimeTemplateName.of(
                             "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                         .toString())
                 .build();
         OperationFuture<Empty, DeleteOperationMetadata> future =
             notebookServiceClient
                 .deleteNotebookRuntimeTemplateOperationCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteNotebookRuntimeTemplateCallable

      public final UnaryCallable<DeleteNotebookRuntimeTemplateRequest,Operation> deleteNotebookRuntimeTemplateCallable()
      Deletes a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         DeleteNotebookRuntimeTemplateRequest request =
             DeleteNotebookRuntimeTemplateRequest.newBuilder()
                 .setName(
                     NotebookRuntimeTemplateName.of(
                             "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             notebookServiceClient.deleteNotebookRuntimeTemplateCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • updateNotebookRuntimeTemplate

      public final NotebookRuntimeTemplate updateNotebookRuntimeTemplate(NotebookRuntimeTemplate notebookRuntimeTemplate, com.google.protobuf.FieldMask updateMask)
      Updates a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         NotebookRuntimeTemplate notebookRuntimeTemplate =
             NotebookRuntimeTemplate.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         NotebookRuntimeTemplate response =
             notebookServiceClient.updateNotebookRuntimeTemplate(notebookRuntimeTemplate, updateMask);
       }
       
      Parameters:
      notebookRuntimeTemplate - Required. The NotebookRuntimeTemplate to update.
      updateMask - Required. The update mask applies to the resource. For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. Input format: `{paths: "${updated_filed}"}` Updatable fields:

      * `encryption_spec.kms_key_name`

      Throws:
      ApiException - if the remote call fails
    • updateNotebookRuntimeTemplate

      public final NotebookRuntimeTemplate updateNotebookRuntimeTemplate(UpdateNotebookRuntimeTemplateRequest request)
      Updates a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         UpdateNotebookRuntimeTemplateRequest request =
             UpdateNotebookRuntimeTemplateRequest.newBuilder()
                 .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         NotebookRuntimeTemplate response =
             notebookServiceClient.updateNotebookRuntimeTemplate(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateNotebookRuntimeTemplateCallable

      public final UnaryCallable<UpdateNotebookRuntimeTemplateRequest,NotebookRuntimeTemplate> updateNotebookRuntimeTemplateCallable()
      Updates a NotebookRuntimeTemplate.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         UpdateNotebookRuntimeTemplateRequest request =
             UpdateNotebookRuntimeTemplateRequest.newBuilder()
                 .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<NotebookRuntimeTemplate> future =
             notebookServiceClient.updateNotebookRuntimeTemplateCallable().futureCall(request);
         // Do something.
         NotebookRuntimeTemplate response = future.get();
       }
       
    • assignNotebookRuntimeAsync

      public final OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata> assignNotebookRuntimeAsync(LocationName parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)
      Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         NotebookRuntimeTemplateName notebookRuntimeTemplate =
             NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
         NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
         String notebookRuntimeId = "notebookRuntimeId400795512";
         NotebookRuntime response =
             notebookServiceClient
                 .assignNotebookRuntimeAsync(
                     parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
                 .get();
       }
       
      Parameters:
      parent - Required. The resource name of the Location to get the NotebookRuntime assignment. Format: `projects/{project}/locations/{location}`
      notebookRuntimeTemplate - Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).
      notebookRuntime - Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.
      notebookRuntimeId - Optional. User specified ID for the notebook runtime.
      Throws:
      ApiException - if the remote call fails
    • assignNotebookRuntimeAsync

      public final OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata> assignNotebookRuntimeAsync(LocationName parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)
      Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         String notebookRuntimeTemplate =
             NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                 .toString();
         NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
         String notebookRuntimeId = "notebookRuntimeId400795512";
         NotebookRuntime response =
             notebookServiceClient
                 .assignNotebookRuntimeAsync(
                     parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
                 .get();
       }
       
      Parameters:
      parent - Required. The resource name of the Location to get the NotebookRuntime assignment. Format: `projects/{project}/locations/{location}`
      notebookRuntimeTemplate - Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).
      notebookRuntime - Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.
      notebookRuntimeId - Optional. User specified ID for the notebook runtime.
      Throws:
      ApiException - if the remote call fails
    • assignNotebookRuntimeAsync

      public final OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata> assignNotebookRuntimeAsync(String parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)
      Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         NotebookRuntimeTemplateName notebookRuntimeTemplate =
             NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
         NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
         String notebookRuntimeId = "notebookRuntimeId400795512";
         NotebookRuntime response =
             notebookServiceClient
                 .assignNotebookRuntimeAsync(
                     parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
                 .get();
       }
       
      Parameters:
      parent - Required. The resource name of the Location to get the NotebookRuntime assignment. Format: `projects/{project}/locations/{location}`
      notebookRuntimeTemplate - Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).
      notebookRuntime - Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.
      notebookRuntimeId - Optional. User specified ID for the notebook runtime.
      Throws:
      ApiException - if the remote call fails
    • assignNotebookRuntimeAsync

      public final OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata> assignNotebookRuntimeAsync(String parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)
      Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         String notebookRuntimeTemplate =
             NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                 .toString();
         NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
         String notebookRuntimeId = "notebookRuntimeId400795512";
         NotebookRuntime response =
             notebookServiceClient
                 .assignNotebookRuntimeAsync(
                     parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
                 .get();
       }
       
      Parameters:
      parent - Required. The resource name of the Location to get the NotebookRuntime assignment. Format: `projects/{project}/locations/{location}`
      notebookRuntimeTemplate - Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).
      notebookRuntime - Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.
      notebookRuntimeId - Optional. User specified ID for the notebook runtime.
      Throws:
      ApiException - if the remote call fails
    • assignNotebookRuntimeAsync

      Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         AssignNotebookRuntimeRequest request =
             AssignNotebookRuntimeRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setNotebookRuntimeTemplate(
                     NotebookRuntimeTemplateName.of(
                             "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                         .toString())
                 .setNotebookRuntime(NotebookRuntime.newBuilder().build())
                 .setNotebookRuntimeId("notebookRuntimeId400795512")
                 .build();
         NotebookRuntime response = notebookServiceClient.assignNotebookRuntimeAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • assignNotebookRuntimeOperationCallable

      Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         AssignNotebookRuntimeRequest request =
             AssignNotebookRuntimeRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setNotebookRuntimeTemplate(
                     NotebookRuntimeTemplateName.of(
                             "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                         .toString())
                 .setNotebookRuntime(NotebookRuntime.newBuilder().build())
                 .setNotebookRuntimeId("notebookRuntimeId400795512")
                 .build();
         OperationFuture<NotebookRuntime, AssignNotebookRuntimeOperationMetadata> future =
             notebookServiceClient.assignNotebookRuntimeOperationCallable().futureCall(request);
         // Do something.
         NotebookRuntime response = future.get();
       }
       
    • assignNotebookRuntimeCallable

      public final UnaryCallable<AssignNotebookRuntimeRequest,Operation> assignNotebookRuntimeCallable()
      Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         AssignNotebookRuntimeRequest request =
             AssignNotebookRuntimeRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setNotebookRuntimeTemplate(
                     NotebookRuntimeTemplateName.of(
                             "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                         .toString())
                 .setNotebookRuntime(NotebookRuntime.newBuilder().build())
                 .setNotebookRuntimeId("notebookRuntimeId400795512")
                 .build();
         ApiFuture<Operation> future =
             notebookServiceClient.assignNotebookRuntimeCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getNotebookRuntime

      public final NotebookRuntime getNotebookRuntime(NotebookRuntimeName name)
      Gets a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         NotebookRuntimeName name =
             NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
         NotebookRuntime response = notebookServiceClient.getNotebookRuntime(name);
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntime resource. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.
      Throws:
      ApiException - if the remote call fails
    • getNotebookRuntime

      public final NotebookRuntime getNotebookRuntime(String name)
      Gets a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String name =
             NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
         NotebookRuntime response = notebookServiceClient.getNotebookRuntime(name);
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntime resource. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.
      Throws:
      ApiException - if the remote call fails
    • getNotebookRuntime

      public final NotebookRuntime getNotebookRuntime(GetNotebookRuntimeRequest request)
      Gets a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         GetNotebookRuntimeRequest request =
             GetNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         NotebookRuntime response = notebookServiceClient.getNotebookRuntime(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getNotebookRuntimeCallable

      public final UnaryCallable<GetNotebookRuntimeRequest,NotebookRuntime> getNotebookRuntimeCallable()
      Gets a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         GetNotebookRuntimeRequest request =
             GetNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         ApiFuture<NotebookRuntime> future =
             notebookServiceClient.getNotebookRuntimeCallable().futureCall(request);
         // Do something.
         NotebookRuntime response = future.get();
       }
       
    • listNotebookRuntimes

      public final NotebookServiceClient.ListNotebookRuntimesPagedResponse listNotebookRuntimes(LocationName parent)
      Lists NotebookRuntimes in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (NotebookRuntime element :
             notebookServiceClient.listNotebookRuntimes(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The resource name of the Location from which to list the NotebookRuntimes. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listNotebookRuntimes

      public final NotebookServiceClient.ListNotebookRuntimesPagedResponse listNotebookRuntimes(String parent)
      Lists NotebookRuntimes in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (NotebookRuntime element :
             notebookServiceClient.listNotebookRuntimes(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The resource name of the Location from which to list the NotebookRuntimes. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listNotebookRuntimes

      Lists NotebookRuntimes in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         ListNotebookRuntimesRequest request =
             ListNotebookRuntimesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReadMask(FieldMask.newBuilder().build())
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (NotebookRuntime element :
             notebookServiceClient.listNotebookRuntimes(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listNotebookRuntimesPagedCallable

      Lists NotebookRuntimes in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         ListNotebookRuntimesRequest request =
             ListNotebookRuntimesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReadMask(FieldMask.newBuilder().build())
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<NotebookRuntime> future =
             notebookServiceClient.listNotebookRuntimesPagedCallable().futureCall(request);
         // Do something.
         for (NotebookRuntime element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listNotebookRuntimesCallable

      public final UnaryCallable<ListNotebookRuntimesRequest,ListNotebookRuntimesResponse> listNotebookRuntimesCallable()
      Lists NotebookRuntimes in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         ListNotebookRuntimesRequest request =
             ListNotebookRuntimesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReadMask(FieldMask.newBuilder().build())
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListNotebookRuntimesResponse response =
               notebookServiceClient.listNotebookRuntimesCallable().call(request);
           for (NotebookRuntime element : response.getNotebookRuntimesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • deleteNotebookRuntimeAsync

      public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookRuntimeAsync(NotebookRuntimeName name)
      Deletes a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         NotebookRuntimeName name =
             NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
         notebookServiceClient.deleteNotebookRuntimeAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntime resource to be deleted. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.
      Throws:
      ApiException - if the remote call fails
    • deleteNotebookRuntimeAsync

      public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookRuntimeAsync(String name)
      Deletes a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String name =
             NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
         notebookServiceClient.deleteNotebookRuntimeAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntime resource to be deleted. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.
      Throws:
      ApiException - if the remote call fails
    • deleteNotebookRuntimeAsync

      public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookRuntimeAsync(DeleteNotebookRuntimeRequest request)
      Deletes a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         DeleteNotebookRuntimeRequest request =
             DeleteNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         notebookServiceClient.deleteNotebookRuntimeAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteNotebookRuntimeOperationCallable

      public final OperationCallable<DeleteNotebookRuntimeRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookRuntimeOperationCallable()
      Deletes a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         DeleteNotebookRuntimeRequest request =
             DeleteNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         OperationFuture<Empty, DeleteOperationMetadata> future =
             notebookServiceClient.deleteNotebookRuntimeOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteNotebookRuntimeCallable

      public final UnaryCallable<DeleteNotebookRuntimeRequest,Operation> deleteNotebookRuntimeCallable()
      Deletes a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         DeleteNotebookRuntimeRequest request =
             DeleteNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             notebookServiceClient.deleteNotebookRuntimeCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • upgradeNotebookRuntimeAsync

      Upgrades a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         NotebookRuntimeName name =
             NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
         UpgradeNotebookRuntimeResponse response =
             notebookServiceClient.upgradeNotebookRuntimeAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntime resource to be upgrade. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.
      Throws:
      ApiException - if the remote call fails
    • upgradeNotebookRuntimeAsync

      Upgrades a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String name =
             NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
         UpgradeNotebookRuntimeResponse response =
             notebookServiceClient.upgradeNotebookRuntimeAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntime resource to be upgrade. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.
      Throws:
      ApiException - if the remote call fails
    • upgradeNotebookRuntimeAsync

      Upgrades a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         UpgradeNotebookRuntimeRequest request =
             UpgradeNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         UpgradeNotebookRuntimeResponse response =
             notebookServiceClient.upgradeNotebookRuntimeAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • upgradeNotebookRuntimeOperationCallable

      Upgrades a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         UpgradeNotebookRuntimeRequest request =
             UpgradeNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         OperationFuture<UpgradeNotebookRuntimeResponse, UpgradeNotebookRuntimeOperationMetadata>
             future =
                 notebookServiceClient.upgradeNotebookRuntimeOperationCallable().futureCall(request);
         // Do something.
         UpgradeNotebookRuntimeResponse response = future.get();
       }
       
    • upgradeNotebookRuntimeCallable

      public final UnaryCallable<UpgradeNotebookRuntimeRequest,Operation> upgradeNotebookRuntimeCallable()
      Upgrades a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         UpgradeNotebookRuntimeRequest request =
             UpgradeNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             notebookServiceClient.upgradeNotebookRuntimeCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • startNotebookRuntimeAsync

      Starts a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         NotebookRuntimeName name =
             NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
         StartNotebookRuntimeResponse response =
             notebookServiceClient.startNotebookRuntimeAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntime resource to be started. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.
      Throws:
      ApiException - if the remote call fails
    • startNotebookRuntimeAsync

      Starts a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String name =
             NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
         StartNotebookRuntimeResponse response =
             notebookServiceClient.startNotebookRuntimeAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntime resource to be started. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.
      Throws:
      ApiException - if the remote call fails
    • startNotebookRuntimeAsync

      Starts a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         StartNotebookRuntimeRequest request =
             StartNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         StartNotebookRuntimeResponse response =
             notebookServiceClient.startNotebookRuntimeAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • startNotebookRuntimeOperationCallable

      Starts a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         StartNotebookRuntimeRequest request =
             StartNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         OperationFuture<StartNotebookRuntimeResponse, StartNotebookRuntimeOperationMetadata> future =
             notebookServiceClient.startNotebookRuntimeOperationCallable().futureCall(request);
         // Do something.
         StartNotebookRuntimeResponse response = future.get();
       }
       
    • startNotebookRuntimeCallable

      public final UnaryCallable<StartNotebookRuntimeRequest,Operation> startNotebookRuntimeCallable()
      Starts a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         StartNotebookRuntimeRequest request =
             StartNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             notebookServiceClient.startNotebookRuntimeCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • stopNotebookRuntimeAsync

      Stops a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         NotebookRuntimeName name =
             NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
         StopNotebookRuntimeResponse response =
             notebookServiceClient.stopNotebookRuntimeAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntime resource to be stopped. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.
      Throws:
      ApiException - if the remote call fails
    • stopNotebookRuntimeAsync

      Stops a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String name =
             NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
         StopNotebookRuntimeResponse response =
             notebookServiceClient.stopNotebookRuntimeAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookRuntime resource to be stopped. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.
      Throws:
      ApiException - if the remote call fails
    • stopNotebookRuntimeAsync

      Stops a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         StopNotebookRuntimeRequest request =
             StopNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         StopNotebookRuntimeResponse response =
             notebookServiceClient.stopNotebookRuntimeAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • stopNotebookRuntimeOperationCallable

      Stops a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         StopNotebookRuntimeRequest request =
             StopNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         OperationFuture<StopNotebookRuntimeResponse, StopNotebookRuntimeOperationMetadata> future =
             notebookServiceClient.stopNotebookRuntimeOperationCallable().futureCall(request);
         // Do something.
         StopNotebookRuntimeResponse response = future.get();
       }
       
    • stopNotebookRuntimeCallable

      public final UnaryCallable<StopNotebookRuntimeRequest,Operation> stopNotebookRuntimeCallable()
      Stops a NotebookRuntime.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         StopNotebookRuntimeRequest request =
             StopNotebookRuntimeRequest.newBuilder()
                 .setName(
                     NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             notebookServiceClient.stopNotebookRuntimeCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • createNotebookExecutionJobAsync

      public final OperationFuture<NotebookExecutionJob,CreateNotebookExecutionJobOperationMetadata> createNotebookExecutionJobAsync(LocationName parent, NotebookExecutionJob notebookExecutionJob, String notebookExecutionJobId)
      Creates a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         NotebookExecutionJob notebookExecutionJob = NotebookExecutionJob.newBuilder().build();
         String notebookExecutionJobId = "notebookExecutionJobId1598189627";
         NotebookExecutionJob response =
             notebookServiceClient
                 .createNotebookExecutionJobAsync(parent, notebookExecutionJob, notebookExecutionJobId)
                 .get();
       }
       
      Parameters:
      parent - Required. The resource name of the Location to create the NotebookExecutionJob. Format: `projects/{project}/locations/{location}`
      notebookExecutionJob - Required. The NotebookExecutionJob to create.
      notebookExecutionJobId - Optional. User specified ID for the NotebookExecutionJob.
      Throws:
      ApiException - if the remote call fails
    • createNotebookExecutionJobAsync

      public final OperationFuture<NotebookExecutionJob,CreateNotebookExecutionJobOperationMetadata> createNotebookExecutionJobAsync(String parent, NotebookExecutionJob notebookExecutionJob, String notebookExecutionJobId)
      Creates a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         NotebookExecutionJob notebookExecutionJob = NotebookExecutionJob.newBuilder().build();
         String notebookExecutionJobId = "notebookExecutionJobId1598189627";
         NotebookExecutionJob response =
             notebookServiceClient
                 .createNotebookExecutionJobAsync(parent, notebookExecutionJob, notebookExecutionJobId)
                 .get();
       }
       
      Parameters:
      parent - Required. The resource name of the Location to create the NotebookExecutionJob. Format: `projects/{project}/locations/{location}`
      notebookExecutionJob - Required. The NotebookExecutionJob to create.
      notebookExecutionJobId - Optional. User specified ID for the NotebookExecutionJob.
      Throws:
      ApiException - if the remote call fails
    • createNotebookExecutionJobAsync

      Creates a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         CreateNotebookExecutionJobRequest request =
             CreateNotebookExecutionJobRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setNotebookExecutionJob(NotebookExecutionJob.newBuilder().build())
                 .setNotebookExecutionJobId("notebookExecutionJobId1598189627")
                 .build();
         NotebookExecutionJob response =
             notebookServiceClient.createNotebookExecutionJobAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createNotebookExecutionJobOperationCallable

      Creates a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         CreateNotebookExecutionJobRequest request =
             CreateNotebookExecutionJobRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setNotebookExecutionJob(NotebookExecutionJob.newBuilder().build())
                 .setNotebookExecutionJobId("notebookExecutionJobId1598189627")
                 .build();
         OperationFuture<NotebookExecutionJob, CreateNotebookExecutionJobOperationMetadata> future =
             notebookServiceClient.createNotebookExecutionJobOperationCallable().futureCall(request);
         // Do something.
         NotebookExecutionJob response = future.get();
       }
       
    • createNotebookExecutionJobCallable

      public final UnaryCallable<CreateNotebookExecutionJobRequest,Operation> createNotebookExecutionJobCallable()
      Creates a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         CreateNotebookExecutionJobRequest request =
             CreateNotebookExecutionJobRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setNotebookExecutionJob(NotebookExecutionJob.newBuilder().build())
                 .setNotebookExecutionJobId("notebookExecutionJobId1598189627")
                 .build();
         ApiFuture<Operation> future =
             notebookServiceClient.createNotebookExecutionJobCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getNotebookExecutionJob

      public final NotebookExecutionJob getNotebookExecutionJob(NotebookExecutionJobName name)
      Gets a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         NotebookExecutionJobName name =
             NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]");
         NotebookExecutionJob response = notebookServiceClient.getNotebookExecutionJob(name);
       }
       
      Parameters:
      name - Required. The name of the NotebookExecutionJob resource.
      Throws:
      ApiException - if the remote call fails
    • getNotebookExecutionJob

      public final NotebookExecutionJob getNotebookExecutionJob(String name)
      Gets a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String name =
             NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]")
                 .toString();
         NotebookExecutionJob response = notebookServiceClient.getNotebookExecutionJob(name);
       }
       
      Parameters:
      name - Required. The name of the NotebookExecutionJob resource.
      Throws:
      ApiException - if the remote call fails
    • getNotebookExecutionJob

      public final NotebookExecutionJob getNotebookExecutionJob(GetNotebookExecutionJobRequest request)
      Gets a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         GetNotebookExecutionJobRequest request =
             GetNotebookExecutionJobRequest.newBuilder()
                 .setName(
                     NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]")
                         .toString())
                 .setView(NotebookExecutionJobView.forNumber(0))
                 .build();
         NotebookExecutionJob response = notebookServiceClient.getNotebookExecutionJob(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getNotebookExecutionJobCallable

      public final UnaryCallable<GetNotebookExecutionJobRequest,NotebookExecutionJob> getNotebookExecutionJobCallable()
      Gets a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         GetNotebookExecutionJobRequest request =
             GetNotebookExecutionJobRequest.newBuilder()
                 .setName(
                     NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]")
                         .toString())
                 .setView(NotebookExecutionJobView.forNumber(0))
                 .build();
         ApiFuture<NotebookExecutionJob> future =
             notebookServiceClient.getNotebookExecutionJobCallable().futureCall(request);
         // Do something.
         NotebookExecutionJob response = future.get();
       }
       
    • listNotebookExecutionJobs

      public final NotebookServiceClient.ListNotebookExecutionJobsPagedResponse listNotebookExecutionJobs(LocationName parent)
      Lists NotebookExecutionJobs in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (NotebookExecutionJob element :
             notebookServiceClient.listNotebookExecutionJobs(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The resource name of the Location from which to list the NotebookExecutionJobs. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listNotebookExecutionJobs

      public final NotebookServiceClient.ListNotebookExecutionJobsPagedResponse listNotebookExecutionJobs(String parent)
      Lists NotebookExecutionJobs in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (NotebookExecutionJob element :
             notebookServiceClient.listNotebookExecutionJobs(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The resource name of the Location from which to list the NotebookExecutionJobs. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listNotebookExecutionJobs

      Lists NotebookExecutionJobs in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         ListNotebookExecutionJobsRequest request =
             ListNotebookExecutionJobsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setOrderBy("orderBy-1207110587")
                 .setView(NotebookExecutionJobView.forNumber(0))
                 .build();
         for (NotebookExecutionJob element :
             notebookServiceClient.listNotebookExecutionJobs(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listNotebookExecutionJobsPagedCallable

      Lists NotebookExecutionJobs in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         ListNotebookExecutionJobsRequest request =
             ListNotebookExecutionJobsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setOrderBy("orderBy-1207110587")
                 .setView(NotebookExecutionJobView.forNumber(0))
                 .build();
         ApiFuture<NotebookExecutionJob> future =
             notebookServiceClient.listNotebookExecutionJobsPagedCallable().futureCall(request);
         // Do something.
         for (NotebookExecutionJob element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listNotebookExecutionJobsCallable

      public final UnaryCallable<ListNotebookExecutionJobsRequest,ListNotebookExecutionJobsResponse> listNotebookExecutionJobsCallable()
      Lists NotebookExecutionJobs in a Location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         ListNotebookExecutionJobsRequest request =
             ListNotebookExecutionJobsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setOrderBy("orderBy-1207110587")
                 .setView(NotebookExecutionJobView.forNumber(0))
                 .build();
         while (true) {
           ListNotebookExecutionJobsResponse response =
               notebookServiceClient.listNotebookExecutionJobsCallable().call(request);
           for (NotebookExecutionJob element : response.getNotebookExecutionJobsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • deleteNotebookExecutionJobAsync

      public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookExecutionJobAsync(NotebookExecutionJobName name)
      Deletes a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         NotebookExecutionJobName name =
             NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]");
         notebookServiceClient.deleteNotebookExecutionJobAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookExecutionJob resource to be deleted.
      Throws:
      ApiException - if the remote call fails
    • deleteNotebookExecutionJobAsync

      public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookExecutionJobAsync(String name)
      Deletes a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         String name =
             NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]")
                 .toString();
         notebookServiceClient.deleteNotebookExecutionJobAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the NotebookExecutionJob resource to be deleted.
      Throws:
      ApiException - if the remote call fails
    • deleteNotebookExecutionJobAsync

      public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookExecutionJobAsync(DeleteNotebookExecutionJobRequest request)
      Deletes a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         DeleteNotebookExecutionJobRequest request =
             DeleteNotebookExecutionJobRequest.newBuilder()
                 .setName(
                     NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]")
                         .toString())
                 .build();
         notebookServiceClient.deleteNotebookExecutionJobAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteNotebookExecutionJobOperationCallable

      public final OperationCallable<DeleteNotebookExecutionJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookExecutionJobOperationCallable()
      Deletes a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         DeleteNotebookExecutionJobRequest request =
             DeleteNotebookExecutionJobRequest.newBuilder()
                 .setName(
                     NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]")
                         .toString())
                 .build();
         OperationFuture<Empty, DeleteOperationMetadata> future =
             notebookServiceClient.deleteNotebookExecutionJobOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteNotebookExecutionJobCallable

      public final UnaryCallable<DeleteNotebookExecutionJobRequest,Operation> deleteNotebookExecutionJobCallable()
      Deletes a NotebookExecutionJob.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         DeleteNotebookExecutionJobRequest request =
             DeleteNotebookExecutionJobRequest.newBuilder()
                 .setName(
                     NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             notebookServiceClient.deleteNotebookExecutionJobCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listLocations

      Lists information about the supported locations for this service.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listLocationsPagedCallable

      Lists information about the supported locations for this service.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future =
             notebookServiceClient.listLocationsPagedCallable().futureCall(request);
         // Do something.
         for (Location element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listLocationsCallable

      public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
      Lists information about the supported locations for this service.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (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;
           }
         }
       }
       
    • getLocation

      public final Location getLocation(GetLocationRequest request)
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         Location response = notebookServiceClient.getLocation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getLocationCallable

      public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Location> future = notebookServiceClient.getLocationCallable().futureCall(request);
         // Do something.
         Location response = future.get();
       }
       
    • setIamPolicy

      public final Policy setIamPolicy(SetIamPolicyRequest request)
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(
                     EndpointName.ofProjectLocationEndpointName(
                             "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                         .toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         Policy response = notebookServiceClient.setIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • setIamPolicyCallable

      public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(
                     EndpointName.ofProjectLocationEndpointName(
                             "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                         .toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<Policy> future = notebookServiceClient.setIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • getIamPolicy

      public final Policy getIamPolicy(GetIamPolicyRequest request)
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(
                     EndpointName.ofProjectLocationEndpointName(
                             "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                         .toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         Policy response = notebookServiceClient.getIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getIamPolicyCallable

      public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(
                     EndpointName.ofProjectLocationEndpointName(
                             "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                         .toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         ApiFuture<Policy> future = notebookServiceClient.getIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • testIamPermissions

      public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)
      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:

      
       // 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(
                     EndpointName.ofProjectLocationEndpointName(
                             "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                         .toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         TestIamPermissionsResponse response = notebookServiceClient.testIamPermissions(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • testIamPermissionsCallable

      public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()
      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:

      
       // 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(
                     EndpointName.ofProjectLocationEndpointName(
                             "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                         .toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         ApiFuture<TestIamPermissionsResponse> future =
             notebookServiceClient.testIamPermissionsCallable().futureCall(request);
         // Do something.
         TestIamPermissionsResponse response = future.get();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException