• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.google.cloud.notebooks.v1;
18 
19 import com.google.api.core.ApiFuture;
20 import com.google.api.core.ApiFutures;
21 import com.google.api.gax.core.BackgroundResource;
22 import com.google.api.gax.longrunning.OperationFuture;
23 import com.google.api.gax.paging.AbstractFixedSizeCollection;
24 import com.google.api.gax.paging.AbstractPage;
25 import com.google.api.gax.paging.AbstractPagedListResponse;
26 import com.google.api.gax.rpc.OperationCallable;
27 import com.google.api.gax.rpc.PageContext;
28 import com.google.api.gax.rpc.UnaryCallable;
29 import com.google.cloud.location.GetLocationRequest;
30 import com.google.cloud.location.ListLocationsRequest;
31 import com.google.cloud.location.ListLocationsResponse;
32 import com.google.cloud.location.Location;
33 import com.google.cloud.notebooks.v1.stub.NotebookServiceStub;
34 import com.google.cloud.notebooks.v1.stub.NotebookServiceStubSettings;
35 import com.google.common.util.concurrent.MoreExecutors;
36 import com.google.iam.v1.GetIamPolicyRequest;
37 import com.google.iam.v1.Policy;
38 import com.google.iam.v1.SetIamPolicyRequest;
39 import com.google.iam.v1.TestIamPermissionsRequest;
40 import com.google.iam.v1.TestIamPermissionsResponse;
41 import com.google.longrunning.Operation;
42 import com.google.longrunning.OperationsClient;
43 import com.google.protobuf.Empty;
44 import java.io.IOException;
45 import java.util.List;
46 import java.util.concurrent.TimeUnit;
47 import javax.annotation.Generated;
48 
49 // AUTO-GENERATED DOCUMENTATION AND CLASS.
50 /**
51  * Service Description: API v1 service for Cloud AI Platform Notebooks.
52  *
53  * <p>This class provides the ability to make remote calls to the backing service through method
54  * calls that map to API methods. Sample code to get started:
55  *
56  * <pre>{@code
57  * // This snippet has been automatically generated and should be regarded as a code template only.
58  * // It will require modifications to work:
59  * // - It may require correct/in-range values for request initialization.
60  * // - It may require specifying regional endpoints when creating the service client as shown in
61  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
62  * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
63  *   String name = "name3373707";
64  *   Instance response = notebookServiceClient.getInstance(name);
65  * }
66  * }</pre>
67  *
68  * <p>Note: close() needs to be called on the NotebookServiceClient object to clean up resources
69  * such as threads. In the example above, try-with-resources is used, which automatically calls
70  * close().
71  *
72  * <p>The surface of this class includes several types of Java methods for each of the API's
73  * methods:
74  *
75  * <ol>
76  *   <li>A "flattened" method. With this type of method, the fields of the request type have been
77  *       converted into function parameters. It may be the case that not all fields are available as
78  *       parameters, and not every API method will have a flattened method entry point.
79  *   <li>A "request object" method. This type of method only takes one parameter, a request object,
80  *       which must be constructed before the call. Not every API method will have a request object
81  *       method.
82  *   <li>A "callable" method. This type of method takes no parameters and returns an immutable API
83  *       callable object, which can be used to initiate calls to the service.
84  * </ol>
85  *
86  * <p>See the individual methods for example code.
87  *
88  * <p>Many parameters require resource names to be formatted in a particular way. To assist with
89  * these names, this class includes a format method for each type of name, and additionally a parse
90  * method to extract the individual identifiers contained within names that are returned.
91  *
92  * <p>This class can be customized by passing in a custom instance of NotebookServiceSettings to
93  * create(). For example:
94  *
95  * <p>To customize credentials:
96  *
97  * <pre>{@code
98  * // This snippet has been automatically generated and should be regarded as a code template only.
99  * // It will require modifications to work:
100  * // - It may require correct/in-range values for request initialization.
101  * // - It may require specifying regional endpoints when creating the service client as shown in
102  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
103  * NotebookServiceSettings notebookServiceSettings =
104  *     NotebookServiceSettings.newBuilder()
105  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
106  *         .build();
107  * NotebookServiceClient notebookServiceClient =
108  *     NotebookServiceClient.create(notebookServiceSettings);
109  * }</pre>
110  *
111  * <p>To customize the endpoint:
112  *
113  * <pre>{@code
114  * // This snippet has been automatically generated and should be regarded as a code template only.
115  * // It will require modifications to work:
116  * // - It may require correct/in-range values for request initialization.
117  * // - It may require specifying regional endpoints when creating the service client as shown in
118  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
119  * NotebookServiceSettings notebookServiceSettings =
120  *     NotebookServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
121  * NotebookServiceClient notebookServiceClient =
122  *     NotebookServiceClient.create(notebookServiceSettings);
123  * }</pre>
124  *
125  * <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
126  */
127 @Generated("by gapic-generator-java")
128 public class NotebookServiceClient implements BackgroundResource {
129   private final NotebookServiceSettings settings;
130   private final NotebookServiceStub stub;
131   private final OperationsClient operationsClient;
132 
133   /** Constructs an instance of NotebookServiceClient with default settings. */
create()134   public static final NotebookServiceClient create() throws IOException {
135     return create(NotebookServiceSettings.newBuilder().build());
136   }
137 
138   /**
139    * Constructs an instance of NotebookServiceClient, using the given settings. The channels are
140    * created based on the settings passed in, or defaults for any settings that are not set.
141    */
create(NotebookServiceSettings settings)142   public static final NotebookServiceClient create(NotebookServiceSettings settings)
143       throws IOException {
144     return new NotebookServiceClient(settings);
145   }
146 
147   /**
148    * Constructs an instance of NotebookServiceClient, using the given stub for making calls. This is
149    * for advanced usage - prefer using create(NotebookServiceSettings).
150    */
create(NotebookServiceStub stub)151   public static final NotebookServiceClient create(NotebookServiceStub stub) {
152     return new NotebookServiceClient(stub);
153   }
154 
155   /**
156    * Constructs an instance of NotebookServiceClient, using the given settings. This is protected so
157    * that it is easy to make a subclass, but otherwise, the static factory methods should be
158    * preferred.
159    */
NotebookServiceClient(NotebookServiceSettings settings)160   protected NotebookServiceClient(NotebookServiceSettings settings) throws IOException {
161     this.settings = settings;
162     this.stub = ((NotebookServiceStubSettings) settings.getStubSettings()).createStub();
163     this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
164   }
165 
NotebookServiceClient(NotebookServiceStub stub)166   protected NotebookServiceClient(NotebookServiceStub stub) {
167     this.settings = null;
168     this.stub = stub;
169     this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
170   }
171 
getSettings()172   public final NotebookServiceSettings getSettings() {
173     return settings;
174   }
175 
getStub()176   public NotebookServiceStub getStub() {
177     return stub;
178   }
179 
180   /**
181    * Returns the OperationsClient that can be used to query the status of a long-running operation
182    * returned by another API method call.
183    */
getOperationsClient()184   public final OperationsClient getOperationsClient() {
185     return operationsClient;
186   }
187 
188   // AUTO-GENERATED DOCUMENTATION AND METHOD.
189   /**
190    * Lists instances in a given project and location.
191    *
192    * <p>Sample code:
193    *
194    * <pre>{@code
195    * // This snippet has been automatically generated and should be regarded as a code template only.
196    * // It will require modifications to work:
197    * // - It may require correct/in-range values for request initialization.
198    * // - It may require specifying regional endpoints when creating the service client as shown in
199    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
200    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
201    *   String parent = "parent-995424086";
202    *   for (Instance element : notebookServiceClient.listInstances(parent).iterateAll()) {
203    *     // doThingsWith(element);
204    *   }
205    * }
206    * }</pre>
207    *
208    * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}`
209    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
210    */
listInstances(String parent)211   public final ListInstancesPagedResponse listInstances(String parent) {
212     ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build();
213     return listInstances(request);
214   }
215 
216   // AUTO-GENERATED DOCUMENTATION AND METHOD.
217   /**
218    * Lists instances in a given project and location.
219    *
220    * <p>Sample code:
221    *
222    * <pre>{@code
223    * // This snippet has been automatically generated and should be regarded as a code template only.
224    * // It will require modifications to work:
225    * // - It may require correct/in-range values for request initialization.
226    * // - It may require specifying regional endpoints when creating the service client as shown in
227    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
228    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
229    *   ListInstancesRequest request =
230    *       ListInstancesRequest.newBuilder()
231    *           .setParent("parent-995424086")
232    *           .setPageSize(883849137)
233    *           .setPageToken("pageToken873572522")
234    *           .build();
235    *   for (Instance element : notebookServiceClient.listInstances(request).iterateAll()) {
236    *     // doThingsWith(element);
237    *   }
238    * }
239    * }</pre>
240    *
241    * @param request The request object containing all of the parameters for the API call.
242    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
243    */
listInstances(ListInstancesRequest request)244   public final ListInstancesPagedResponse listInstances(ListInstancesRequest request) {
245     return listInstancesPagedCallable().call(request);
246   }
247 
248   // AUTO-GENERATED DOCUMENTATION AND METHOD.
249   /**
250    * Lists instances in a given project and location.
251    *
252    * <p>Sample code:
253    *
254    * <pre>{@code
255    * // This snippet has been automatically generated and should be regarded as a code template only.
256    * // It will require modifications to work:
257    * // - It may require correct/in-range values for request initialization.
258    * // - It may require specifying regional endpoints when creating the service client as shown in
259    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
260    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
261    *   ListInstancesRequest request =
262    *       ListInstancesRequest.newBuilder()
263    *           .setParent("parent-995424086")
264    *           .setPageSize(883849137)
265    *           .setPageToken("pageToken873572522")
266    *           .build();
267    *   ApiFuture<Instance> future =
268    *       notebookServiceClient.listInstancesPagedCallable().futureCall(request);
269    *   // Do something.
270    *   for (Instance element : future.get().iterateAll()) {
271    *     // doThingsWith(element);
272    *   }
273    * }
274    * }</pre>
275    */
276   public final UnaryCallable<ListInstancesRequest, ListInstancesPagedResponse>
listInstancesPagedCallable()277       listInstancesPagedCallable() {
278     return stub.listInstancesPagedCallable();
279   }
280 
281   // AUTO-GENERATED DOCUMENTATION AND METHOD.
282   /**
283    * Lists instances in a given project and location.
284    *
285    * <p>Sample code:
286    *
287    * <pre>{@code
288    * // This snippet has been automatically generated and should be regarded as a code template only.
289    * // It will require modifications to work:
290    * // - It may require correct/in-range values for request initialization.
291    * // - It may require specifying regional endpoints when creating the service client as shown in
292    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
293    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
294    *   ListInstancesRequest request =
295    *       ListInstancesRequest.newBuilder()
296    *           .setParent("parent-995424086")
297    *           .setPageSize(883849137)
298    *           .setPageToken("pageToken873572522")
299    *           .build();
300    *   while (true) {
301    *     ListInstancesResponse response =
302    *         notebookServiceClient.listInstancesCallable().call(request);
303    *     for (Instance element : response.getInstancesList()) {
304    *       // doThingsWith(element);
305    *     }
306    *     String nextPageToken = response.getNextPageToken();
307    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
308    *       request = request.toBuilder().setPageToken(nextPageToken).build();
309    *     } else {
310    *       break;
311    *     }
312    *   }
313    * }
314    * }</pre>
315    */
listInstancesCallable()316   public final UnaryCallable<ListInstancesRequest, ListInstancesResponse> listInstancesCallable() {
317     return stub.listInstancesCallable();
318   }
319 
320   // AUTO-GENERATED DOCUMENTATION AND METHOD.
321   /**
322    * Gets details of a single Instance.
323    *
324    * <p>Sample code:
325    *
326    * <pre>{@code
327    * // This snippet has been automatically generated and should be regarded as a code template only.
328    * // It will require modifications to work:
329    * // - It may require correct/in-range values for request initialization.
330    * // - It may require specifying regional endpoints when creating the service client as shown in
331    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
332    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
333    *   String name = "name3373707";
334    *   Instance response = notebookServiceClient.getInstance(name);
335    * }
336    * }</pre>
337    *
338    * @param name Required. Format:
339    *     `projects/{project_id}/locations/{location}/instances/{instance_id}`
340    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
341    */
getInstance(String name)342   public final Instance getInstance(String name) {
343     GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build();
344     return getInstance(request);
345   }
346 
347   // AUTO-GENERATED DOCUMENTATION AND METHOD.
348   /**
349    * Gets details of a single Instance.
350    *
351    * <p>Sample code:
352    *
353    * <pre>{@code
354    * // This snippet has been automatically generated and should be regarded as a code template only.
355    * // It will require modifications to work:
356    * // - It may require correct/in-range values for request initialization.
357    * // - It may require specifying regional endpoints when creating the service client as shown in
358    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
359    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
360    *   GetInstanceRequest request = GetInstanceRequest.newBuilder().setName("name3373707").build();
361    *   Instance response = notebookServiceClient.getInstance(request);
362    * }
363    * }</pre>
364    *
365    * @param request The request object containing all of the parameters for the API call.
366    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
367    */
getInstance(GetInstanceRequest request)368   public final Instance getInstance(GetInstanceRequest request) {
369     return getInstanceCallable().call(request);
370   }
371 
372   // AUTO-GENERATED DOCUMENTATION AND METHOD.
373   /**
374    * Gets details of a single Instance.
375    *
376    * <p>Sample code:
377    *
378    * <pre>{@code
379    * // This snippet has been automatically generated and should be regarded as a code template only.
380    * // It will require modifications to work:
381    * // - It may require correct/in-range values for request initialization.
382    * // - It may require specifying regional endpoints when creating the service client as shown in
383    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
384    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
385    *   GetInstanceRequest request = GetInstanceRequest.newBuilder().setName("name3373707").build();
386    *   ApiFuture<Instance> future = notebookServiceClient.getInstanceCallable().futureCall(request);
387    *   // Do something.
388    *   Instance response = future.get();
389    * }
390    * }</pre>
391    */
getInstanceCallable()392   public final UnaryCallable<GetInstanceRequest, Instance> getInstanceCallable() {
393     return stub.getInstanceCallable();
394   }
395 
396   // AUTO-GENERATED DOCUMENTATION AND METHOD.
397   /**
398    * Creates a new Instance in a given project and location.
399    *
400    * <p>Sample code:
401    *
402    * <pre>{@code
403    * // This snippet has been automatically generated and should be regarded as a code template only.
404    * // It will require modifications to work:
405    * // - It may require correct/in-range values for request initialization.
406    * // - It may require specifying regional endpoints when creating the service client as shown in
407    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
408    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
409    *   String parent = "parent-995424086";
410    *   Instance instance = Instance.newBuilder().build();
411    *   String instanceId = "instanceId902024336";
412    *   Instance response =
413    *       notebookServiceClient.createInstanceAsync(parent, instance, instanceId).get();
414    * }
415    * }</pre>
416    *
417    * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}`
418    * @param instance Required. The instance to be created.
419    * @param instanceId Required. User-defined unique ID of this instance.
420    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
421    */
createInstanceAsync( String parent, Instance instance, String instanceId)422   public final OperationFuture<Instance, OperationMetadata> createInstanceAsync(
423       String parent, Instance instance, String instanceId) {
424     CreateInstanceRequest request =
425         CreateInstanceRequest.newBuilder()
426             .setParent(parent)
427             .setInstance(instance)
428             .setInstanceId(instanceId)
429             .build();
430     return createInstanceAsync(request);
431   }
432 
433   // AUTO-GENERATED DOCUMENTATION AND METHOD.
434   /**
435    * Creates a new Instance in a given project and location.
436    *
437    * <p>Sample code:
438    *
439    * <pre>{@code
440    * // This snippet has been automatically generated and should be regarded as a code template only.
441    * // It will require modifications to work:
442    * // - It may require correct/in-range values for request initialization.
443    * // - It may require specifying regional endpoints when creating the service client as shown in
444    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
445    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
446    *   CreateInstanceRequest request =
447    *       CreateInstanceRequest.newBuilder()
448    *           .setParent("parent-995424086")
449    *           .setInstanceId("instanceId902024336")
450    *           .setInstance(Instance.newBuilder().build())
451    *           .build();
452    *   Instance response = notebookServiceClient.createInstanceAsync(request).get();
453    * }
454    * }</pre>
455    *
456    * @param request The request object containing all of the parameters for the API call.
457    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
458    */
createInstanceAsync( CreateInstanceRequest request)459   public final OperationFuture<Instance, OperationMetadata> createInstanceAsync(
460       CreateInstanceRequest request) {
461     return createInstanceOperationCallable().futureCall(request);
462   }
463 
464   // AUTO-GENERATED DOCUMENTATION AND METHOD.
465   /**
466    * Creates a new Instance in a given project and location.
467    *
468    * <p>Sample code:
469    *
470    * <pre>{@code
471    * // This snippet has been automatically generated and should be regarded as a code template only.
472    * // It will require modifications to work:
473    * // - It may require correct/in-range values for request initialization.
474    * // - It may require specifying regional endpoints when creating the service client as shown in
475    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
476    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
477    *   CreateInstanceRequest request =
478    *       CreateInstanceRequest.newBuilder()
479    *           .setParent("parent-995424086")
480    *           .setInstanceId("instanceId902024336")
481    *           .setInstance(Instance.newBuilder().build())
482    *           .build();
483    *   OperationFuture<Instance, OperationMetadata> future =
484    *       notebookServiceClient.createInstanceOperationCallable().futureCall(request);
485    *   // Do something.
486    *   Instance response = future.get();
487    * }
488    * }</pre>
489    */
490   public final OperationCallable<CreateInstanceRequest, Instance, OperationMetadata>
createInstanceOperationCallable()491       createInstanceOperationCallable() {
492     return stub.createInstanceOperationCallable();
493   }
494 
495   // AUTO-GENERATED DOCUMENTATION AND METHOD.
496   /**
497    * Creates a new Instance in a given project and location.
498    *
499    * <p>Sample code:
500    *
501    * <pre>{@code
502    * // This snippet has been automatically generated and should be regarded as a code template only.
503    * // It will require modifications to work:
504    * // - It may require correct/in-range values for request initialization.
505    * // - It may require specifying regional endpoints when creating the service client as shown in
506    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
507    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
508    *   CreateInstanceRequest request =
509    *       CreateInstanceRequest.newBuilder()
510    *           .setParent("parent-995424086")
511    *           .setInstanceId("instanceId902024336")
512    *           .setInstance(Instance.newBuilder().build())
513    *           .build();
514    *   ApiFuture<Operation> future =
515    *       notebookServiceClient.createInstanceCallable().futureCall(request);
516    *   // Do something.
517    *   Operation response = future.get();
518    * }
519    * }</pre>
520    */
createInstanceCallable()521   public final UnaryCallable<CreateInstanceRequest, Operation> createInstanceCallable() {
522     return stub.createInstanceCallable();
523   }
524 
525   // AUTO-GENERATED DOCUMENTATION AND METHOD.
526   /**
527    * Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances
528    * are instances created with the legacy Compute Engine calls. They are not manageable by the
529    * Notebooks API out of the box. This call makes these instances manageable by the Notebooks API.
530    *
531    * <p>Sample code:
532    *
533    * <pre>{@code
534    * // This snippet has been automatically generated and should be regarded as a code template only.
535    * // It will require modifications to work:
536    * // - It may require correct/in-range values for request initialization.
537    * // - It may require specifying regional endpoints when creating the service client as shown in
538    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
539    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
540    *   RegisterInstanceRequest request =
541    *       RegisterInstanceRequest.newBuilder()
542    *           .setParent("parent-995424086")
543    *           .setInstanceId("instanceId902024336")
544    *           .build();
545    *   Instance response = notebookServiceClient.registerInstanceAsync(request).get();
546    * }
547    * }</pre>
548    *
549    * @param request The request object containing all of the parameters for the API call.
550    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
551    */
registerInstanceAsync( RegisterInstanceRequest request)552   public final OperationFuture<Instance, OperationMetadata> registerInstanceAsync(
553       RegisterInstanceRequest request) {
554     return registerInstanceOperationCallable().futureCall(request);
555   }
556 
557   // AUTO-GENERATED DOCUMENTATION AND METHOD.
558   /**
559    * Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances
560    * are instances created with the legacy Compute Engine calls. They are not manageable by the
561    * Notebooks API out of the box. This call makes these instances manageable by the Notebooks API.
562    *
563    * <p>Sample code:
564    *
565    * <pre>{@code
566    * // This snippet has been automatically generated and should be regarded as a code template only.
567    * // It will require modifications to work:
568    * // - It may require correct/in-range values for request initialization.
569    * // - It may require specifying regional endpoints when creating the service client as shown in
570    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
571    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
572    *   RegisterInstanceRequest request =
573    *       RegisterInstanceRequest.newBuilder()
574    *           .setParent("parent-995424086")
575    *           .setInstanceId("instanceId902024336")
576    *           .build();
577    *   OperationFuture<Instance, OperationMetadata> future =
578    *       notebookServiceClient.registerInstanceOperationCallable().futureCall(request);
579    *   // Do something.
580    *   Instance response = future.get();
581    * }
582    * }</pre>
583    */
584   public final OperationCallable<RegisterInstanceRequest, Instance, OperationMetadata>
registerInstanceOperationCallable()585       registerInstanceOperationCallable() {
586     return stub.registerInstanceOperationCallable();
587   }
588 
589   // AUTO-GENERATED DOCUMENTATION AND METHOD.
590   /**
591    * Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances
592    * are instances created with the legacy Compute Engine calls. They are not manageable by the
593    * Notebooks API out of the box. This call makes these instances manageable by the Notebooks API.
594    *
595    * <p>Sample code:
596    *
597    * <pre>{@code
598    * // This snippet has been automatically generated and should be regarded as a code template only.
599    * // It will require modifications to work:
600    * // - It may require correct/in-range values for request initialization.
601    * // - It may require specifying regional endpoints when creating the service client as shown in
602    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
603    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
604    *   RegisterInstanceRequest request =
605    *       RegisterInstanceRequest.newBuilder()
606    *           .setParent("parent-995424086")
607    *           .setInstanceId("instanceId902024336")
608    *           .build();
609    *   ApiFuture<Operation> future =
610    *       notebookServiceClient.registerInstanceCallable().futureCall(request);
611    *   // Do something.
612    *   Operation response = future.get();
613    * }
614    * }</pre>
615    */
registerInstanceCallable()616   public final UnaryCallable<RegisterInstanceRequest, Operation> registerInstanceCallable() {
617     return stub.registerInstanceCallable();
618   }
619 
620   // AUTO-GENERATED DOCUMENTATION AND METHOD.
621   /**
622    * Updates the guest accelerators of a single Instance.
623    *
624    * <p>Sample code:
625    *
626    * <pre>{@code
627    * // This snippet has been automatically generated and should be regarded as a code template only.
628    * // It will require modifications to work:
629    * // - It may require correct/in-range values for request initialization.
630    * // - It may require specifying regional endpoints when creating the service client as shown in
631    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
632    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
633    *   SetInstanceAcceleratorRequest request =
634    *       SetInstanceAcceleratorRequest.newBuilder()
635    *           .setName("name3373707")
636    *           .setCoreCount(-1963855761)
637    *           .build();
638    *   Instance response = notebookServiceClient.setInstanceAcceleratorAsync(request).get();
639    * }
640    * }</pre>
641    *
642    * @param request The request object containing all of the parameters for the API call.
643    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
644    */
setInstanceAcceleratorAsync( SetInstanceAcceleratorRequest request)645   public final OperationFuture<Instance, OperationMetadata> setInstanceAcceleratorAsync(
646       SetInstanceAcceleratorRequest request) {
647     return setInstanceAcceleratorOperationCallable().futureCall(request);
648   }
649 
650   // AUTO-GENERATED DOCUMENTATION AND METHOD.
651   /**
652    * Updates the guest accelerators of a single Instance.
653    *
654    * <p>Sample code:
655    *
656    * <pre>{@code
657    * // This snippet has been automatically generated and should be regarded as a code template only.
658    * // It will require modifications to work:
659    * // - It may require correct/in-range values for request initialization.
660    * // - It may require specifying regional endpoints when creating the service client as shown in
661    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
662    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
663    *   SetInstanceAcceleratorRequest request =
664    *       SetInstanceAcceleratorRequest.newBuilder()
665    *           .setName("name3373707")
666    *           .setCoreCount(-1963855761)
667    *           .build();
668    *   OperationFuture<Instance, OperationMetadata> future =
669    *       notebookServiceClient.setInstanceAcceleratorOperationCallable().futureCall(request);
670    *   // Do something.
671    *   Instance response = future.get();
672    * }
673    * }</pre>
674    */
675   public final OperationCallable<SetInstanceAcceleratorRequest, Instance, OperationMetadata>
setInstanceAcceleratorOperationCallable()676       setInstanceAcceleratorOperationCallable() {
677     return stub.setInstanceAcceleratorOperationCallable();
678   }
679 
680   // AUTO-GENERATED DOCUMENTATION AND METHOD.
681   /**
682    * Updates the guest accelerators of a single Instance.
683    *
684    * <p>Sample code:
685    *
686    * <pre>{@code
687    * // This snippet has been automatically generated and should be regarded as a code template only.
688    * // It will require modifications to work:
689    * // - It may require correct/in-range values for request initialization.
690    * // - It may require specifying regional endpoints when creating the service client as shown in
691    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
692    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
693    *   SetInstanceAcceleratorRequest request =
694    *       SetInstanceAcceleratorRequest.newBuilder()
695    *           .setName("name3373707")
696    *           .setCoreCount(-1963855761)
697    *           .build();
698    *   ApiFuture<Operation> future =
699    *       notebookServiceClient.setInstanceAcceleratorCallable().futureCall(request);
700    *   // Do something.
701    *   Operation response = future.get();
702    * }
703    * }</pre>
704    */
705   public final UnaryCallable<SetInstanceAcceleratorRequest, Operation>
setInstanceAcceleratorCallable()706       setInstanceAcceleratorCallable() {
707     return stub.setInstanceAcceleratorCallable();
708   }
709 
710   // AUTO-GENERATED DOCUMENTATION AND METHOD.
711   /**
712    * Updates the machine type of a single Instance.
713    *
714    * <p>Sample code:
715    *
716    * <pre>{@code
717    * // This snippet has been automatically generated and should be regarded as a code template only.
718    * // It will require modifications to work:
719    * // - It may require correct/in-range values for request initialization.
720    * // - It may require specifying regional endpoints when creating the service client as shown in
721    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
722    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
723    *   SetInstanceMachineTypeRequest request =
724    *       SetInstanceMachineTypeRequest.newBuilder()
725    *           .setName("name3373707")
726    *           .setMachineType("machineType-218117087")
727    *           .build();
728    *   Instance response = notebookServiceClient.setInstanceMachineTypeAsync(request).get();
729    * }
730    * }</pre>
731    *
732    * @param request The request object containing all of the parameters for the API call.
733    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
734    */
setInstanceMachineTypeAsync( SetInstanceMachineTypeRequest request)735   public final OperationFuture<Instance, OperationMetadata> setInstanceMachineTypeAsync(
736       SetInstanceMachineTypeRequest request) {
737     return setInstanceMachineTypeOperationCallable().futureCall(request);
738   }
739 
740   // AUTO-GENERATED DOCUMENTATION AND METHOD.
741   /**
742    * Updates the machine type of a single Instance.
743    *
744    * <p>Sample code:
745    *
746    * <pre>{@code
747    * // This snippet has been automatically generated and should be regarded as a code template only.
748    * // It will require modifications to work:
749    * // - It may require correct/in-range values for request initialization.
750    * // - It may require specifying regional endpoints when creating the service client as shown in
751    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
752    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
753    *   SetInstanceMachineTypeRequest request =
754    *       SetInstanceMachineTypeRequest.newBuilder()
755    *           .setName("name3373707")
756    *           .setMachineType("machineType-218117087")
757    *           .build();
758    *   OperationFuture<Instance, OperationMetadata> future =
759    *       notebookServiceClient.setInstanceMachineTypeOperationCallable().futureCall(request);
760    *   // Do something.
761    *   Instance response = future.get();
762    * }
763    * }</pre>
764    */
765   public final OperationCallable<SetInstanceMachineTypeRequest, Instance, OperationMetadata>
setInstanceMachineTypeOperationCallable()766       setInstanceMachineTypeOperationCallable() {
767     return stub.setInstanceMachineTypeOperationCallable();
768   }
769 
770   // AUTO-GENERATED DOCUMENTATION AND METHOD.
771   /**
772    * Updates the machine type of a single Instance.
773    *
774    * <p>Sample code:
775    *
776    * <pre>{@code
777    * // This snippet has been automatically generated and should be regarded as a code template only.
778    * // It will require modifications to work:
779    * // - It may require correct/in-range values for request initialization.
780    * // - It may require specifying regional endpoints when creating the service client as shown in
781    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
782    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
783    *   SetInstanceMachineTypeRequest request =
784    *       SetInstanceMachineTypeRequest.newBuilder()
785    *           .setName("name3373707")
786    *           .setMachineType("machineType-218117087")
787    *           .build();
788    *   ApiFuture<Operation> future =
789    *       notebookServiceClient.setInstanceMachineTypeCallable().futureCall(request);
790    *   // Do something.
791    *   Operation response = future.get();
792    * }
793    * }</pre>
794    */
795   public final UnaryCallable<SetInstanceMachineTypeRequest, Operation>
setInstanceMachineTypeCallable()796       setInstanceMachineTypeCallable() {
797     return stub.setInstanceMachineTypeCallable();
798   }
799 
800   // AUTO-GENERATED DOCUMENTATION AND METHOD.
801   /**
802    * Update Notebook Instance configurations.
803    *
804    * <p>Sample code:
805    *
806    * <pre>{@code
807    * // This snippet has been automatically generated and should be regarded as a code template only.
808    * // It will require modifications to work:
809    * // - It may require correct/in-range values for request initialization.
810    * // - It may require specifying regional endpoints when creating the service client as shown in
811    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
812    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
813    *   UpdateInstanceConfigRequest request =
814    *       UpdateInstanceConfigRequest.newBuilder()
815    *           .setName("name3373707")
816    *           .setConfig(InstanceConfig.newBuilder().build())
817    *           .build();
818    *   Instance response = notebookServiceClient.updateInstanceConfigAsync(request).get();
819    * }
820    * }</pre>
821    *
822    * @param request The request object containing all of the parameters for the API call.
823    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
824    */
updateInstanceConfigAsync( UpdateInstanceConfigRequest request)825   public final OperationFuture<Instance, OperationMetadata> updateInstanceConfigAsync(
826       UpdateInstanceConfigRequest request) {
827     return updateInstanceConfigOperationCallable().futureCall(request);
828   }
829 
830   // AUTO-GENERATED DOCUMENTATION AND METHOD.
831   /**
832    * Update Notebook Instance configurations.
833    *
834    * <p>Sample code:
835    *
836    * <pre>{@code
837    * // This snippet has been automatically generated and should be regarded as a code template only.
838    * // It will require modifications to work:
839    * // - It may require correct/in-range values for request initialization.
840    * // - It may require specifying regional endpoints when creating the service client as shown in
841    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
842    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
843    *   UpdateInstanceConfigRequest request =
844    *       UpdateInstanceConfigRequest.newBuilder()
845    *           .setName("name3373707")
846    *           .setConfig(InstanceConfig.newBuilder().build())
847    *           .build();
848    *   OperationFuture<Instance, OperationMetadata> future =
849    *       notebookServiceClient.updateInstanceConfigOperationCallable().futureCall(request);
850    *   // Do something.
851    *   Instance response = future.get();
852    * }
853    * }</pre>
854    */
855   public final OperationCallable<UpdateInstanceConfigRequest, Instance, OperationMetadata>
updateInstanceConfigOperationCallable()856       updateInstanceConfigOperationCallable() {
857     return stub.updateInstanceConfigOperationCallable();
858   }
859 
860   // AUTO-GENERATED DOCUMENTATION AND METHOD.
861   /**
862    * Update Notebook Instance configurations.
863    *
864    * <p>Sample code:
865    *
866    * <pre>{@code
867    * // This snippet has been automatically generated and should be regarded as a code template only.
868    * // It will require modifications to work:
869    * // - It may require correct/in-range values for request initialization.
870    * // - It may require specifying regional endpoints when creating the service client as shown in
871    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
872    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
873    *   UpdateInstanceConfigRequest request =
874    *       UpdateInstanceConfigRequest.newBuilder()
875    *           .setName("name3373707")
876    *           .setConfig(InstanceConfig.newBuilder().build())
877    *           .build();
878    *   ApiFuture<Operation> future =
879    *       notebookServiceClient.updateInstanceConfigCallable().futureCall(request);
880    *   // Do something.
881    *   Operation response = future.get();
882    * }
883    * }</pre>
884    */
885   public final UnaryCallable<UpdateInstanceConfigRequest, Operation>
updateInstanceConfigCallable()886       updateInstanceConfigCallable() {
887     return stub.updateInstanceConfigCallable();
888   }
889 
890   // AUTO-GENERATED DOCUMENTATION AND METHOD.
891   /**
892    * Updates the Shielded instance configuration of a single Instance.
893    *
894    * <p>Sample code:
895    *
896    * <pre>{@code
897    * // This snippet has been automatically generated and should be regarded as a code template only.
898    * // It will require modifications to work:
899    * // - It may require correct/in-range values for request initialization.
900    * // - It may require specifying regional endpoints when creating the service client as shown in
901    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
902    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
903    *   UpdateShieldedInstanceConfigRequest request =
904    *       UpdateShieldedInstanceConfigRequest.newBuilder()
905    *           .setName("name3373707")
906    *           .setShieldedInstanceConfig(Instance.ShieldedInstanceConfig.newBuilder().build())
907    *           .build();
908    *   Instance response = notebookServiceClient.updateShieldedInstanceConfigAsync(request).get();
909    * }
910    * }</pre>
911    *
912    * @param request The request object containing all of the parameters for the API call.
913    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
914    */
updateShieldedInstanceConfigAsync( UpdateShieldedInstanceConfigRequest request)915   public final OperationFuture<Instance, OperationMetadata> updateShieldedInstanceConfigAsync(
916       UpdateShieldedInstanceConfigRequest request) {
917     return updateShieldedInstanceConfigOperationCallable().futureCall(request);
918   }
919 
920   // AUTO-GENERATED DOCUMENTATION AND METHOD.
921   /**
922    * Updates the Shielded instance configuration of a single Instance.
923    *
924    * <p>Sample code:
925    *
926    * <pre>{@code
927    * // This snippet has been automatically generated and should be regarded as a code template only.
928    * // It will require modifications to work:
929    * // - It may require correct/in-range values for request initialization.
930    * // - It may require specifying regional endpoints when creating the service client as shown in
931    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
932    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
933    *   UpdateShieldedInstanceConfigRequest request =
934    *       UpdateShieldedInstanceConfigRequest.newBuilder()
935    *           .setName("name3373707")
936    *           .setShieldedInstanceConfig(Instance.ShieldedInstanceConfig.newBuilder().build())
937    *           .build();
938    *   OperationFuture<Instance, OperationMetadata> future =
939    *       notebookServiceClient.updateShieldedInstanceConfigOperationCallable().futureCall(request);
940    *   // Do something.
941    *   Instance response = future.get();
942    * }
943    * }</pre>
944    */
945   public final OperationCallable<UpdateShieldedInstanceConfigRequest, Instance, OperationMetadata>
updateShieldedInstanceConfigOperationCallable()946       updateShieldedInstanceConfigOperationCallable() {
947     return stub.updateShieldedInstanceConfigOperationCallable();
948   }
949 
950   // AUTO-GENERATED DOCUMENTATION AND METHOD.
951   /**
952    * Updates the Shielded instance configuration of a single Instance.
953    *
954    * <p>Sample code:
955    *
956    * <pre>{@code
957    * // This snippet has been automatically generated and should be regarded as a code template only.
958    * // It will require modifications to work:
959    * // - It may require correct/in-range values for request initialization.
960    * // - It may require specifying regional endpoints when creating the service client as shown in
961    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
962    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
963    *   UpdateShieldedInstanceConfigRequest request =
964    *       UpdateShieldedInstanceConfigRequest.newBuilder()
965    *           .setName("name3373707")
966    *           .setShieldedInstanceConfig(Instance.ShieldedInstanceConfig.newBuilder().build())
967    *           .build();
968    *   ApiFuture<Operation> future =
969    *       notebookServiceClient.updateShieldedInstanceConfigCallable().futureCall(request);
970    *   // Do something.
971    *   Operation response = future.get();
972    * }
973    * }</pre>
974    */
975   public final UnaryCallable<UpdateShieldedInstanceConfigRequest, Operation>
updateShieldedInstanceConfigCallable()976       updateShieldedInstanceConfigCallable() {
977     return stub.updateShieldedInstanceConfigCallable();
978   }
979 
980   // AUTO-GENERATED DOCUMENTATION AND METHOD.
981   /**
982    * Replaces all the labels of an Instance.
983    *
984    * <p>Sample code:
985    *
986    * <pre>{@code
987    * // This snippet has been automatically generated and should be regarded as a code template only.
988    * // It will require modifications to work:
989    * // - It may require correct/in-range values for request initialization.
990    * // - It may require specifying regional endpoints when creating the service client as shown in
991    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
992    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
993    *   SetInstanceLabelsRequest request =
994    *       SetInstanceLabelsRequest.newBuilder()
995    *           .setName("name3373707")
996    *           .putAllLabels(new HashMap<String, String>())
997    *           .build();
998    *   Instance response = notebookServiceClient.setInstanceLabelsAsync(request).get();
999    * }
1000    * }</pre>
1001    *
1002    * @param request The request object containing all of the parameters for the API call.
1003    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1004    */
setInstanceLabelsAsync( SetInstanceLabelsRequest request)1005   public final OperationFuture<Instance, OperationMetadata> setInstanceLabelsAsync(
1006       SetInstanceLabelsRequest request) {
1007     return setInstanceLabelsOperationCallable().futureCall(request);
1008   }
1009 
1010   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1011   /**
1012    * Replaces all the labels of an Instance.
1013    *
1014    * <p>Sample code:
1015    *
1016    * <pre>{@code
1017    * // This snippet has been automatically generated and should be regarded as a code template only.
1018    * // It will require modifications to work:
1019    * // - It may require correct/in-range values for request initialization.
1020    * // - It may require specifying regional endpoints when creating the service client as shown in
1021    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1022    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1023    *   SetInstanceLabelsRequest request =
1024    *       SetInstanceLabelsRequest.newBuilder()
1025    *           .setName("name3373707")
1026    *           .putAllLabels(new HashMap<String, String>())
1027    *           .build();
1028    *   OperationFuture<Instance, OperationMetadata> future =
1029    *       notebookServiceClient.setInstanceLabelsOperationCallable().futureCall(request);
1030    *   // Do something.
1031    *   Instance response = future.get();
1032    * }
1033    * }</pre>
1034    */
1035   public final OperationCallable<SetInstanceLabelsRequest, Instance, OperationMetadata>
setInstanceLabelsOperationCallable()1036       setInstanceLabelsOperationCallable() {
1037     return stub.setInstanceLabelsOperationCallable();
1038   }
1039 
1040   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1041   /**
1042    * Replaces all the labels of an Instance.
1043    *
1044    * <p>Sample code:
1045    *
1046    * <pre>{@code
1047    * // This snippet has been automatically generated and should be regarded as a code template only.
1048    * // It will require modifications to work:
1049    * // - It may require correct/in-range values for request initialization.
1050    * // - It may require specifying regional endpoints when creating the service client as shown in
1051    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1052    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1053    *   SetInstanceLabelsRequest request =
1054    *       SetInstanceLabelsRequest.newBuilder()
1055    *           .setName("name3373707")
1056    *           .putAllLabels(new HashMap<String, String>())
1057    *           .build();
1058    *   ApiFuture<Operation> future =
1059    *       notebookServiceClient.setInstanceLabelsCallable().futureCall(request);
1060    *   // Do something.
1061    *   Operation response = future.get();
1062    * }
1063    * }</pre>
1064    */
setInstanceLabelsCallable()1065   public final UnaryCallable<SetInstanceLabelsRequest, Operation> setInstanceLabelsCallable() {
1066     return stub.setInstanceLabelsCallable();
1067   }
1068 
1069   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1070   /**
1071    * Add/update metadata items for an instance.
1072    *
1073    * <p>Sample code:
1074    *
1075    * <pre>{@code
1076    * // This snippet has been automatically generated and should be regarded as a code template only.
1077    * // It will require modifications to work:
1078    * // - It may require correct/in-range values for request initialization.
1079    * // - It may require specifying regional endpoints when creating the service client as shown in
1080    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1081    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1082    *   UpdateInstanceMetadataItemsRequest request =
1083    *       UpdateInstanceMetadataItemsRequest.newBuilder()
1084    *           .setName("name3373707")
1085    *           .putAllItems(new HashMap<String, String>())
1086    *           .build();
1087    *   UpdateInstanceMetadataItemsResponse response =
1088    *       notebookServiceClient.updateInstanceMetadataItems(request);
1089    * }
1090    * }</pre>
1091    *
1092    * @param request The request object containing all of the parameters for the API call.
1093    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1094    */
updateInstanceMetadataItems( UpdateInstanceMetadataItemsRequest request)1095   public final UpdateInstanceMetadataItemsResponse updateInstanceMetadataItems(
1096       UpdateInstanceMetadataItemsRequest request) {
1097     return updateInstanceMetadataItemsCallable().call(request);
1098   }
1099 
1100   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1101   /**
1102    * Add/update metadata items for an instance.
1103    *
1104    * <p>Sample code:
1105    *
1106    * <pre>{@code
1107    * // This snippet has been automatically generated and should be regarded as a code template only.
1108    * // It will require modifications to work:
1109    * // - It may require correct/in-range values for request initialization.
1110    * // - It may require specifying regional endpoints when creating the service client as shown in
1111    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1112    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1113    *   UpdateInstanceMetadataItemsRequest request =
1114    *       UpdateInstanceMetadataItemsRequest.newBuilder()
1115    *           .setName("name3373707")
1116    *           .putAllItems(new HashMap<String, String>())
1117    *           .build();
1118    *   ApiFuture<UpdateInstanceMetadataItemsResponse> future =
1119    *       notebookServiceClient.updateInstanceMetadataItemsCallable().futureCall(request);
1120    *   // Do something.
1121    *   UpdateInstanceMetadataItemsResponse response = future.get();
1122    * }
1123    * }</pre>
1124    */
1125   public final UnaryCallable<
1126           UpdateInstanceMetadataItemsRequest, UpdateInstanceMetadataItemsResponse>
updateInstanceMetadataItemsCallable()1127       updateInstanceMetadataItemsCallable() {
1128     return stub.updateInstanceMetadataItemsCallable();
1129   }
1130 
1131   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1132   /**
1133    * Deletes a single Instance.
1134    *
1135    * <p>Sample code:
1136    *
1137    * <pre>{@code
1138    * // This snippet has been automatically generated and should be regarded as a code template only.
1139    * // It will require modifications to work:
1140    * // - It may require correct/in-range values for request initialization.
1141    * // - It may require specifying regional endpoints when creating the service client as shown in
1142    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1143    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1144    *   String name = "name3373707";
1145    *   notebookServiceClient.deleteInstanceAsync(name).get();
1146    * }
1147    * }</pre>
1148    *
1149    * @param name Required. Format:
1150    *     `projects/{project_id}/locations/{location}/instances/{instance_id}`
1151    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1152    */
deleteInstanceAsync(String name)1153   public final OperationFuture<Empty, OperationMetadata> deleteInstanceAsync(String name) {
1154     DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build();
1155     return deleteInstanceAsync(request);
1156   }
1157 
1158   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1159   /**
1160    * Deletes a single Instance.
1161    *
1162    * <p>Sample code:
1163    *
1164    * <pre>{@code
1165    * // This snippet has been automatically generated and should be regarded as a code template only.
1166    * // It will require modifications to work:
1167    * // - It may require correct/in-range values for request initialization.
1168    * // - It may require specifying regional endpoints when creating the service client as shown in
1169    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1170    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1171    *   DeleteInstanceRequest request =
1172    *       DeleteInstanceRequest.newBuilder().setName("name3373707").build();
1173    *   notebookServiceClient.deleteInstanceAsync(request).get();
1174    * }
1175    * }</pre>
1176    *
1177    * @param request The request object containing all of the parameters for the API call.
1178    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1179    */
deleteInstanceAsync( DeleteInstanceRequest request)1180   public final OperationFuture<Empty, OperationMetadata> deleteInstanceAsync(
1181       DeleteInstanceRequest request) {
1182     return deleteInstanceOperationCallable().futureCall(request);
1183   }
1184 
1185   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1186   /**
1187    * Deletes a single Instance.
1188    *
1189    * <p>Sample code:
1190    *
1191    * <pre>{@code
1192    * // This snippet has been automatically generated and should be regarded as a code template only.
1193    * // It will require modifications to work:
1194    * // - It may require correct/in-range values for request initialization.
1195    * // - It may require specifying regional endpoints when creating the service client as shown in
1196    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1197    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1198    *   DeleteInstanceRequest request =
1199    *       DeleteInstanceRequest.newBuilder().setName("name3373707").build();
1200    *   OperationFuture<Empty, OperationMetadata> future =
1201    *       notebookServiceClient.deleteInstanceOperationCallable().futureCall(request);
1202    *   // Do something.
1203    *   future.get();
1204    * }
1205    * }</pre>
1206    */
1207   public final OperationCallable<DeleteInstanceRequest, Empty, OperationMetadata>
deleteInstanceOperationCallable()1208       deleteInstanceOperationCallable() {
1209     return stub.deleteInstanceOperationCallable();
1210   }
1211 
1212   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1213   /**
1214    * Deletes a single Instance.
1215    *
1216    * <p>Sample code:
1217    *
1218    * <pre>{@code
1219    * // This snippet has been automatically generated and should be regarded as a code template only.
1220    * // It will require modifications to work:
1221    * // - It may require correct/in-range values for request initialization.
1222    * // - It may require specifying regional endpoints when creating the service client as shown in
1223    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1224    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1225    *   DeleteInstanceRequest request =
1226    *       DeleteInstanceRequest.newBuilder().setName("name3373707").build();
1227    *   ApiFuture<Operation> future =
1228    *       notebookServiceClient.deleteInstanceCallable().futureCall(request);
1229    *   // Do something.
1230    *   future.get();
1231    * }
1232    * }</pre>
1233    */
deleteInstanceCallable()1234   public final UnaryCallable<DeleteInstanceRequest, Operation> deleteInstanceCallable() {
1235     return stub.deleteInstanceCallable();
1236   }
1237 
1238   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1239   /**
1240    * Starts a notebook instance.
1241    *
1242    * <p>Sample code:
1243    *
1244    * <pre>{@code
1245    * // This snippet has been automatically generated and should be regarded as a code template only.
1246    * // It will require modifications to work:
1247    * // - It may require correct/in-range values for request initialization.
1248    * // - It may require specifying regional endpoints when creating the service client as shown in
1249    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1250    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1251    *   StartInstanceRequest request =
1252    *       StartInstanceRequest.newBuilder().setName("name3373707").build();
1253    *   Instance response = notebookServiceClient.startInstanceAsync(request).get();
1254    * }
1255    * }</pre>
1256    *
1257    * @param request The request object containing all of the parameters for the API call.
1258    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1259    */
startInstanceAsync( StartInstanceRequest request)1260   public final OperationFuture<Instance, OperationMetadata> startInstanceAsync(
1261       StartInstanceRequest request) {
1262     return startInstanceOperationCallable().futureCall(request);
1263   }
1264 
1265   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1266   /**
1267    * Starts a notebook instance.
1268    *
1269    * <p>Sample code:
1270    *
1271    * <pre>{@code
1272    * // This snippet has been automatically generated and should be regarded as a code template only.
1273    * // It will require modifications to work:
1274    * // - It may require correct/in-range values for request initialization.
1275    * // - It may require specifying regional endpoints when creating the service client as shown in
1276    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1277    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1278    *   StartInstanceRequest request =
1279    *       StartInstanceRequest.newBuilder().setName("name3373707").build();
1280    *   OperationFuture<Instance, OperationMetadata> future =
1281    *       notebookServiceClient.startInstanceOperationCallable().futureCall(request);
1282    *   // Do something.
1283    *   Instance response = future.get();
1284    * }
1285    * }</pre>
1286    */
1287   public final OperationCallable<StartInstanceRequest, Instance, OperationMetadata>
startInstanceOperationCallable()1288       startInstanceOperationCallable() {
1289     return stub.startInstanceOperationCallable();
1290   }
1291 
1292   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1293   /**
1294    * Starts a notebook instance.
1295    *
1296    * <p>Sample code:
1297    *
1298    * <pre>{@code
1299    * // This snippet has been automatically generated and should be regarded as a code template only.
1300    * // It will require modifications to work:
1301    * // - It may require correct/in-range values for request initialization.
1302    * // - It may require specifying regional endpoints when creating the service client as shown in
1303    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1304    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1305    *   StartInstanceRequest request =
1306    *       StartInstanceRequest.newBuilder().setName("name3373707").build();
1307    *   ApiFuture<Operation> future =
1308    *       notebookServiceClient.startInstanceCallable().futureCall(request);
1309    *   // Do something.
1310    *   Operation response = future.get();
1311    * }
1312    * }</pre>
1313    */
startInstanceCallable()1314   public final UnaryCallable<StartInstanceRequest, Operation> startInstanceCallable() {
1315     return stub.startInstanceCallable();
1316   }
1317 
1318   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1319   /**
1320    * Stops a notebook instance.
1321    *
1322    * <p>Sample code:
1323    *
1324    * <pre>{@code
1325    * // This snippet has been automatically generated and should be regarded as a code template only.
1326    * // It will require modifications to work:
1327    * // - It may require correct/in-range values for request initialization.
1328    * // - It may require specifying regional endpoints when creating the service client as shown in
1329    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1330    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1331    *   StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build();
1332    *   Instance response = notebookServiceClient.stopInstanceAsync(request).get();
1333    * }
1334    * }</pre>
1335    *
1336    * @param request The request object containing all of the parameters for the API call.
1337    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1338    */
stopInstanceAsync( StopInstanceRequest request)1339   public final OperationFuture<Instance, OperationMetadata> stopInstanceAsync(
1340       StopInstanceRequest request) {
1341     return stopInstanceOperationCallable().futureCall(request);
1342   }
1343 
1344   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1345   /**
1346    * Stops a notebook instance.
1347    *
1348    * <p>Sample code:
1349    *
1350    * <pre>{@code
1351    * // This snippet has been automatically generated and should be regarded as a code template only.
1352    * // It will require modifications to work:
1353    * // - It may require correct/in-range values for request initialization.
1354    * // - It may require specifying regional endpoints when creating the service client as shown in
1355    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1356    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1357    *   StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build();
1358    *   OperationFuture<Instance, OperationMetadata> future =
1359    *       notebookServiceClient.stopInstanceOperationCallable().futureCall(request);
1360    *   // Do something.
1361    *   Instance response = future.get();
1362    * }
1363    * }</pre>
1364    */
1365   public final OperationCallable<StopInstanceRequest, Instance, OperationMetadata>
stopInstanceOperationCallable()1366       stopInstanceOperationCallable() {
1367     return stub.stopInstanceOperationCallable();
1368   }
1369 
1370   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1371   /**
1372    * Stops a notebook instance.
1373    *
1374    * <p>Sample code:
1375    *
1376    * <pre>{@code
1377    * // This snippet has been automatically generated and should be regarded as a code template only.
1378    * // It will require modifications to work:
1379    * // - It may require correct/in-range values for request initialization.
1380    * // - It may require specifying regional endpoints when creating the service client as shown in
1381    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1382    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1383    *   StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build();
1384    *   ApiFuture<Operation> future =
1385    *       notebookServiceClient.stopInstanceCallable().futureCall(request);
1386    *   // Do something.
1387    *   Operation response = future.get();
1388    * }
1389    * }</pre>
1390    */
stopInstanceCallable()1391   public final UnaryCallable<StopInstanceRequest, Operation> stopInstanceCallable() {
1392     return stub.stopInstanceCallable();
1393   }
1394 
1395   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1396   /**
1397    * Resets a notebook instance.
1398    *
1399    * <p>Sample code:
1400    *
1401    * <pre>{@code
1402    * // This snippet has been automatically generated and should be regarded as a code template only.
1403    * // It will require modifications to work:
1404    * // - It may require correct/in-range values for request initialization.
1405    * // - It may require specifying regional endpoints when creating the service client as shown in
1406    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1407    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1408    *   ResetInstanceRequest request =
1409    *       ResetInstanceRequest.newBuilder().setName("name3373707").build();
1410    *   Instance response = notebookServiceClient.resetInstanceAsync(request).get();
1411    * }
1412    * }</pre>
1413    *
1414    * @param request The request object containing all of the parameters for the API call.
1415    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1416    */
resetInstanceAsync( ResetInstanceRequest request)1417   public final OperationFuture<Instance, OperationMetadata> resetInstanceAsync(
1418       ResetInstanceRequest request) {
1419     return resetInstanceOperationCallable().futureCall(request);
1420   }
1421 
1422   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1423   /**
1424    * Resets a notebook instance.
1425    *
1426    * <p>Sample code:
1427    *
1428    * <pre>{@code
1429    * // This snippet has been automatically generated and should be regarded as a code template only.
1430    * // It will require modifications to work:
1431    * // - It may require correct/in-range values for request initialization.
1432    * // - It may require specifying regional endpoints when creating the service client as shown in
1433    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1434    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1435    *   ResetInstanceRequest request =
1436    *       ResetInstanceRequest.newBuilder().setName("name3373707").build();
1437    *   OperationFuture<Instance, OperationMetadata> future =
1438    *       notebookServiceClient.resetInstanceOperationCallable().futureCall(request);
1439    *   // Do something.
1440    *   Instance response = future.get();
1441    * }
1442    * }</pre>
1443    */
1444   public final OperationCallable<ResetInstanceRequest, Instance, OperationMetadata>
resetInstanceOperationCallable()1445       resetInstanceOperationCallable() {
1446     return stub.resetInstanceOperationCallable();
1447   }
1448 
1449   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1450   /**
1451    * Resets a notebook instance.
1452    *
1453    * <p>Sample code:
1454    *
1455    * <pre>{@code
1456    * // This snippet has been automatically generated and should be regarded as a code template only.
1457    * // It will require modifications to work:
1458    * // - It may require correct/in-range values for request initialization.
1459    * // - It may require specifying regional endpoints when creating the service client as shown in
1460    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1461    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1462    *   ResetInstanceRequest request =
1463    *       ResetInstanceRequest.newBuilder().setName("name3373707").build();
1464    *   ApiFuture<Operation> future =
1465    *       notebookServiceClient.resetInstanceCallable().futureCall(request);
1466    *   // Do something.
1467    *   Operation response = future.get();
1468    * }
1469    * }</pre>
1470    */
resetInstanceCallable()1471   public final UnaryCallable<ResetInstanceRequest, Operation> resetInstanceCallable() {
1472     return stub.resetInstanceCallable();
1473   }
1474 
1475   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1476   /**
1477    * Allows notebook instances to report their latest instance information to the Notebooks API
1478    * server. The server will merge the reported information to the instance metadata store. Do not
1479    * use this method directly.
1480    *
1481    * <p>Sample code:
1482    *
1483    * <pre>{@code
1484    * // This snippet has been automatically generated and should be regarded as a code template only.
1485    * // It will require modifications to work:
1486    * // - It may require correct/in-range values for request initialization.
1487    * // - It may require specifying regional endpoints when creating the service client as shown in
1488    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1489    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1490    *   ReportInstanceInfoRequest request =
1491    *       ReportInstanceInfoRequest.newBuilder()
1492    *           .setName("name3373707")
1493    *           .setVmId("vmId3622450")
1494    *           .putAllMetadata(new HashMap<String, String>())
1495    *           .build();
1496    *   Instance response = notebookServiceClient.reportInstanceInfoAsync(request).get();
1497    * }
1498    * }</pre>
1499    *
1500    * @param request The request object containing all of the parameters for the API call.
1501    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1502    */
reportInstanceInfoAsync( ReportInstanceInfoRequest request)1503   public final OperationFuture<Instance, OperationMetadata> reportInstanceInfoAsync(
1504       ReportInstanceInfoRequest request) {
1505     return reportInstanceInfoOperationCallable().futureCall(request);
1506   }
1507 
1508   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1509   /**
1510    * Allows notebook instances to report their latest instance information to the Notebooks API
1511    * server. The server will merge the reported information to the instance metadata store. Do not
1512    * use this method directly.
1513    *
1514    * <p>Sample code:
1515    *
1516    * <pre>{@code
1517    * // This snippet has been automatically generated and should be regarded as a code template only.
1518    * // It will require modifications to work:
1519    * // - It may require correct/in-range values for request initialization.
1520    * // - It may require specifying regional endpoints when creating the service client as shown in
1521    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1522    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1523    *   ReportInstanceInfoRequest request =
1524    *       ReportInstanceInfoRequest.newBuilder()
1525    *           .setName("name3373707")
1526    *           .setVmId("vmId3622450")
1527    *           .putAllMetadata(new HashMap<String, String>())
1528    *           .build();
1529    *   OperationFuture<Instance, OperationMetadata> future =
1530    *       notebookServiceClient.reportInstanceInfoOperationCallable().futureCall(request);
1531    *   // Do something.
1532    *   Instance response = future.get();
1533    * }
1534    * }</pre>
1535    */
1536   public final OperationCallable<ReportInstanceInfoRequest, Instance, OperationMetadata>
reportInstanceInfoOperationCallable()1537       reportInstanceInfoOperationCallable() {
1538     return stub.reportInstanceInfoOperationCallable();
1539   }
1540 
1541   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1542   /**
1543    * Allows notebook instances to report their latest instance information to the Notebooks API
1544    * server. The server will merge the reported information to the instance metadata store. Do not
1545    * use this method directly.
1546    *
1547    * <p>Sample code:
1548    *
1549    * <pre>{@code
1550    * // This snippet has been automatically generated and should be regarded as a code template only.
1551    * // It will require modifications to work:
1552    * // - It may require correct/in-range values for request initialization.
1553    * // - It may require specifying regional endpoints when creating the service client as shown in
1554    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1555    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1556    *   ReportInstanceInfoRequest request =
1557    *       ReportInstanceInfoRequest.newBuilder()
1558    *           .setName("name3373707")
1559    *           .setVmId("vmId3622450")
1560    *           .putAllMetadata(new HashMap<String, String>())
1561    *           .build();
1562    *   ApiFuture<Operation> future =
1563    *       notebookServiceClient.reportInstanceInfoCallable().futureCall(request);
1564    *   // Do something.
1565    *   Operation response = future.get();
1566    * }
1567    * }</pre>
1568    */
reportInstanceInfoCallable()1569   public final UnaryCallable<ReportInstanceInfoRequest, Operation> reportInstanceInfoCallable() {
1570     return stub.reportInstanceInfoCallable();
1571   }
1572 
1573   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1574   /**
1575    * Check if a notebook instance is upgradable.
1576    *
1577    * <p>Sample code:
1578    *
1579    * <pre>{@code
1580    * // This snippet has been automatically generated and should be regarded as a code template only.
1581    * // It will require modifications to work:
1582    * // - It may require correct/in-range values for request initialization.
1583    * // - It may require specifying regional endpoints when creating the service client as shown in
1584    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1585    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1586    *   IsInstanceUpgradeableRequest request =
1587    *       IsInstanceUpgradeableRequest.newBuilder()
1588    *           .setNotebookInstance("notebookInstance-544239728")
1589    *           .setType(UpgradeType.forNumber(0))
1590    *           .build();
1591    *   IsInstanceUpgradeableResponse response = notebookServiceClient.isInstanceUpgradeable(request);
1592    * }
1593    * }</pre>
1594    *
1595    * @param request The request object containing all of the parameters for the API call.
1596    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1597    */
isInstanceUpgradeable( IsInstanceUpgradeableRequest request)1598   public final IsInstanceUpgradeableResponse isInstanceUpgradeable(
1599       IsInstanceUpgradeableRequest request) {
1600     return isInstanceUpgradeableCallable().call(request);
1601   }
1602 
1603   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1604   /**
1605    * Check if a notebook instance is upgradable.
1606    *
1607    * <p>Sample code:
1608    *
1609    * <pre>{@code
1610    * // This snippet has been automatically generated and should be regarded as a code template only.
1611    * // It will require modifications to work:
1612    * // - It may require correct/in-range values for request initialization.
1613    * // - It may require specifying regional endpoints when creating the service client as shown in
1614    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1615    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1616    *   IsInstanceUpgradeableRequest request =
1617    *       IsInstanceUpgradeableRequest.newBuilder()
1618    *           .setNotebookInstance("notebookInstance-544239728")
1619    *           .setType(UpgradeType.forNumber(0))
1620    *           .build();
1621    *   ApiFuture<IsInstanceUpgradeableResponse> future =
1622    *       notebookServiceClient.isInstanceUpgradeableCallable().futureCall(request);
1623    *   // Do something.
1624    *   IsInstanceUpgradeableResponse response = future.get();
1625    * }
1626    * }</pre>
1627    */
1628   public final UnaryCallable<IsInstanceUpgradeableRequest, IsInstanceUpgradeableResponse>
isInstanceUpgradeableCallable()1629       isInstanceUpgradeableCallable() {
1630     return stub.isInstanceUpgradeableCallable();
1631   }
1632 
1633   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1634   /**
1635    * Check if a notebook instance is healthy.
1636    *
1637    * <p>Sample code:
1638    *
1639    * <pre>{@code
1640    * // This snippet has been automatically generated and should be regarded as a code template only.
1641    * // It will require modifications to work:
1642    * // - It may require correct/in-range values for request initialization.
1643    * // - It may require specifying regional endpoints when creating the service client as shown in
1644    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1645    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1646    *   InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
1647    *   GetInstanceHealthResponse response = notebookServiceClient.getInstanceHealth(name);
1648    * }
1649    * }</pre>
1650    *
1651    * @param name Required. Format:
1652    *     `projects/{project_id}/locations/{location}/instances/{instance_id}`
1653    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1654    */
getInstanceHealth(InstanceName name)1655   public final GetInstanceHealthResponse getInstanceHealth(InstanceName name) {
1656     GetInstanceHealthRequest request =
1657         GetInstanceHealthRequest.newBuilder()
1658             .setName(name == null ? null : name.toString())
1659             .build();
1660     return getInstanceHealth(request);
1661   }
1662 
1663   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1664   /**
1665    * Check if a notebook instance is healthy.
1666    *
1667    * <p>Sample code:
1668    *
1669    * <pre>{@code
1670    * // This snippet has been automatically generated and should be regarded as a code template only.
1671    * // It will require modifications to work:
1672    * // - It may require correct/in-range values for request initialization.
1673    * // - It may require specifying regional endpoints when creating the service client as shown in
1674    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1675    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1676    *   String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
1677    *   GetInstanceHealthResponse response = notebookServiceClient.getInstanceHealth(name);
1678    * }
1679    * }</pre>
1680    *
1681    * @param name Required. Format:
1682    *     `projects/{project_id}/locations/{location}/instances/{instance_id}`
1683    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1684    */
getInstanceHealth(String name)1685   public final GetInstanceHealthResponse getInstanceHealth(String name) {
1686     GetInstanceHealthRequest request = GetInstanceHealthRequest.newBuilder().setName(name).build();
1687     return getInstanceHealth(request);
1688   }
1689 
1690   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1691   /**
1692    * Check if a notebook instance is healthy.
1693    *
1694    * <p>Sample code:
1695    *
1696    * <pre>{@code
1697    * // This snippet has been automatically generated and should be regarded as a code template only.
1698    * // It will require modifications to work:
1699    * // - It may require correct/in-range values for request initialization.
1700    * // - It may require specifying regional endpoints when creating the service client as shown in
1701    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1702    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1703    *   GetInstanceHealthRequest request =
1704    *       GetInstanceHealthRequest.newBuilder()
1705    *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
1706    *           .build();
1707    *   GetInstanceHealthResponse response = notebookServiceClient.getInstanceHealth(request);
1708    * }
1709    * }</pre>
1710    *
1711    * @param request The request object containing all of the parameters for the API call.
1712    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1713    */
getInstanceHealth(GetInstanceHealthRequest request)1714   public final GetInstanceHealthResponse getInstanceHealth(GetInstanceHealthRequest request) {
1715     return getInstanceHealthCallable().call(request);
1716   }
1717 
1718   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1719   /**
1720    * Check if a notebook instance is healthy.
1721    *
1722    * <p>Sample code:
1723    *
1724    * <pre>{@code
1725    * // This snippet has been automatically generated and should be regarded as a code template only.
1726    * // It will require modifications to work:
1727    * // - It may require correct/in-range values for request initialization.
1728    * // - It may require specifying regional endpoints when creating the service client as shown in
1729    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1730    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1731    *   GetInstanceHealthRequest request =
1732    *       GetInstanceHealthRequest.newBuilder()
1733    *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
1734    *           .build();
1735    *   ApiFuture<GetInstanceHealthResponse> future =
1736    *       notebookServiceClient.getInstanceHealthCallable().futureCall(request);
1737    *   // Do something.
1738    *   GetInstanceHealthResponse response = future.get();
1739    * }
1740    * }</pre>
1741    */
1742   public final UnaryCallable<GetInstanceHealthRequest, GetInstanceHealthResponse>
getInstanceHealthCallable()1743       getInstanceHealthCallable() {
1744     return stub.getInstanceHealthCallable();
1745   }
1746 
1747   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1748   /**
1749    * Upgrades a notebook instance to the latest version.
1750    *
1751    * <p>Sample code:
1752    *
1753    * <pre>{@code
1754    * // This snippet has been automatically generated and should be regarded as a code template only.
1755    * // It will require modifications to work:
1756    * // - It may require correct/in-range values for request initialization.
1757    * // - It may require specifying regional endpoints when creating the service client as shown in
1758    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1759    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1760    *   UpgradeInstanceRequest request =
1761    *       UpgradeInstanceRequest.newBuilder()
1762    *           .setName("name3373707")
1763    *           .setType(UpgradeType.forNumber(0))
1764    *           .build();
1765    *   Instance response = notebookServiceClient.upgradeInstanceAsync(request).get();
1766    * }
1767    * }</pre>
1768    *
1769    * @param request The request object containing all of the parameters for the API call.
1770    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1771    */
upgradeInstanceAsync( UpgradeInstanceRequest request)1772   public final OperationFuture<Instance, OperationMetadata> upgradeInstanceAsync(
1773       UpgradeInstanceRequest request) {
1774     return upgradeInstanceOperationCallable().futureCall(request);
1775   }
1776 
1777   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1778   /**
1779    * Upgrades a notebook instance to the latest version.
1780    *
1781    * <p>Sample code:
1782    *
1783    * <pre>{@code
1784    * // This snippet has been automatically generated and should be regarded as a code template only.
1785    * // It will require modifications to work:
1786    * // - It may require correct/in-range values for request initialization.
1787    * // - It may require specifying regional endpoints when creating the service client as shown in
1788    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1789    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1790    *   UpgradeInstanceRequest request =
1791    *       UpgradeInstanceRequest.newBuilder()
1792    *           .setName("name3373707")
1793    *           .setType(UpgradeType.forNumber(0))
1794    *           .build();
1795    *   OperationFuture<Instance, OperationMetadata> future =
1796    *       notebookServiceClient.upgradeInstanceOperationCallable().futureCall(request);
1797    *   // Do something.
1798    *   Instance response = future.get();
1799    * }
1800    * }</pre>
1801    */
1802   public final OperationCallable<UpgradeInstanceRequest, Instance, OperationMetadata>
upgradeInstanceOperationCallable()1803       upgradeInstanceOperationCallable() {
1804     return stub.upgradeInstanceOperationCallable();
1805   }
1806 
1807   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1808   /**
1809    * Upgrades a notebook instance to the latest version.
1810    *
1811    * <p>Sample code:
1812    *
1813    * <pre>{@code
1814    * // This snippet has been automatically generated and should be regarded as a code template only.
1815    * // It will require modifications to work:
1816    * // - It may require correct/in-range values for request initialization.
1817    * // - It may require specifying regional endpoints when creating the service client as shown in
1818    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1819    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1820    *   UpgradeInstanceRequest request =
1821    *       UpgradeInstanceRequest.newBuilder()
1822    *           .setName("name3373707")
1823    *           .setType(UpgradeType.forNumber(0))
1824    *           .build();
1825    *   ApiFuture<Operation> future =
1826    *       notebookServiceClient.upgradeInstanceCallable().futureCall(request);
1827    *   // Do something.
1828    *   Operation response = future.get();
1829    * }
1830    * }</pre>
1831    */
upgradeInstanceCallable()1832   public final UnaryCallable<UpgradeInstanceRequest, Operation> upgradeInstanceCallable() {
1833     return stub.upgradeInstanceCallable();
1834   }
1835 
1836   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1837   /**
1838    * Rollbacks a notebook instance to the previous version.
1839    *
1840    * <p>Sample code:
1841    *
1842    * <pre>{@code
1843    * // This snippet has been automatically generated and should be regarded as a code template only.
1844    * // It will require modifications to work:
1845    * // - It may require correct/in-range values for request initialization.
1846    * // - It may require specifying regional endpoints when creating the service client as shown in
1847    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1848    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1849    *   RollbackInstanceRequest request =
1850    *       RollbackInstanceRequest.newBuilder()
1851    *           .setName("name3373707")
1852    *           .setTargetSnapshot("targetSnapshot-1307211147")
1853    *           .build();
1854    *   Instance response = notebookServiceClient.rollbackInstanceAsync(request).get();
1855    * }
1856    * }</pre>
1857    *
1858    * @param request The request object containing all of the parameters for the API call.
1859    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1860    */
rollbackInstanceAsync( RollbackInstanceRequest request)1861   public final OperationFuture<Instance, OperationMetadata> rollbackInstanceAsync(
1862       RollbackInstanceRequest request) {
1863     return rollbackInstanceOperationCallable().futureCall(request);
1864   }
1865 
1866   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1867   /**
1868    * Rollbacks a notebook instance to the previous version.
1869    *
1870    * <p>Sample code:
1871    *
1872    * <pre>{@code
1873    * // This snippet has been automatically generated and should be regarded as a code template only.
1874    * // It will require modifications to work:
1875    * // - It may require correct/in-range values for request initialization.
1876    * // - It may require specifying regional endpoints when creating the service client as shown in
1877    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1878    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1879    *   RollbackInstanceRequest request =
1880    *       RollbackInstanceRequest.newBuilder()
1881    *           .setName("name3373707")
1882    *           .setTargetSnapshot("targetSnapshot-1307211147")
1883    *           .build();
1884    *   OperationFuture<Instance, OperationMetadata> future =
1885    *       notebookServiceClient.rollbackInstanceOperationCallable().futureCall(request);
1886    *   // Do something.
1887    *   Instance response = future.get();
1888    * }
1889    * }</pre>
1890    */
1891   public final OperationCallable<RollbackInstanceRequest, Instance, OperationMetadata>
rollbackInstanceOperationCallable()1892       rollbackInstanceOperationCallable() {
1893     return stub.rollbackInstanceOperationCallable();
1894   }
1895 
1896   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1897   /**
1898    * Rollbacks a notebook instance to the previous version.
1899    *
1900    * <p>Sample code:
1901    *
1902    * <pre>{@code
1903    * // This snippet has been automatically generated and should be regarded as a code template only.
1904    * // It will require modifications to work:
1905    * // - It may require correct/in-range values for request initialization.
1906    * // - It may require specifying regional endpoints when creating the service client as shown in
1907    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1908    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1909    *   RollbackInstanceRequest request =
1910    *       RollbackInstanceRequest.newBuilder()
1911    *           .setName("name3373707")
1912    *           .setTargetSnapshot("targetSnapshot-1307211147")
1913    *           .build();
1914    *   ApiFuture<Operation> future =
1915    *       notebookServiceClient.rollbackInstanceCallable().futureCall(request);
1916    *   // Do something.
1917    *   Operation response = future.get();
1918    * }
1919    * }</pre>
1920    */
rollbackInstanceCallable()1921   public final UnaryCallable<RollbackInstanceRequest, Operation> rollbackInstanceCallable() {
1922     return stub.rollbackInstanceCallable();
1923   }
1924 
1925   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1926   /**
1927    * Creates a Diagnostic File and runs Diagnostic Tool given an Instance.
1928    *
1929    * <p>Sample code:
1930    *
1931    * <pre>{@code
1932    * // This snippet has been automatically generated and should be regarded as a code template only.
1933    * // It will require modifications to work:
1934    * // - It may require correct/in-range values for request initialization.
1935    * // - It may require specifying regional endpoints when creating the service client as shown in
1936    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1937    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1938    *   InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
1939    *   DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build();
1940    *   Instance response = notebookServiceClient.diagnoseInstanceAsync(name, diagnosticConfig).get();
1941    * }
1942    * }</pre>
1943    *
1944    * @param name Required. Format:
1945    *     `projects/{project_id}/locations/{location}/instances/{instance_id}`
1946    * @param diagnosticConfig Required. Defines flags that are used to run the diagnostic tool
1947    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1948    */
diagnoseInstanceAsync( InstanceName name, DiagnosticConfig diagnosticConfig)1949   public final OperationFuture<Instance, OperationMetadata> diagnoseInstanceAsync(
1950       InstanceName name, DiagnosticConfig diagnosticConfig) {
1951     DiagnoseInstanceRequest request =
1952         DiagnoseInstanceRequest.newBuilder()
1953             .setName(name == null ? null : name.toString())
1954             .setDiagnosticConfig(diagnosticConfig)
1955             .build();
1956     return diagnoseInstanceAsync(request);
1957   }
1958 
1959   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1960   /**
1961    * Creates a Diagnostic File and runs Diagnostic Tool given an Instance.
1962    *
1963    * <p>Sample code:
1964    *
1965    * <pre>{@code
1966    * // This snippet has been automatically generated and should be regarded as a code template only.
1967    * // It will require modifications to work:
1968    * // - It may require correct/in-range values for request initialization.
1969    * // - It may require specifying regional endpoints when creating the service client as shown in
1970    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1971    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
1972    *   String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
1973    *   DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build();
1974    *   Instance response = notebookServiceClient.diagnoseInstanceAsync(name, diagnosticConfig).get();
1975    * }
1976    * }</pre>
1977    *
1978    * @param name Required. Format:
1979    *     `projects/{project_id}/locations/{location}/instances/{instance_id}`
1980    * @param diagnosticConfig Required. Defines flags that are used to run the diagnostic tool
1981    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1982    */
diagnoseInstanceAsync( String name, DiagnosticConfig diagnosticConfig)1983   public final OperationFuture<Instance, OperationMetadata> diagnoseInstanceAsync(
1984       String name, DiagnosticConfig diagnosticConfig) {
1985     DiagnoseInstanceRequest request =
1986         DiagnoseInstanceRequest.newBuilder()
1987             .setName(name)
1988             .setDiagnosticConfig(diagnosticConfig)
1989             .build();
1990     return diagnoseInstanceAsync(request);
1991   }
1992 
1993   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1994   /**
1995    * Creates a Diagnostic File and runs Diagnostic Tool given an Instance.
1996    *
1997    * <p>Sample code:
1998    *
1999    * <pre>{@code
2000    * // This snippet has been automatically generated and should be regarded as a code template only.
2001    * // It will require modifications to work:
2002    * // - It may require correct/in-range values for request initialization.
2003    * // - It may require specifying regional endpoints when creating the service client as shown in
2004    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2005    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2006    *   DiagnoseInstanceRequest request =
2007    *       DiagnoseInstanceRequest.newBuilder()
2008    *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
2009    *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
2010    *           .build();
2011    *   Instance response = notebookServiceClient.diagnoseInstanceAsync(request).get();
2012    * }
2013    * }</pre>
2014    *
2015    * @param request The request object containing all of the parameters for the API call.
2016    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2017    */
diagnoseInstanceAsync( DiagnoseInstanceRequest request)2018   public final OperationFuture<Instance, OperationMetadata> diagnoseInstanceAsync(
2019       DiagnoseInstanceRequest request) {
2020     return diagnoseInstanceOperationCallable().futureCall(request);
2021   }
2022 
2023   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2024   /**
2025    * Creates a Diagnostic File and runs Diagnostic Tool given an Instance.
2026    *
2027    * <p>Sample code:
2028    *
2029    * <pre>{@code
2030    * // This snippet has been automatically generated and should be regarded as a code template only.
2031    * // It will require modifications to work:
2032    * // - It may require correct/in-range values for request initialization.
2033    * // - It may require specifying regional endpoints when creating the service client as shown in
2034    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2035    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2036    *   DiagnoseInstanceRequest request =
2037    *       DiagnoseInstanceRequest.newBuilder()
2038    *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
2039    *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
2040    *           .build();
2041    *   OperationFuture<Instance, OperationMetadata> future =
2042    *       notebookServiceClient.diagnoseInstanceOperationCallable().futureCall(request);
2043    *   // Do something.
2044    *   Instance response = future.get();
2045    * }
2046    * }</pre>
2047    */
2048   public final OperationCallable<DiagnoseInstanceRequest, Instance, OperationMetadata>
diagnoseInstanceOperationCallable()2049       diagnoseInstanceOperationCallable() {
2050     return stub.diagnoseInstanceOperationCallable();
2051   }
2052 
2053   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2054   /**
2055    * Creates a Diagnostic File and runs Diagnostic Tool given an Instance.
2056    *
2057    * <p>Sample code:
2058    *
2059    * <pre>{@code
2060    * // This snippet has been automatically generated and should be regarded as a code template only.
2061    * // It will require modifications to work:
2062    * // - It may require correct/in-range values for request initialization.
2063    * // - It may require specifying regional endpoints when creating the service client as shown in
2064    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2065    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2066    *   DiagnoseInstanceRequest request =
2067    *       DiagnoseInstanceRequest.newBuilder()
2068    *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
2069    *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
2070    *           .build();
2071    *   ApiFuture<Operation> future =
2072    *       notebookServiceClient.diagnoseInstanceCallable().futureCall(request);
2073    *   // Do something.
2074    *   Operation response = future.get();
2075    * }
2076    * }</pre>
2077    */
diagnoseInstanceCallable()2078   public final UnaryCallable<DiagnoseInstanceRequest, Operation> diagnoseInstanceCallable() {
2079     return stub.diagnoseInstanceCallable();
2080   }
2081 
2082   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2083   /**
2084    * Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method
2085    * directly.
2086    *
2087    * <p>Sample code:
2088    *
2089    * <pre>{@code
2090    * // This snippet has been automatically generated and should be regarded as a code template only.
2091    * // It will require modifications to work:
2092    * // - It may require correct/in-range values for request initialization.
2093    * // - It may require specifying regional endpoints when creating the service client as shown in
2094    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2095    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2096    *   UpgradeInstanceInternalRequest request =
2097    *       UpgradeInstanceInternalRequest.newBuilder()
2098    *           .setName("name3373707")
2099    *           .setVmId("vmId3622450")
2100    *           .setType(UpgradeType.forNumber(0))
2101    *           .build();
2102    *   Instance response = notebookServiceClient.upgradeInstanceInternalAsync(request).get();
2103    * }
2104    * }</pre>
2105    *
2106    * @param request The request object containing all of the parameters for the API call.
2107    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2108    */
upgradeInstanceInternalAsync( UpgradeInstanceInternalRequest request)2109   public final OperationFuture<Instance, OperationMetadata> upgradeInstanceInternalAsync(
2110       UpgradeInstanceInternalRequest request) {
2111     return upgradeInstanceInternalOperationCallable().futureCall(request);
2112   }
2113 
2114   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2115   /**
2116    * Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method
2117    * directly.
2118    *
2119    * <p>Sample code:
2120    *
2121    * <pre>{@code
2122    * // This snippet has been automatically generated and should be regarded as a code template only.
2123    * // It will require modifications to work:
2124    * // - It may require correct/in-range values for request initialization.
2125    * // - It may require specifying regional endpoints when creating the service client as shown in
2126    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2127    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2128    *   UpgradeInstanceInternalRequest request =
2129    *       UpgradeInstanceInternalRequest.newBuilder()
2130    *           .setName("name3373707")
2131    *           .setVmId("vmId3622450")
2132    *           .setType(UpgradeType.forNumber(0))
2133    *           .build();
2134    *   OperationFuture<Instance, OperationMetadata> future =
2135    *       notebookServiceClient.upgradeInstanceInternalOperationCallable().futureCall(request);
2136    *   // Do something.
2137    *   Instance response = future.get();
2138    * }
2139    * }</pre>
2140    */
2141   public final OperationCallable<UpgradeInstanceInternalRequest, Instance, OperationMetadata>
upgradeInstanceInternalOperationCallable()2142       upgradeInstanceInternalOperationCallable() {
2143     return stub.upgradeInstanceInternalOperationCallable();
2144   }
2145 
2146   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2147   /**
2148    * Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method
2149    * directly.
2150    *
2151    * <p>Sample code:
2152    *
2153    * <pre>{@code
2154    * // This snippet has been automatically generated and should be regarded as a code template only.
2155    * // It will require modifications to work:
2156    * // - It may require correct/in-range values for request initialization.
2157    * // - It may require specifying regional endpoints when creating the service client as shown in
2158    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2159    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2160    *   UpgradeInstanceInternalRequest request =
2161    *       UpgradeInstanceInternalRequest.newBuilder()
2162    *           .setName("name3373707")
2163    *           .setVmId("vmId3622450")
2164    *           .setType(UpgradeType.forNumber(0))
2165    *           .build();
2166    *   ApiFuture<Operation> future =
2167    *       notebookServiceClient.upgradeInstanceInternalCallable().futureCall(request);
2168    *   // Do something.
2169    *   Operation response = future.get();
2170    * }
2171    * }</pre>
2172    */
2173   public final UnaryCallable<UpgradeInstanceInternalRequest, Operation>
upgradeInstanceInternalCallable()2174       upgradeInstanceInternalCallable() {
2175     return stub.upgradeInstanceInternalCallable();
2176   }
2177 
2178   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2179   /**
2180    * Lists environments in a project.
2181    *
2182    * <p>Sample code:
2183    *
2184    * <pre>{@code
2185    * // This snippet has been automatically generated and should be regarded as a code template only.
2186    * // It will require modifications to work:
2187    * // - It may require correct/in-range values for request initialization.
2188    * // - It may require specifying regional endpoints when creating the service client as shown in
2189    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2190    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2191    *   String parent = "parent-995424086";
2192    *   for (Environment element : notebookServiceClient.listEnvironments(parent).iterateAll()) {
2193    *     // doThingsWith(element);
2194    *   }
2195    * }
2196    * }</pre>
2197    *
2198    * @param parent Required. Format: `projects/{project_id}/locations/{location}`
2199    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2200    */
listEnvironments(String parent)2201   public final ListEnvironmentsPagedResponse listEnvironments(String parent) {
2202     ListEnvironmentsRequest request =
2203         ListEnvironmentsRequest.newBuilder().setParent(parent).build();
2204     return listEnvironments(request);
2205   }
2206 
2207   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2208   /**
2209    * Lists environments in a project.
2210    *
2211    * <p>Sample code:
2212    *
2213    * <pre>{@code
2214    * // This snippet has been automatically generated and should be regarded as a code template only.
2215    * // It will require modifications to work:
2216    * // - It may require correct/in-range values for request initialization.
2217    * // - It may require specifying regional endpoints when creating the service client as shown in
2218    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2219    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2220    *   ListEnvironmentsRequest request =
2221    *       ListEnvironmentsRequest.newBuilder()
2222    *           .setParent("parent-995424086")
2223    *           .setPageSize(883849137)
2224    *           .setPageToken("pageToken873572522")
2225    *           .build();
2226    *   for (Environment element : notebookServiceClient.listEnvironments(request).iterateAll()) {
2227    *     // doThingsWith(element);
2228    *   }
2229    * }
2230    * }</pre>
2231    *
2232    * @param request The request object containing all of the parameters for the API call.
2233    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2234    */
listEnvironments(ListEnvironmentsRequest request)2235   public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequest request) {
2236     return listEnvironmentsPagedCallable().call(request);
2237   }
2238 
2239   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2240   /**
2241    * Lists environments in a project.
2242    *
2243    * <p>Sample code:
2244    *
2245    * <pre>{@code
2246    * // This snippet has been automatically generated and should be regarded as a code template only.
2247    * // It will require modifications to work:
2248    * // - It may require correct/in-range values for request initialization.
2249    * // - It may require specifying regional endpoints when creating the service client as shown in
2250    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2251    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2252    *   ListEnvironmentsRequest request =
2253    *       ListEnvironmentsRequest.newBuilder()
2254    *           .setParent("parent-995424086")
2255    *           .setPageSize(883849137)
2256    *           .setPageToken("pageToken873572522")
2257    *           .build();
2258    *   ApiFuture<Environment> future =
2259    *       notebookServiceClient.listEnvironmentsPagedCallable().futureCall(request);
2260    *   // Do something.
2261    *   for (Environment element : future.get().iterateAll()) {
2262    *     // doThingsWith(element);
2263    *   }
2264    * }
2265    * }</pre>
2266    */
2267   public final UnaryCallable<ListEnvironmentsRequest, ListEnvironmentsPagedResponse>
listEnvironmentsPagedCallable()2268       listEnvironmentsPagedCallable() {
2269     return stub.listEnvironmentsPagedCallable();
2270   }
2271 
2272   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2273   /**
2274    * Lists environments in a project.
2275    *
2276    * <p>Sample code:
2277    *
2278    * <pre>{@code
2279    * // This snippet has been automatically generated and should be regarded as a code template only.
2280    * // It will require modifications to work:
2281    * // - It may require correct/in-range values for request initialization.
2282    * // - It may require specifying regional endpoints when creating the service client as shown in
2283    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2284    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2285    *   ListEnvironmentsRequest request =
2286    *       ListEnvironmentsRequest.newBuilder()
2287    *           .setParent("parent-995424086")
2288    *           .setPageSize(883849137)
2289    *           .setPageToken("pageToken873572522")
2290    *           .build();
2291    *   while (true) {
2292    *     ListEnvironmentsResponse response =
2293    *         notebookServiceClient.listEnvironmentsCallable().call(request);
2294    *     for (Environment element : response.getEnvironmentsList()) {
2295    *       // doThingsWith(element);
2296    *     }
2297    *     String nextPageToken = response.getNextPageToken();
2298    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
2299    *       request = request.toBuilder().setPageToken(nextPageToken).build();
2300    *     } else {
2301    *       break;
2302    *     }
2303    *   }
2304    * }
2305    * }</pre>
2306    */
2307   public final UnaryCallable<ListEnvironmentsRequest, ListEnvironmentsResponse>
listEnvironmentsCallable()2308       listEnvironmentsCallable() {
2309     return stub.listEnvironmentsCallable();
2310   }
2311 
2312   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2313   /**
2314    * Gets details of a single Environment.
2315    *
2316    * <p>Sample code:
2317    *
2318    * <pre>{@code
2319    * // This snippet has been automatically generated and should be regarded as a code template only.
2320    * // It will require modifications to work:
2321    * // - It may require correct/in-range values for request initialization.
2322    * // - It may require specifying regional endpoints when creating the service client as shown in
2323    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2324    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2325    *   String name = "name3373707";
2326    *   Environment response = notebookServiceClient.getEnvironment(name);
2327    * }
2328    * }</pre>
2329    *
2330    * @param name Required. Format:
2331    *     `projects/{project_id}/locations/{location}/environments/{environment_id}`
2332    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2333    */
getEnvironment(String name)2334   public final Environment getEnvironment(String name) {
2335     GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder().setName(name).build();
2336     return getEnvironment(request);
2337   }
2338 
2339   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2340   /**
2341    * Gets details of a single Environment.
2342    *
2343    * <p>Sample code:
2344    *
2345    * <pre>{@code
2346    * // This snippet has been automatically generated and should be regarded as a code template only.
2347    * // It will require modifications to work:
2348    * // - It may require correct/in-range values for request initialization.
2349    * // - It may require specifying regional endpoints when creating the service client as shown in
2350    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2351    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2352    *   GetEnvironmentRequest request =
2353    *       GetEnvironmentRequest.newBuilder().setName("name3373707").build();
2354    *   Environment response = notebookServiceClient.getEnvironment(request);
2355    * }
2356    * }</pre>
2357    *
2358    * @param request The request object containing all of the parameters for the API call.
2359    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2360    */
getEnvironment(GetEnvironmentRequest request)2361   public final Environment getEnvironment(GetEnvironmentRequest request) {
2362     return getEnvironmentCallable().call(request);
2363   }
2364 
2365   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2366   /**
2367    * Gets details of a single Environment.
2368    *
2369    * <p>Sample code:
2370    *
2371    * <pre>{@code
2372    * // This snippet has been automatically generated and should be regarded as a code template only.
2373    * // It will require modifications to work:
2374    * // - It may require correct/in-range values for request initialization.
2375    * // - It may require specifying regional endpoints when creating the service client as shown in
2376    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2377    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2378    *   GetEnvironmentRequest request =
2379    *       GetEnvironmentRequest.newBuilder().setName("name3373707").build();
2380    *   ApiFuture<Environment> future =
2381    *       notebookServiceClient.getEnvironmentCallable().futureCall(request);
2382    *   // Do something.
2383    *   Environment response = future.get();
2384    * }
2385    * }</pre>
2386    */
getEnvironmentCallable()2387   public final UnaryCallable<GetEnvironmentRequest, Environment> getEnvironmentCallable() {
2388     return stub.getEnvironmentCallable();
2389   }
2390 
2391   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2392   /**
2393    * Creates a new Environment.
2394    *
2395    * <p>Sample code:
2396    *
2397    * <pre>{@code
2398    * // This snippet has been automatically generated and should be regarded as a code template only.
2399    * // It will require modifications to work:
2400    * // - It may require correct/in-range values for request initialization.
2401    * // - It may require specifying regional endpoints when creating the service client as shown in
2402    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2403    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2404    *   String parent = "parent-995424086";
2405    *   Environment environment = Environment.newBuilder().build();
2406    *   String environmentId = "environmentId-950205810";
2407    *   Environment response =
2408    *       notebookServiceClient.createEnvironmentAsync(parent, environment, environmentId).get();
2409    * }
2410    * }</pre>
2411    *
2412    * @param parent Required. Format: `projects/{project_id}/locations/{location}`
2413    * @param environment Required. The environment to be created.
2414    * @param environmentId Required. User-defined unique ID of this environment. The `environment_id`
2415    *     must be 1 to 63 characters long and contain only lowercase letters, numeric characters, and
2416    *     dashes. The first character must be a lowercase letter and the last character cannot be a
2417    *     dash.
2418    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2419    */
createEnvironmentAsync( String parent, Environment environment, String environmentId)2420   public final OperationFuture<Environment, OperationMetadata> createEnvironmentAsync(
2421       String parent, Environment environment, String environmentId) {
2422     CreateEnvironmentRequest request =
2423         CreateEnvironmentRequest.newBuilder()
2424             .setParent(parent)
2425             .setEnvironment(environment)
2426             .setEnvironmentId(environmentId)
2427             .build();
2428     return createEnvironmentAsync(request);
2429   }
2430 
2431   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2432   /**
2433    * Creates a new Environment.
2434    *
2435    * <p>Sample code:
2436    *
2437    * <pre>{@code
2438    * // This snippet has been automatically generated and should be regarded as a code template only.
2439    * // It will require modifications to work:
2440    * // - It may require correct/in-range values for request initialization.
2441    * // - It may require specifying regional endpoints when creating the service client as shown in
2442    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2443    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2444    *   CreateEnvironmentRequest request =
2445    *       CreateEnvironmentRequest.newBuilder()
2446    *           .setParent("parent-995424086")
2447    *           .setEnvironmentId("environmentId-950205810")
2448    *           .setEnvironment(Environment.newBuilder().build())
2449    *           .build();
2450    *   Environment response = notebookServiceClient.createEnvironmentAsync(request).get();
2451    * }
2452    * }</pre>
2453    *
2454    * @param request The request object containing all of the parameters for the API call.
2455    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2456    */
createEnvironmentAsync( CreateEnvironmentRequest request)2457   public final OperationFuture<Environment, OperationMetadata> createEnvironmentAsync(
2458       CreateEnvironmentRequest request) {
2459     return createEnvironmentOperationCallable().futureCall(request);
2460   }
2461 
2462   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2463   /**
2464    * Creates a new Environment.
2465    *
2466    * <p>Sample code:
2467    *
2468    * <pre>{@code
2469    * // This snippet has been automatically generated and should be regarded as a code template only.
2470    * // It will require modifications to work:
2471    * // - It may require correct/in-range values for request initialization.
2472    * // - It may require specifying regional endpoints when creating the service client as shown in
2473    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2474    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2475    *   CreateEnvironmentRequest request =
2476    *       CreateEnvironmentRequest.newBuilder()
2477    *           .setParent("parent-995424086")
2478    *           .setEnvironmentId("environmentId-950205810")
2479    *           .setEnvironment(Environment.newBuilder().build())
2480    *           .build();
2481    *   OperationFuture<Environment, OperationMetadata> future =
2482    *       notebookServiceClient.createEnvironmentOperationCallable().futureCall(request);
2483    *   // Do something.
2484    *   Environment response = future.get();
2485    * }
2486    * }</pre>
2487    */
2488   public final OperationCallable<CreateEnvironmentRequest, Environment, OperationMetadata>
createEnvironmentOperationCallable()2489       createEnvironmentOperationCallable() {
2490     return stub.createEnvironmentOperationCallable();
2491   }
2492 
2493   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2494   /**
2495    * Creates a new Environment.
2496    *
2497    * <p>Sample code:
2498    *
2499    * <pre>{@code
2500    * // This snippet has been automatically generated and should be regarded as a code template only.
2501    * // It will require modifications to work:
2502    * // - It may require correct/in-range values for request initialization.
2503    * // - It may require specifying regional endpoints when creating the service client as shown in
2504    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2505    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2506    *   CreateEnvironmentRequest request =
2507    *       CreateEnvironmentRequest.newBuilder()
2508    *           .setParent("parent-995424086")
2509    *           .setEnvironmentId("environmentId-950205810")
2510    *           .setEnvironment(Environment.newBuilder().build())
2511    *           .build();
2512    *   ApiFuture<Operation> future =
2513    *       notebookServiceClient.createEnvironmentCallable().futureCall(request);
2514    *   // Do something.
2515    *   Operation response = future.get();
2516    * }
2517    * }</pre>
2518    */
createEnvironmentCallable()2519   public final UnaryCallable<CreateEnvironmentRequest, Operation> createEnvironmentCallable() {
2520     return stub.createEnvironmentCallable();
2521   }
2522 
2523   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2524   /**
2525    * Deletes a single Environment.
2526    *
2527    * <p>Sample code:
2528    *
2529    * <pre>{@code
2530    * // This snippet has been automatically generated and should be regarded as a code template only.
2531    * // It will require modifications to work:
2532    * // - It may require correct/in-range values for request initialization.
2533    * // - It may require specifying regional endpoints when creating the service client as shown in
2534    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2535    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2536    *   String name = "name3373707";
2537    *   notebookServiceClient.deleteEnvironmentAsync(name).get();
2538    * }
2539    * }</pre>
2540    *
2541    * @param name Required. Format:
2542    *     `projects/{project_id}/locations/{location}/environments/{environment_id}`
2543    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2544    */
deleteEnvironmentAsync(String name)2545   public final OperationFuture<Empty, OperationMetadata> deleteEnvironmentAsync(String name) {
2546     DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder().setName(name).build();
2547     return deleteEnvironmentAsync(request);
2548   }
2549 
2550   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2551   /**
2552    * Deletes a single Environment.
2553    *
2554    * <p>Sample code:
2555    *
2556    * <pre>{@code
2557    * // This snippet has been automatically generated and should be regarded as a code template only.
2558    * // It will require modifications to work:
2559    * // - It may require correct/in-range values for request initialization.
2560    * // - It may require specifying regional endpoints when creating the service client as shown in
2561    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2562    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2563    *   DeleteEnvironmentRequest request =
2564    *       DeleteEnvironmentRequest.newBuilder().setName("name3373707").build();
2565    *   notebookServiceClient.deleteEnvironmentAsync(request).get();
2566    * }
2567    * }</pre>
2568    *
2569    * @param request The request object containing all of the parameters for the API call.
2570    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2571    */
deleteEnvironmentAsync( DeleteEnvironmentRequest request)2572   public final OperationFuture<Empty, OperationMetadata> deleteEnvironmentAsync(
2573       DeleteEnvironmentRequest request) {
2574     return deleteEnvironmentOperationCallable().futureCall(request);
2575   }
2576 
2577   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2578   /**
2579    * Deletes a single Environment.
2580    *
2581    * <p>Sample code:
2582    *
2583    * <pre>{@code
2584    * // This snippet has been automatically generated and should be regarded as a code template only.
2585    * // It will require modifications to work:
2586    * // - It may require correct/in-range values for request initialization.
2587    * // - It may require specifying regional endpoints when creating the service client as shown in
2588    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2589    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2590    *   DeleteEnvironmentRequest request =
2591    *       DeleteEnvironmentRequest.newBuilder().setName("name3373707").build();
2592    *   OperationFuture<Empty, OperationMetadata> future =
2593    *       notebookServiceClient.deleteEnvironmentOperationCallable().futureCall(request);
2594    *   // Do something.
2595    *   future.get();
2596    * }
2597    * }</pre>
2598    */
2599   public final OperationCallable<DeleteEnvironmentRequest, Empty, OperationMetadata>
deleteEnvironmentOperationCallable()2600       deleteEnvironmentOperationCallable() {
2601     return stub.deleteEnvironmentOperationCallable();
2602   }
2603 
2604   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2605   /**
2606    * Deletes a single Environment.
2607    *
2608    * <p>Sample code:
2609    *
2610    * <pre>{@code
2611    * // This snippet has been automatically generated and should be regarded as a code template only.
2612    * // It will require modifications to work:
2613    * // - It may require correct/in-range values for request initialization.
2614    * // - It may require specifying regional endpoints when creating the service client as shown in
2615    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2616    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2617    *   DeleteEnvironmentRequest request =
2618    *       DeleteEnvironmentRequest.newBuilder().setName("name3373707").build();
2619    *   ApiFuture<Operation> future =
2620    *       notebookServiceClient.deleteEnvironmentCallable().futureCall(request);
2621    *   // Do something.
2622    *   future.get();
2623    * }
2624    * }</pre>
2625    */
deleteEnvironmentCallable()2626   public final UnaryCallable<DeleteEnvironmentRequest, Operation> deleteEnvironmentCallable() {
2627     return stub.deleteEnvironmentCallable();
2628   }
2629 
2630   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2631   /**
2632    * Lists schedules in a given project and location.
2633    *
2634    * <p>Sample code:
2635    *
2636    * <pre>{@code
2637    * // This snippet has been automatically generated and should be regarded as a code template only.
2638    * // It will require modifications to work:
2639    * // - It may require correct/in-range values for request initialization.
2640    * // - It may require specifying regional endpoints when creating the service client as shown in
2641    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2642    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2643    *   ScheduleName parent = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]");
2644    *   for (Schedule element : notebookServiceClient.listSchedules(parent).iterateAll()) {
2645    *     // doThingsWith(element);
2646    *   }
2647    * }
2648    * }</pre>
2649    *
2650    * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}`
2651    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2652    */
listSchedules(ScheduleName parent)2653   public final ListSchedulesPagedResponse listSchedules(ScheduleName parent) {
2654     ListSchedulesRequest request =
2655         ListSchedulesRequest.newBuilder()
2656             .setParent(parent == null ? null : parent.toString())
2657             .build();
2658     return listSchedules(request);
2659   }
2660 
2661   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2662   /**
2663    * Lists schedules in a given project and location.
2664    *
2665    * <p>Sample code:
2666    *
2667    * <pre>{@code
2668    * // This snippet has been automatically generated and should be regarded as a code template only.
2669    * // It will require modifications to work:
2670    * // - It may require correct/in-range values for request initialization.
2671    * // - It may require specifying regional endpoints when creating the service client as shown in
2672    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2673    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2674    *   String parent = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString();
2675    *   for (Schedule element : notebookServiceClient.listSchedules(parent).iterateAll()) {
2676    *     // doThingsWith(element);
2677    *   }
2678    * }
2679    * }</pre>
2680    *
2681    * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}`
2682    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2683    */
listSchedules(String parent)2684   public final ListSchedulesPagedResponse listSchedules(String parent) {
2685     ListSchedulesRequest request = ListSchedulesRequest.newBuilder().setParent(parent).build();
2686     return listSchedules(request);
2687   }
2688 
2689   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2690   /**
2691    * Lists schedules in a given project and location.
2692    *
2693    * <p>Sample code:
2694    *
2695    * <pre>{@code
2696    * // This snippet has been automatically generated and should be regarded as a code template only.
2697    * // It will require modifications to work:
2698    * // - It may require correct/in-range values for request initialization.
2699    * // - It may require specifying regional endpoints when creating the service client as shown in
2700    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2701    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2702    *   ListSchedulesRequest request =
2703    *       ListSchedulesRequest.newBuilder()
2704    *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
2705    *           .setPageSize(883849137)
2706    *           .setPageToken("pageToken873572522")
2707    *           .setFilter("filter-1274492040")
2708    *           .setOrderBy("orderBy-1207110587")
2709    *           .build();
2710    *   for (Schedule element : notebookServiceClient.listSchedules(request).iterateAll()) {
2711    *     // doThingsWith(element);
2712    *   }
2713    * }
2714    * }</pre>
2715    *
2716    * @param request The request object containing all of the parameters for the API call.
2717    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2718    */
listSchedules(ListSchedulesRequest request)2719   public final ListSchedulesPagedResponse listSchedules(ListSchedulesRequest request) {
2720     return listSchedulesPagedCallable().call(request);
2721   }
2722 
2723   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2724   /**
2725    * Lists schedules in a given project and location.
2726    *
2727    * <p>Sample code:
2728    *
2729    * <pre>{@code
2730    * // This snippet has been automatically generated and should be regarded as a code template only.
2731    * // It will require modifications to work:
2732    * // - It may require correct/in-range values for request initialization.
2733    * // - It may require specifying regional endpoints when creating the service client as shown in
2734    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2735    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2736    *   ListSchedulesRequest request =
2737    *       ListSchedulesRequest.newBuilder()
2738    *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
2739    *           .setPageSize(883849137)
2740    *           .setPageToken("pageToken873572522")
2741    *           .setFilter("filter-1274492040")
2742    *           .setOrderBy("orderBy-1207110587")
2743    *           .build();
2744    *   ApiFuture<Schedule> future =
2745    *       notebookServiceClient.listSchedulesPagedCallable().futureCall(request);
2746    *   // Do something.
2747    *   for (Schedule element : future.get().iterateAll()) {
2748    *     // doThingsWith(element);
2749    *   }
2750    * }
2751    * }</pre>
2752    */
2753   public final UnaryCallable<ListSchedulesRequest, ListSchedulesPagedResponse>
listSchedulesPagedCallable()2754       listSchedulesPagedCallable() {
2755     return stub.listSchedulesPagedCallable();
2756   }
2757 
2758   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2759   /**
2760    * Lists schedules in a given project and location.
2761    *
2762    * <p>Sample code:
2763    *
2764    * <pre>{@code
2765    * // This snippet has been automatically generated and should be regarded as a code template only.
2766    * // It will require modifications to work:
2767    * // - It may require correct/in-range values for request initialization.
2768    * // - It may require specifying regional endpoints when creating the service client as shown in
2769    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2770    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2771    *   ListSchedulesRequest request =
2772    *       ListSchedulesRequest.newBuilder()
2773    *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
2774    *           .setPageSize(883849137)
2775    *           .setPageToken("pageToken873572522")
2776    *           .setFilter("filter-1274492040")
2777    *           .setOrderBy("orderBy-1207110587")
2778    *           .build();
2779    *   while (true) {
2780    *     ListSchedulesResponse response =
2781    *         notebookServiceClient.listSchedulesCallable().call(request);
2782    *     for (Schedule element : response.getSchedulesList()) {
2783    *       // doThingsWith(element);
2784    *     }
2785    *     String nextPageToken = response.getNextPageToken();
2786    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
2787    *       request = request.toBuilder().setPageToken(nextPageToken).build();
2788    *     } else {
2789    *       break;
2790    *     }
2791    *   }
2792    * }
2793    * }</pre>
2794    */
listSchedulesCallable()2795   public final UnaryCallable<ListSchedulesRequest, ListSchedulesResponse> listSchedulesCallable() {
2796     return stub.listSchedulesCallable();
2797   }
2798 
2799   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2800   /**
2801    * Gets details of schedule
2802    *
2803    * <p>Sample code:
2804    *
2805    * <pre>{@code
2806    * // This snippet has been automatically generated and should be regarded as a code template only.
2807    * // It will require modifications to work:
2808    * // - It may require correct/in-range values for request initialization.
2809    * // - It may require specifying regional endpoints when creating the service client as shown in
2810    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2811    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2812    *   ScheduleName name = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]");
2813    *   Schedule response = notebookServiceClient.getSchedule(name);
2814    * }
2815    * }</pre>
2816    *
2817    * @param name Required. Format:
2818    *     `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
2819    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2820    */
getSchedule(ScheduleName name)2821   public final Schedule getSchedule(ScheduleName name) {
2822     GetScheduleRequest request =
2823         GetScheduleRequest.newBuilder().setName(name == null ? null : name.toString()).build();
2824     return getSchedule(request);
2825   }
2826 
2827   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2828   /**
2829    * Gets details of schedule
2830    *
2831    * <p>Sample code:
2832    *
2833    * <pre>{@code
2834    * // This snippet has been automatically generated and should be regarded as a code template only.
2835    * // It will require modifications to work:
2836    * // - It may require correct/in-range values for request initialization.
2837    * // - It may require specifying regional endpoints when creating the service client as shown in
2838    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2839    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2840    *   String name = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString();
2841    *   Schedule response = notebookServiceClient.getSchedule(name);
2842    * }
2843    * }</pre>
2844    *
2845    * @param name Required. Format:
2846    *     `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
2847    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2848    */
getSchedule(String name)2849   public final Schedule getSchedule(String name) {
2850     GetScheduleRequest request = GetScheduleRequest.newBuilder().setName(name).build();
2851     return getSchedule(request);
2852   }
2853 
2854   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2855   /**
2856    * Gets details of schedule
2857    *
2858    * <p>Sample code:
2859    *
2860    * <pre>{@code
2861    * // This snippet has been automatically generated and should be regarded as a code template only.
2862    * // It will require modifications to work:
2863    * // - It may require correct/in-range values for request initialization.
2864    * // - It may require specifying regional endpoints when creating the service client as shown in
2865    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2866    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2867    *   GetScheduleRequest request =
2868    *       GetScheduleRequest.newBuilder()
2869    *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
2870    *           .build();
2871    *   Schedule response = notebookServiceClient.getSchedule(request);
2872    * }
2873    * }</pre>
2874    *
2875    * @param request The request object containing all of the parameters for the API call.
2876    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2877    */
getSchedule(GetScheduleRequest request)2878   public final Schedule getSchedule(GetScheduleRequest request) {
2879     return getScheduleCallable().call(request);
2880   }
2881 
2882   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2883   /**
2884    * Gets details of schedule
2885    *
2886    * <p>Sample code:
2887    *
2888    * <pre>{@code
2889    * // This snippet has been automatically generated and should be regarded as a code template only.
2890    * // It will require modifications to work:
2891    * // - It may require correct/in-range values for request initialization.
2892    * // - It may require specifying regional endpoints when creating the service client as shown in
2893    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2894    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2895    *   GetScheduleRequest request =
2896    *       GetScheduleRequest.newBuilder()
2897    *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
2898    *           .build();
2899    *   ApiFuture<Schedule> future = notebookServiceClient.getScheduleCallable().futureCall(request);
2900    *   // Do something.
2901    *   Schedule response = future.get();
2902    * }
2903    * }</pre>
2904    */
getScheduleCallable()2905   public final UnaryCallable<GetScheduleRequest, Schedule> getScheduleCallable() {
2906     return stub.getScheduleCallable();
2907   }
2908 
2909   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2910   /**
2911    * Deletes schedule and all underlying jobs
2912    *
2913    * <p>Sample code:
2914    *
2915    * <pre>{@code
2916    * // This snippet has been automatically generated and should be regarded as a code template only.
2917    * // It will require modifications to work:
2918    * // - It may require correct/in-range values for request initialization.
2919    * // - It may require specifying regional endpoints when creating the service client as shown in
2920    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2921    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2922    *   ScheduleName name = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]");
2923    *   notebookServiceClient.deleteScheduleAsync(name).get();
2924    * }
2925    * }</pre>
2926    *
2927    * @param name Required. Format:
2928    *     `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
2929    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2930    */
deleteScheduleAsync(ScheduleName name)2931   public final OperationFuture<Empty, OperationMetadata> deleteScheduleAsync(ScheduleName name) {
2932     DeleteScheduleRequest request =
2933         DeleteScheduleRequest.newBuilder().setName(name == null ? null : name.toString()).build();
2934     return deleteScheduleAsync(request);
2935   }
2936 
2937   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2938   /**
2939    * Deletes schedule and all underlying jobs
2940    *
2941    * <p>Sample code:
2942    *
2943    * <pre>{@code
2944    * // This snippet has been automatically generated and should be regarded as a code template only.
2945    * // It will require modifications to work:
2946    * // - It may require correct/in-range values for request initialization.
2947    * // - It may require specifying regional endpoints when creating the service client as shown in
2948    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2949    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2950    *   String name = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString();
2951    *   notebookServiceClient.deleteScheduleAsync(name).get();
2952    * }
2953    * }</pre>
2954    *
2955    * @param name Required. Format:
2956    *     `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
2957    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2958    */
deleteScheduleAsync(String name)2959   public final OperationFuture<Empty, OperationMetadata> deleteScheduleAsync(String name) {
2960     DeleteScheduleRequest request = DeleteScheduleRequest.newBuilder().setName(name).build();
2961     return deleteScheduleAsync(request);
2962   }
2963 
2964   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2965   /**
2966    * Deletes schedule and all underlying jobs
2967    *
2968    * <p>Sample code:
2969    *
2970    * <pre>{@code
2971    * // This snippet has been automatically generated and should be regarded as a code template only.
2972    * // It will require modifications to work:
2973    * // - It may require correct/in-range values for request initialization.
2974    * // - It may require specifying regional endpoints when creating the service client as shown in
2975    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2976    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
2977    *   DeleteScheduleRequest request =
2978    *       DeleteScheduleRequest.newBuilder()
2979    *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
2980    *           .build();
2981    *   notebookServiceClient.deleteScheduleAsync(request).get();
2982    * }
2983    * }</pre>
2984    *
2985    * @param request The request object containing all of the parameters for the API call.
2986    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2987    */
deleteScheduleAsync( DeleteScheduleRequest request)2988   public final OperationFuture<Empty, OperationMetadata> deleteScheduleAsync(
2989       DeleteScheduleRequest request) {
2990     return deleteScheduleOperationCallable().futureCall(request);
2991   }
2992 
2993   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2994   /**
2995    * Deletes schedule and all underlying jobs
2996    *
2997    * <p>Sample code:
2998    *
2999    * <pre>{@code
3000    * // This snippet has been automatically generated and should be regarded as a code template only.
3001    * // It will require modifications to work:
3002    * // - It may require correct/in-range values for request initialization.
3003    * // - It may require specifying regional endpoints when creating the service client as shown in
3004    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3005    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3006    *   DeleteScheduleRequest request =
3007    *       DeleteScheduleRequest.newBuilder()
3008    *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
3009    *           .build();
3010    *   OperationFuture<Empty, OperationMetadata> future =
3011    *       notebookServiceClient.deleteScheduleOperationCallable().futureCall(request);
3012    *   // Do something.
3013    *   future.get();
3014    * }
3015    * }</pre>
3016    */
3017   public final OperationCallable<DeleteScheduleRequest, Empty, OperationMetadata>
deleteScheduleOperationCallable()3018       deleteScheduleOperationCallable() {
3019     return stub.deleteScheduleOperationCallable();
3020   }
3021 
3022   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3023   /**
3024    * Deletes schedule and all underlying jobs
3025    *
3026    * <p>Sample code:
3027    *
3028    * <pre>{@code
3029    * // This snippet has been automatically generated and should be regarded as a code template only.
3030    * // It will require modifications to work:
3031    * // - It may require correct/in-range values for request initialization.
3032    * // - It may require specifying regional endpoints when creating the service client as shown in
3033    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3034    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3035    *   DeleteScheduleRequest request =
3036    *       DeleteScheduleRequest.newBuilder()
3037    *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
3038    *           .build();
3039    *   ApiFuture<Operation> future =
3040    *       notebookServiceClient.deleteScheduleCallable().futureCall(request);
3041    *   // Do something.
3042    *   future.get();
3043    * }
3044    * }</pre>
3045    */
deleteScheduleCallable()3046   public final UnaryCallable<DeleteScheduleRequest, Operation> deleteScheduleCallable() {
3047     return stub.deleteScheduleCallable();
3048   }
3049 
3050   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3051   /**
3052    * Creates a new Scheduled Notebook in a given project and location.
3053    *
3054    * <p>Sample code:
3055    *
3056    * <pre>{@code
3057    * // This snippet has been automatically generated and should be regarded as a code template only.
3058    * // It will require modifications to work:
3059    * // - It may require correct/in-range values for request initialization.
3060    * // - It may require specifying regional endpoints when creating the service client as shown in
3061    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3062    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3063    *   ScheduleName parent = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]");
3064    *   Schedule schedule = Schedule.newBuilder().build();
3065    *   String scheduleId = "scheduleId-687058414";
3066    *   Schedule response =
3067    *       notebookServiceClient.createScheduleAsync(parent, schedule, scheduleId).get();
3068    * }
3069    * }</pre>
3070    *
3071    * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}`
3072    * @param schedule Required. The schedule to be created.
3073    * @param scheduleId Required. User-defined unique ID of this schedule.
3074    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3075    */
createScheduleAsync( ScheduleName parent, Schedule schedule, String scheduleId)3076   public final OperationFuture<Schedule, OperationMetadata> createScheduleAsync(
3077       ScheduleName parent, Schedule schedule, String scheduleId) {
3078     CreateScheduleRequest request =
3079         CreateScheduleRequest.newBuilder()
3080             .setParent(parent == null ? null : parent.toString())
3081             .setSchedule(schedule)
3082             .setScheduleId(scheduleId)
3083             .build();
3084     return createScheduleAsync(request);
3085   }
3086 
3087   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3088   /**
3089    * Creates a new Scheduled Notebook in a given project and location.
3090    *
3091    * <p>Sample code:
3092    *
3093    * <pre>{@code
3094    * // This snippet has been automatically generated and should be regarded as a code template only.
3095    * // It will require modifications to work:
3096    * // - It may require correct/in-range values for request initialization.
3097    * // - It may require specifying regional endpoints when creating the service client as shown in
3098    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3099    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3100    *   String parent = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString();
3101    *   Schedule schedule = Schedule.newBuilder().build();
3102    *   String scheduleId = "scheduleId-687058414";
3103    *   Schedule response =
3104    *       notebookServiceClient.createScheduleAsync(parent, schedule, scheduleId).get();
3105    * }
3106    * }</pre>
3107    *
3108    * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}`
3109    * @param schedule Required. The schedule to be created.
3110    * @param scheduleId Required. User-defined unique ID of this schedule.
3111    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3112    */
createScheduleAsync( String parent, Schedule schedule, String scheduleId)3113   public final OperationFuture<Schedule, OperationMetadata> createScheduleAsync(
3114       String parent, Schedule schedule, String scheduleId) {
3115     CreateScheduleRequest request =
3116         CreateScheduleRequest.newBuilder()
3117             .setParent(parent)
3118             .setSchedule(schedule)
3119             .setScheduleId(scheduleId)
3120             .build();
3121     return createScheduleAsync(request);
3122   }
3123 
3124   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3125   /**
3126    * Creates a new Scheduled Notebook in a given project and location.
3127    *
3128    * <p>Sample code:
3129    *
3130    * <pre>{@code
3131    * // This snippet has been automatically generated and should be regarded as a code template only.
3132    * // It will require modifications to work:
3133    * // - It may require correct/in-range values for request initialization.
3134    * // - It may require specifying regional endpoints when creating the service client as shown in
3135    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3136    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3137    *   CreateScheduleRequest request =
3138    *       CreateScheduleRequest.newBuilder()
3139    *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
3140    *           .setScheduleId("scheduleId-687058414")
3141    *           .setSchedule(Schedule.newBuilder().build())
3142    *           .build();
3143    *   Schedule response = notebookServiceClient.createScheduleAsync(request).get();
3144    * }
3145    * }</pre>
3146    *
3147    * @param request The request object containing all of the parameters for the API call.
3148    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3149    */
createScheduleAsync( CreateScheduleRequest request)3150   public final OperationFuture<Schedule, OperationMetadata> createScheduleAsync(
3151       CreateScheduleRequest request) {
3152     return createScheduleOperationCallable().futureCall(request);
3153   }
3154 
3155   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3156   /**
3157    * Creates a new Scheduled Notebook in a given project and location.
3158    *
3159    * <p>Sample code:
3160    *
3161    * <pre>{@code
3162    * // This snippet has been automatically generated and should be regarded as a code template only.
3163    * // It will require modifications to work:
3164    * // - It may require correct/in-range values for request initialization.
3165    * // - It may require specifying regional endpoints when creating the service client as shown in
3166    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3167    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3168    *   CreateScheduleRequest request =
3169    *       CreateScheduleRequest.newBuilder()
3170    *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
3171    *           .setScheduleId("scheduleId-687058414")
3172    *           .setSchedule(Schedule.newBuilder().build())
3173    *           .build();
3174    *   OperationFuture<Schedule, OperationMetadata> future =
3175    *       notebookServiceClient.createScheduleOperationCallable().futureCall(request);
3176    *   // Do something.
3177    *   Schedule response = future.get();
3178    * }
3179    * }</pre>
3180    */
3181   public final OperationCallable<CreateScheduleRequest, Schedule, OperationMetadata>
createScheduleOperationCallable()3182       createScheduleOperationCallable() {
3183     return stub.createScheduleOperationCallable();
3184   }
3185 
3186   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3187   /**
3188    * Creates a new Scheduled Notebook in a given project and location.
3189    *
3190    * <p>Sample code:
3191    *
3192    * <pre>{@code
3193    * // This snippet has been automatically generated and should be regarded as a code template only.
3194    * // It will require modifications to work:
3195    * // - It may require correct/in-range values for request initialization.
3196    * // - It may require specifying regional endpoints when creating the service client as shown in
3197    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3198    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3199    *   CreateScheduleRequest request =
3200    *       CreateScheduleRequest.newBuilder()
3201    *           .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
3202    *           .setScheduleId("scheduleId-687058414")
3203    *           .setSchedule(Schedule.newBuilder().build())
3204    *           .build();
3205    *   ApiFuture<Operation> future =
3206    *       notebookServiceClient.createScheduleCallable().futureCall(request);
3207    *   // Do something.
3208    *   Operation response = future.get();
3209    * }
3210    * }</pre>
3211    */
createScheduleCallable()3212   public final UnaryCallable<CreateScheduleRequest, Operation> createScheduleCallable() {
3213     return stub.createScheduleCallable();
3214   }
3215 
3216   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3217   /**
3218    * Triggers execution of an existing schedule.
3219    *
3220    * <p>Sample code:
3221    *
3222    * <pre>{@code
3223    * // This snippet has been automatically generated and should be regarded as a code template only.
3224    * // It will require modifications to work:
3225    * // - It may require correct/in-range values for request initialization.
3226    * // - It may require specifying regional endpoints when creating the service client as shown in
3227    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3228    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3229    *   TriggerScheduleRequest request =
3230    *       TriggerScheduleRequest.newBuilder()
3231    *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
3232    *           .build();
3233    *   Schedule response = notebookServiceClient.triggerScheduleAsync(request).get();
3234    * }
3235    * }</pre>
3236    *
3237    * @param request The request object containing all of the parameters for the API call.
3238    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3239    */
triggerScheduleAsync( TriggerScheduleRequest request)3240   public final OperationFuture<Schedule, OperationMetadata> triggerScheduleAsync(
3241       TriggerScheduleRequest request) {
3242     return triggerScheduleOperationCallable().futureCall(request);
3243   }
3244 
3245   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3246   /**
3247    * Triggers execution of an existing schedule.
3248    *
3249    * <p>Sample code:
3250    *
3251    * <pre>{@code
3252    * // This snippet has been automatically generated and should be regarded as a code template only.
3253    * // It will require modifications to work:
3254    * // - It may require correct/in-range values for request initialization.
3255    * // - It may require specifying regional endpoints when creating the service client as shown in
3256    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3257    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3258    *   TriggerScheduleRequest request =
3259    *       TriggerScheduleRequest.newBuilder()
3260    *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
3261    *           .build();
3262    *   OperationFuture<Schedule, OperationMetadata> future =
3263    *       notebookServiceClient.triggerScheduleOperationCallable().futureCall(request);
3264    *   // Do something.
3265    *   Schedule response = future.get();
3266    * }
3267    * }</pre>
3268    */
3269   public final OperationCallable<TriggerScheduleRequest, Schedule, OperationMetadata>
triggerScheduleOperationCallable()3270       triggerScheduleOperationCallable() {
3271     return stub.triggerScheduleOperationCallable();
3272   }
3273 
3274   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3275   /**
3276    * Triggers execution of an existing schedule.
3277    *
3278    * <p>Sample code:
3279    *
3280    * <pre>{@code
3281    * // This snippet has been automatically generated and should be regarded as a code template only.
3282    * // It will require modifications to work:
3283    * // - It may require correct/in-range values for request initialization.
3284    * // - It may require specifying regional endpoints when creating the service client as shown in
3285    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3286    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3287    *   TriggerScheduleRequest request =
3288    *       TriggerScheduleRequest.newBuilder()
3289    *           .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString())
3290    *           .build();
3291    *   ApiFuture<Operation> future =
3292    *       notebookServiceClient.triggerScheduleCallable().futureCall(request);
3293    *   // Do something.
3294    *   Operation response = future.get();
3295    * }
3296    * }</pre>
3297    */
triggerScheduleCallable()3298   public final UnaryCallable<TriggerScheduleRequest, Operation> triggerScheduleCallable() {
3299     return stub.triggerScheduleCallable();
3300   }
3301 
3302   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3303   /**
3304    * Lists executions in a given project and location
3305    *
3306    * <p>Sample code:
3307    *
3308    * <pre>{@code
3309    * // This snippet has been automatically generated and should be regarded as a code template only.
3310    * // It will require modifications to work:
3311    * // - It may require correct/in-range values for request initialization.
3312    * // - It may require specifying regional endpoints when creating the service client as shown in
3313    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3314    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3315    *   ExecutionName parent = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]");
3316    *   for (Execution element : notebookServiceClient.listExecutions(parent).iterateAll()) {
3317    *     // doThingsWith(element);
3318    *   }
3319    * }
3320    * }</pre>
3321    *
3322    * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}`
3323    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3324    */
listExecutions(ExecutionName parent)3325   public final ListExecutionsPagedResponse listExecutions(ExecutionName parent) {
3326     ListExecutionsRequest request =
3327         ListExecutionsRequest.newBuilder()
3328             .setParent(parent == null ? null : parent.toString())
3329             .build();
3330     return listExecutions(request);
3331   }
3332 
3333   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3334   /**
3335    * Lists executions in a given project and location
3336    *
3337    * <p>Sample code:
3338    *
3339    * <pre>{@code
3340    * // This snippet has been automatically generated and should be regarded as a code template only.
3341    * // It will require modifications to work:
3342    * // - It may require correct/in-range values for request initialization.
3343    * // - It may require specifying regional endpoints when creating the service client as shown in
3344    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3345    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3346    *   String parent = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString();
3347    *   for (Execution element : notebookServiceClient.listExecutions(parent).iterateAll()) {
3348    *     // doThingsWith(element);
3349    *   }
3350    * }
3351    * }</pre>
3352    *
3353    * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}`
3354    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3355    */
listExecutions(String parent)3356   public final ListExecutionsPagedResponse listExecutions(String parent) {
3357     ListExecutionsRequest request = ListExecutionsRequest.newBuilder().setParent(parent).build();
3358     return listExecutions(request);
3359   }
3360 
3361   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3362   /**
3363    * Lists executions in a given project and location
3364    *
3365    * <p>Sample code:
3366    *
3367    * <pre>{@code
3368    * // This snippet has been automatically generated and should be regarded as a code template only.
3369    * // It will require modifications to work:
3370    * // - It may require correct/in-range values for request initialization.
3371    * // - It may require specifying regional endpoints when creating the service client as shown in
3372    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3373    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3374    *   ListExecutionsRequest request =
3375    *       ListExecutionsRequest.newBuilder()
3376    *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
3377    *           .setPageSize(883849137)
3378    *           .setPageToken("pageToken873572522")
3379    *           .setFilter("filter-1274492040")
3380    *           .setOrderBy("orderBy-1207110587")
3381    *           .build();
3382    *   for (Execution element : notebookServiceClient.listExecutions(request).iterateAll()) {
3383    *     // doThingsWith(element);
3384    *   }
3385    * }
3386    * }</pre>
3387    *
3388    * @param request The request object containing all of the parameters for the API call.
3389    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3390    */
listExecutions(ListExecutionsRequest request)3391   public final ListExecutionsPagedResponse listExecutions(ListExecutionsRequest request) {
3392     return listExecutionsPagedCallable().call(request);
3393   }
3394 
3395   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3396   /**
3397    * Lists executions in a given project and location
3398    *
3399    * <p>Sample code:
3400    *
3401    * <pre>{@code
3402    * // This snippet has been automatically generated and should be regarded as a code template only.
3403    * // It will require modifications to work:
3404    * // - It may require correct/in-range values for request initialization.
3405    * // - It may require specifying regional endpoints when creating the service client as shown in
3406    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3407    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3408    *   ListExecutionsRequest request =
3409    *       ListExecutionsRequest.newBuilder()
3410    *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
3411    *           .setPageSize(883849137)
3412    *           .setPageToken("pageToken873572522")
3413    *           .setFilter("filter-1274492040")
3414    *           .setOrderBy("orderBy-1207110587")
3415    *           .build();
3416    *   ApiFuture<Execution> future =
3417    *       notebookServiceClient.listExecutionsPagedCallable().futureCall(request);
3418    *   // Do something.
3419    *   for (Execution element : future.get().iterateAll()) {
3420    *     // doThingsWith(element);
3421    *   }
3422    * }
3423    * }</pre>
3424    */
3425   public final UnaryCallable<ListExecutionsRequest, ListExecutionsPagedResponse>
listExecutionsPagedCallable()3426       listExecutionsPagedCallable() {
3427     return stub.listExecutionsPagedCallable();
3428   }
3429 
3430   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3431   /**
3432    * Lists executions in a given project and location
3433    *
3434    * <p>Sample code:
3435    *
3436    * <pre>{@code
3437    * // This snippet has been automatically generated and should be regarded as a code template only.
3438    * // It will require modifications to work:
3439    * // - It may require correct/in-range values for request initialization.
3440    * // - It may require specifying regional endpoints when creating the service client as shown in
3441    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3442    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3443    *   ListExecutionsRequest request =
3444    *       ListExecutionsRequest.newBuilder()
3445    *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
3446    *           .setPageSize(883849137)
3447    *           .setPageToken("pageToken873572522")
3448    *           .setFilter("filter-1274492040")
3449    *           .setOrderBy("orderBy-1207110587")
3450    *           .build();
3451    *   while (true) {
3452    *     ListExecutionsResponse response =
3453    *         notebookServiceClient.listExecutionsCallable().call(request);
3454    *     for (Execution element : response.getExecutionsList()) {
3455    *       // doThingsWith(element);
3456    *     }
3457    *     String nextPageToken = response.getNextPageToken();
3458    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
3459    *       request = request.toBuilder().setPageToken(nextPageToken).build();
3460    *     } else {
3461    *       break;
3462    *     }
3463    *   }
3464    * }
3465    * }</pre>
3466    */
3467   public final UnaryCallable<ListExecutionsRequest, ListExecutionsResponse>
listExecutionsCallable()3468       listExecutionsCallable() {
3469     return stub.listExecutionsCallable();
3470   }
3471 
3472   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3473   /**
3474    * Gets details of executions
3475    *
3476    * <p>Sample code:
3477    *
3478    * <pre>{@code
3479    * // This snippet has been automatically generated and should be regarded as a code template only.
3480    * // It will require modifications to work:
3481    * // - It may require correct/in-range values for request initialization.
3482    * // - It may require specifying regional endpoints when creating the service client as shown in
3483    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3484    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3485    *   ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]");
3486    *   Execution response = notebookServiceClient.getExecution(name);
3487    * }
3488    * }</pre>
3489    *
3490    * @param name Required. Format:
3491    *     `projects/{project_id}/locations/{location}/executions/{execution_id}`
3492    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3493    */
getExecution(ExecutionName name)3494   public final Execution getExecution(ExecutionName name) {
3495     GetExecutionRequest request =
3496         GetExecutionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
3497     return getExecution(request);
3498   }
3499 
3500   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3501   /**
3502    * Gets details of executions
3503    *
3504    * <p>Sample code:
3505    *
3506    * <pre>{@code
3507    * // This snippet has been automatically generated and should be regarded as a code template only.
3508    * // It will require modifications to work:
3509    * // - It may require correct/in-range values for request initialization.
3510    * // - It may require specifying regional endpoints when creating the service client as shown in
3511    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3512    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3513    *   String name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString();
3514    *   Execution response = notebookServiceClient.getExecution(name);
3515    * }
3516    * }</pre>
3517    *
3518    * @param name Required. Format:
3519    *     `projects/{project_id}/locations/{location}/executions/{execution_id}`
3520    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3521    */
getExecution(String name)3522   public final Execution getExecution(String name) {
3523     GetExecutionRequest request = GetExecutionRequest.newBuilder().setName(name).build();
3524     return getExecution(request);
3525   }
3526 
3527   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3528   /**
3529    * Gets details of executions
3530    *
3531    * <p>Sample code:
3532    *
3533    * <pre>{@code
3534    * // This snippet has been automatically generated and should be regarded as a code template only.
3535    * // It will require modifications to work:
3536    * // - It may require correct/in-range values for request initialization.
3537    * // - It may require specifying regional endpoints when creating the service client as shown in
3538    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3539    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3540    *   GetExecutionRequest request =
3541    *       GetExecutionRequest.newBuilder()
3542    *           .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
3543    *           .build();
3544    *   Execution response = notebookServiceClient.getExecution(request);
3545    * }
3546    * }</pre>
3547    *
3548    * @param request The request object containing all of the parameters for the API call.
3549    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3550    */
getExecution(GetExecutionRequest request)3551   public final Execution getExecution(GetExecutionRequest request) {
3552     return getExecutionCallable().call(request);
3553   }
3554 
3555   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3556   /**
3557    * Gets details of executions
3558    *
3559    * <p>Sample code:
3560    *
3561    * <pre>{@code
3562    * // This snippet has been automatically generated and should be regarded as a code template only.
3563    * // It will require modifications to work:
3564    * // - It may require correct/in-range values for request initialization.
3565    * // - It may require specifying regional endpoints when creating the service client as shown in
3566    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3567    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3568    *   GetExecutionRequest request =
3569    *       GetExecutionRequest.newBuilder()
3570    *           .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
3571    *           .build();
3572    *   ApiFuture<Execution> future =
3573    *       notebookServiceClient.getExecutionCallable().futureCall(request);
3574    *   // Do something.
3575    *   Execution response = future.get();
3576    * }
3577    * }</pre>
3578    */
getExecutionCallable()3579   public final UnaryCallable<GetExecutionRequest, Execution> getExecutionCallable() {
3580     return stub.getExecutionCallable();
3581   }
3582 
3583   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3584   /**
3585    * Deletes execution
3586    *
3587    * <p>Sample code:
3588    *
3589    * <pre>{@code
3590    * // This snippet has been automatically generated and should be regarded as a code template only.
3591    * // It will require modifications to work:
3592    * // - It may require correct/in-range values for request initialization.
3593    * // - It may require specifying regional endpoints when creating the service client as shown in
3594    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3595    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3596    *   ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]");
3597    *   notebookServiceClient.deleteExecutionAsync(name).get();
3598    * }
3599    * }</pre>
3600    *
3601    * @param name Required. Format:
3602    *     `projects/{project_id}/locations/{location}/executions/{execution_id}`
3603    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3604    */
deleteExecutionAsync(ExecutionName name)3605   public final OperationFuture<Empty, OperationMetadata> deleteExecutionAsync(ExecutionName name) {
3606     DeleteExecutionRequest request =
3607         DeleteExecutionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
3608     return deleteExecutionAsync(request);
3609   }
3610 
3611   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3612   /**
3613    * Deletes execution
3614    *
3615    * <p>Sample code:
3616    *
3617    * <pre>{@code
3618    * // This snippet has been automatically generated and should be regarded as a code template only.
3619    * // It will require modifications to work:
3620    * // - It may require correct/in-range values for request initialization.
3621    * // - It may require specifying regional endpoints when creating the service client as shown in
3622    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3623    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3624    *   String name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString();
3625    *   notebookServiceClient.deleteExecutionAsync(name).get();
3626    * }
3627    * }</pre>
3628    *
3629    * @param name Required. Format:
3630    *     `projects/{project_id}/locations/{location}/executions/{execution_id}`
3631    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3632    */
deleteExecutionAsync(String name)3633   public final OperationFuture<Empty, OperationMetadata> deleteExecutionAsync(String name) {
3634     DeleteExecutionRequest request = DeleteExecutionRequest.newBuilder().setName(name).build();
3635     return deleteExecutionAsync(request);
3636   }
3637 
3638   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3639   /**
3640    * Deletes execution
3641    *
3642    * <p>Sample code:
3643    *
3644    * <pre>{@code
3645    * // This snippet has been automatically generated and should be regarded as a code template only.
3646    * // It will require modifications to work:
3647    * // - It may require correct/in-range values for request initialization.
3648    * // - It may require specifying regional endpoints when creating the service client as shown in
3649    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3650    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3651    *   DeleteExecutionRequest request =
3652    *       DeleteExecutionRequest.newBuilder()
3653    *           .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
3654    *           .build();
3655    *   notebookServiceClient.deleteExecutionAsync(request).get();
3656    * }
3657    * }</pre>
3658    *
3659    * @param request The request object containing all of the parameters for the API call.
3660    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3661    */
deleteExecutionAsync( DeleteExecutionRequest request)3662   public final OperationFuture<Empty, OperationMetadata> deleteExecutionAsync(
3663       DeleteExecutionRequest request) {
3664     return deleteExecutionOperationCallable().futureCall(request);
3665   }
3666 
3667   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3668   /**
3669    * Deletes execution
3670    *
3671    * <p>Sample code:
3672    *
3673    * <pre>{@code
3674    * // This snippet has been automatically generated and should be regarded as a code template only.
3675    * // It will require modifications to work:
3676    * // - It may require correct/in-range values for request initialization.
3677    * // - It may require specifying regional endpoints when creating the service client as shown in
3678    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3679    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3680    *   DeleteExecutionRequest request =
3681    *       DeleteExecutionRequest.newBuilder()
3682    *           .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
3683    *           .build();
3684    *   OperationFuture<Empty, OperationMetadata> future =
3685    *       notebookServiceClient.deleteExecutionOperationCallable().futureCall(request);
3686    *   // Do something.
3687    *   future.get();
3688    * }
3689    * }</pre>
3690    */
3691   public final OperationCallable<DeleteExecutionRequest, Empty, OperationMetadata>
deleteExecutionOperationCallable()3692       deleteExecutionOperationCallable() {
3693     return stub.deleteExecutionOperationCallable();
3694   }
3695 
3696   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3697   /**
3698    * Deletes execution
3699    *
3700    * <p>Sample code:
3701    *
3702    * <pre>{@code
3703    * // This snippet has been automatically generated and should be regarded as a code template only.
3704    * // It will require modifications to work:
3705    * // - It may require correct/in-range values for request initialization.
3706    * // - It may require specifying regional endpoints when creating the service client as shown in
3707    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3708    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3709    *   DeleteExecutionRequest request =
3710    *       DeleteExecutionRequest.newBuilder()
3711    *           .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
3712    *           .build();
3713    *   ApiFuture<Operation> future =
3714    *       notebookServiceClient.deleteExecutionCallable().futureCall(request);
3715    *   // Do something.
3716    *   future.get();
3717    * }
3718    * }</pre>
3719    */
deleteExecutionCallable()3720   public final UnaryCallable<DeleteExecutionRequest, Operation> deleteExecutionCallable() {
3721     return stub.deleteExecutionCallable();
3722   }
3723 
3724   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3725   /**
3726    * Creates a new Execution in a given project and location.
3727    *
3728    * <p>Sample code:
3729    *
3730    * <pre>{@code
3731    * // This snippet has been automatically generated and should be regarded as a code template only.
3732    * // It will require modifications to work:
3733    * // - It may require correct/in-range values for request initialization.
3734    * // - It may require specifying regional endpoints when creating the service client as shown in
3735    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3736    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3737    *   ExecutionName parent = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]");
3738    *   Execution execution = Execution.newBuilder().build();
3739    *   String executionId = "executionId-454906285";
3740    *   Execution response =
3741    *       notebookServiceClient.createExecutionAsync(parent, execution, executionId).get();
3742    * }
3743    * }</pre>
3744    *
3745    * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}`
3746    * @param execution Required. The execution to be created.
3747    * @param executionId Required. User-defined unique ID of this execution.
3748    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3749    */
createExecutionAsync( ExecutionName parent, Execution execution, String executionId)3750   public final OperationFuture<Execution, OperationMetadata> createExecutionAsync(
3751       ExecutionName parent, Execution execution, String executionId) {
3752     CreateExecutionRequest request =
3753         CreateExecutionRequest.newBuilder()
3754             .setParent(parent == null ? null : parent.toString())
3755             .setExecution(execution)
3756             .setExecutionId(executionId)
3757             .build();
3758     return createExecutionAsync(request);
3759   }
3760 
3761   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3762   /**
3763    * Creates a new Execution in a given project and location.
3764    *
3765    * <p>Sample code:
3766    *
3767    * <pre>{@code
3768    * // This snippet has been automatically generated and should be regarded as a code template only.
3769    * // It will require modifications to work:
3770    * // - It may require correct/in-range values for request initialization.
3771    * // - It may require specifying regional endpoints when creating the service client as shown in
3772    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3773    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3774    *   String parent = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString();
3775    *   Execution execution = Execution.newBuilder().build();
3776    *   String executionId = "executionId-454906285";
3777    *   Execution response =
3778    *       notebookServiceClient.createExecutionAsync(parent, execution, executionId).get();
3779    * }
3780    * }</pre>
3781    *
3782    * @param parent Required. Format: `parent=projects/{project_id}/locations/{location}`
3783    * @param execution Required. The execution to be created.
3784    * @param executionId Required. User-defined unique ID of this execution.
3785    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3786    */
createExecutionAsync( String parent, Execution execution, String executionId)3787   public final OperationFuture<Execution, OperationMetadata> createExecutionAsync(
3788       String parent, Execution execution, String executionId) {
3789     CreateExecutionRequest request =
3790         CreateExecutionRequest.newBuilder()
3791             .setParent(parent)
3792             .setExecution(execution)
3793             .setExecutionId(executionId)
3794             .build();
3795     return createExecutionAsync(request);
3796   }
3797 
3798   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3799   /**
3800    * Creates a new Execution in a given project and location.
3801    *
3802    * <p>Sample code:
3803    *
3804    * <pre>{@code
3805    * // This snippet has been automatically generated and should be regarded as a code template only.
3806    * // It will require modifications to work:
3807    * // - It may require correct/in-range values for request initialization.
3808    * // - It may require specifying regional endpoints when creating the service client as shown in
3809    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3810    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3811    *   CreateExecutionRequest request =
3812    *       CreateExecutionRequest.newBuilder()
3813    *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
3814    *           .setExecutionId("executionId-454906285")
3815    *           .setExecution(Execution.newBuilder().build())
3816    *           .build();
3817    *   Execution response = notebookServiceClient.createExecutionAsync(request).get();
3818    * }
3819    * }</pre>
3820    *
3821    * @param request The request object containing all of the parameters for the API call.
3822    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3823    */
createExecutionAsync( CreateExecutionRequest request)3824   public final OperationFuture<Execution, OperationMetadata> createExecutionAsync(
3825       CreateExecutionRequest request) {
3826     return createExecutionOperationCallable().futureCall(request);
3827   }
3828 
3829   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3830   /**
3831    * Creates a new Execution in a given project and location.
3832    *
3833    * <p>Sample code:
3834    *
3835    * <pre>{@code
3836    * // This snippet has been automatically generated and should be regarded as a code template only.
3837    * // It will require modifications to work:
3838    * // - It may require correct/in-range values for request initialization.
3839    * // - It may require specifying regional endpoints when creating the service client as shown in
3840    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3841    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3842    *   CreateExecutionRequest request =
3843    *       CreateExecutionRequest.newBuilder()
3844    *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
3845    *           .setExecutionId("executionId-454906285")
3846    *           .setExecution(Execution.newBuilder().build())
3847    *           .build();
3848    *   OperationFuture<Execution, OperationMetadata> future =
3849    *       notebookServiceClient.createExecutionOperationCallable().futureCall(request);
3850    *   // Do something.
3851    *   Execution response = future.get();
3852    * }
3853    * }</pre>
3854    */
3855   public final OperationCallable<CreateExecutionRequest, Execution, OperationMetadata>
createExecutionOperationCallable()3856       createExecutionOperationCallable() {
3857     return stub.createExecutionOperationCallable();
3858   }
3859 
3860   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3861   /**
3862    * Creates a new Execution in a given project and location.
3863    *
3864    * <p>Sample code:
3865    *
3866    * <pre>{@code
3867    * // This snippet has been automatically generated and should be regarded as a code template only.
3868    * // It will require modifications to work:
3869    * // - It may require correct/in-range values for request initialization.
3870    * // - It may require specifying regional endpoints when creating the service client as shown in
3871    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3872    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3873    *   CreateExecutionRequest request =
3874    *       CreateExecutionRequest.newBuilder()
3875    *           .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString())
3876    *           .setExecutionId("executionId-454906285")
3877    *           .setExecution(Execution.newBuilder().build())
3878    *           .build();
3879    *   ApiFuture<Operation> future =
3880    *       notebookServiceClient.createExecutionCallable().futureCall(request);
3881    *   // Do something.
3882    *   Operation response = future.get();
3883    * }
3884    * }</pre>
3885    */
createExecutionCallable()3886   public final UnaryCallable<CreateExecutionRequest, Operation> createExecutionCallable() {
3887     return stub.createExecutionCallable();
3888   }
3889 
3890   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3891   /**
3892    * Lists information about the supported locations for this service.
3893    *
3894    * <p>Sample code:
3895    *
3896    * <pre>{@code
3897    * // This snippet has been automatically generated and should be regarded as a code template only.
3898    * // It will require modifications to work:
3899    * // - It may require correct/in-range values for request initialization.
3900    * // - It may require specifying regional endpoints when creating the service client as shown in
3901    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3902    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3903    *   ListLocationsRequest request =
3904    *       ListLocationsRequest.newBuilder()
3905    *           .setName("name3373707")
3906    *           .setFilter("filter-1274492040")
3907    *           .setPageSize(883849137)
3908    *           .setPageToken("pageToken873572522")
3909    *           .build();
3910    *   for (Location element : notebookServiceClient.listLocations(request).iterateAll()) {
3911    *     // doThingsWith(element);
3912    *   }
3913    * }
3914    * }</pre>
3915    *
3916    * @param request The request object containing all of the parameters for the API call.
3917    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3918    */
listLocations(ListLocationsRequest request)3919   public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
3920     return listLocationsPagedCallable().call(request);
3921   }
3922 
3923   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3924   /**
3925    * Lists information about the supported locations for this service.
3926    *
3927    * <p>Sample code:
3928    *
3929    * <pre>{@code
3930    * // This snippet has been automatically generated and should be regarded as a code template only.
3931    * // It will require modifications to work:
3932    * // - It may require correct/in-range values for request initialization.
3933    * // - It may require specifying regional endpoints when creating the service client as shown in
3934    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3935    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3936    *   ListLocationsRequest request =
3937    *       ListLocationsRequest.newBuilder()
3938    *           .setName("name3373707")
3939    *           .setFilter("filter-1274492040")
3940    *           .setPageSize(883849137)
3941    *           .setPageToken("pageToken873572522")
3942    *           .build();
3943    *   ApiFuture<Location> future =
3944    *       notebookServiceClient.listLocationsPagedCallable().futureCall(request);
3945    *   // Do something.
3946    *   for (Location element : future.get().iterateAll()) {
3947    *     // doThingsWith(element);
3948    *   }
3949    * }
3950    * }</pre>
3951    */
3952   public final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
listLocationsPagedCallable()3953       listLocationsPagedCallable() {
3954     return stub.listLocationsPagedCallable();
3955   }
3956 
3957   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3958   /**
3959    * Lists information about the supported locations for this service.
3960    *
3961    * <p>Sample code:
3962    *
3963    * <pre>{@code
3964    * // This snippet has been automatically generated and should be regarded as a code template only.
3965    * // It will require modifications to work:
3966    * // - It may require correct/in-range values for request initialization.
3967    * // - It may require specifying regional endpoints when creating the service client as shown in
3968    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3969    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
3970    *   ListLocationsRequest request =
3971    *       ListLocationsRequest.newBuilder()
3972    *           .setName("name3373707")
3973    *           .setFilter("filter-1274492040")
3974    *           .setPageSize(883849137)
3975    *           .setPageToken("pageToken873572522")
3976    *           .build();
3977    *   while (true) {
3978    *     ListLocationsResponse response =
3979    *         notebookServiceClient.listLocationsCallable().call(request);
3980    *     for (Location element : response.getLocationsList()) {
3981    *       // doThingsWith(element);
3982    *     }
3983    *     String nextPageToken = response.getNextPageToken();
3984    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
3985    *       request = request.toBuilder().setPageToken(nextPageToken).build();
3986    *     } else {
3987    *       break;
3988    *     }
3989    *   }
3990    * }
3991    * }</pre>
3992    */
listLocationsCallable()3993   public final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
3994     return stub.listLocationsCallable();
3995   }
3996 
3997   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3998   /**
3999    * Gets information about a location.
4000    *
4001    * <p>Sample code:
4002    *
4003    * <pre>{@code
4004    * // This snippet has been automatically generated and should be regarded as a code template only.
4005    * // It will require modifications to work:
4006    * // - It may require correct/in-range values for request initialization.
4007    * // - It may require specifying regional endpoints when creating the service client as shown in
4008    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4009    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
4010    *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
4011    *   Location response = notebookServiceClient.getLocation(request);
4012    * }
4013    * }</pre>
4014    *
4015    * @param request The request object containing all of the parameters for the API call.
4016    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
4017    */
getLocation(GetLocationRequest request)4018   public final Location getLocation(GetLocationRequest request) {
4019     return getLocationCallable().call(request);
4020   }
4021 
4022   // AUTO-GENERATED DOCUMENTATION AND METHOD.
4023   /**
4024    * Gets information about a location.
4025    *
4026    * <p>Sample code:
4027    *
4028    * <pre>{@code
4029    * // This snippet has been automatically generated and should be regarded as a code template only.
4030    * // It will require modifications to work:
4031    * // - It may require correct/in-range values for request initialization.
4032    * // - It may require specifying regional endpoints when creating the service client as shown in
4033    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4034    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
4035    *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
4036    *   ApiFuture<Location> future = notebookServiceClient.getLocationCallable().futureCall(request);
4037    *   // Do something.
4038    *   Location response = future.get();
4039    * }
4040    * }</pre>
4041    */
getLocationCallable()4042   public final UnaryCallable<GetLocationRequest, Location> getLocationCallable() {
4043     return stub.getLocationCallable();
4044   }
4045 
4046   // AUTO-GENERATED DOCUMENTATION AND METHOD.
4047   /**
4048    * Sets the access control policy on the specified resource. Replacesany existing policy.
4049    *
4050    * <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
4051    *
4052    * <p>Sample code:
4053    *
4054    * <pre>{@code
4055    * // This snippet has been automatically generated and should be regarded as a code template only.
4056    * // It will require modifications to work:
4057    * // - It may require correct/in-range values for request initialization.
4058    * // - It may require specifying regional endpoints when creating the service client as shown in
4059    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4060    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
4061    *   SetIamPolicyRequest request =
4062    *       SetIamPolicyRequest.newBuilder()
4063    *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
4064    *           .setPolicy(Policy.newBuilder().build())
4065    *           .setUpdateMask(FieldMask.newBuilder().build())
4066    *           .build();
4067    *   Policy response = notebookServiceClient.setIamPolicy(request);
4068    * }
4069    * }</pre>
4070    *
4071    * @param request The request object containing all of the parameters for the API call.
4072    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
4073    */
setIamPolicy(SetIamPolicyRequest request)4074   public final Policy setIamPolicy(SetIamPolicyRequest request) {
4075     return setIamPolicyCallable().call(request);
4076   }
4077 
4078   // AUTO-GENERATED DOCUMENTATION AND METHOD.
4079   /**
4080    * Sets the access control policy on the specified resource. Replacesany existing policy.
4081    *
4082    * <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
4083    *
4084    * <p>Sample code:
4085    *
4086    * <pre>{@code
4087    * // This snippet has been automatically generated and should be regarded as a code template only.
4088    * // It will require modifications to work:
4089    * // - It may require correct/in-range values for request initialization.
4090    * // - It may require specifying regional endpoints when creating the service client as shown in
4091    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4092    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
4093    *   SetIamPolicyRequest request =
4094    *       SetIamPolicyRequest.newBuilder()
4095    *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
4096    *           .setPolicy(Policy.newBuilder().build())
4097    *           .setUpdateMask(FieldMask.newBuilder().build())
4098    *           .build();
4099    *   ApiFuture<Policy> future = notebookServiceClient.setIamPolicyCallable().futureCall(request);
4100    *   // Do something.
4101    *   Policy response = future.get();
4102    * }
4103    * }</pre>
4104    */
setIamPolicyCallable()4105   public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
4106     return stub.setIamPolicyCallable();
4107   }
4108 
4109   // AUTO-GENERATED DOCUMENTATION AND METHOD.
4110   /**
4111    * Gets the access control policy for a resource. Returns an empty policyif the resource exists
4112    * and does not have a policy set.
4113    *
4114    * <p>Sample code:
4115    *
4116    * <pre>{@code
4117    * // This snippet has been automatically generated and should be regarded as a code template only.
4118    * // It will require modifications to work:
4119    * // - It may require correct/in-range values for request initialization.
4120    * // - It may require specifying regional endpoints when creating the service client as shown in
4121    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4122    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
4123    *   GetIamPolicyRequest request =
4124    *       GetIamPolicyRequest.newBuilder()
4125    *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
4126    *           .setOptions(GetPolicyOptions.newBuilder().build())
4127    *           .build();
4128    *   Policy response = notebookServiceClient.getIamPolicy(request);
4129    * }
4130    * }</pre>
4131    *
4132    * @param request The request object containing all of the parameters for the API call.
4133    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
4134    */
getIamPolicy(GetIamPolicyRequest request)4135   public final Policy getIamPolicy(GetIamPolicyRequest request) {
4136     return getIamPolicyCallable().call(request);
4137   }
4138 
4139   // AUTO-GENERATED DOCUMENTATION AND METHOD.
4140   /**
4141    * Gets the access control policy for a resource. Returns an empty policyif the resource exists
4142    * and does not have a policy set.
4143    *
4144    * <p>Sample code:
4145    *
4146    * <pre>{@code
4147    * // This snippet has been automatically generated and should be regarded as a code template only.
4148    * // It will require modifications to work:
4149    * // - It may require correct/in-range values for request initialization.
4150    * // - It may require specifying regional endpoints when creating the service client as shown in
4151    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4152    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
4153    *   GetIamPolicyRequest request =
4154    *       GetIamPolicyRequest.newBuilder()
4155    *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
4156    *           .setOptions(GetPolicyOptions.newBuilder().build())
4157    *           .build();
4158    *   ApiFuture<Policy> future = notebookServiceClient.getIamPolicyCallable().futureCall(request);
4159    *   // Do something.
4160    *   Policy response = future.get();
4161    * }
4162    * }</pre>
4163    */
getIamPolicyCallable()4164   public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
4165     return stub.getIamPolicyCallable();
4166   }
4167 
4168   // AUTO-GENERATED DOCUMENTATION AND METHOD.
4169   /**
4170    * Returns permissions that a caller has on the specified resource. If theresource does not exist,
4171    * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
4172    *
4173    * <p>Note: This operation is designed to be used for buildingpermission-aware UIs and
4174    * command-line tools, not for authorizationchecking. This operation may "fail open" without
4175    * warning.
4176    *
4177    * <p>Sample code:
4178    *
4179    * <pre>{@code
4180    * // This snippet has been automatically generated and should be regarded as a code template only.
4181    * // It will require modifications to work:
4182    * // - It may require correct/in-range values for request initialization.
4183    * // - It may require specifying regional endpoints when creating the service client as shown in
4184    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4185    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
4186    *   TestIamPermissionsRequest request =
4187    *       TestIamPermissionsRequest.newBuilder()
4188    *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
4189    *           .addAllPermissions(new ArrayList<String>())
4190    *           .build();
4191    *   TestIamPermissionsResponse response = notebookServiceClient.testIamPermissions(request);
4192    * }
4193    * }</pre>
4194    *
4195    * @param request The request object containing all of the parameters for the API call.
4196    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
4197    */
testIamPermissions(TestIamPermissionsRequest request)4198   public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
4199     return testIamPermissionsCallable().call(request);
4200   }
4201 
4202   // AUTO-GENERATED DOCUMENTATION AND METHOD.
4203   /**
4204    * Returns permissions that a caller has on the specified resource. If theresource does not exist,
4205    * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
4206    *
4207    * <p>Note: This operation is designed to be used for buildingpermission-aware UIs and
4208    * command-line tools, not for authorizationchecking. This operation may "fail open" without
4209    * warning.
4210    *
4211    * <p>Sample code:
4212    *
4213    * <pre>{@code
4214    * // This snippet has been automatically generated and should be regarded as a code template only.
4215    * // It will require modifications to work:
4216    * // - It may require correct/in-range values for request initialization.
4217    * // - It may require specifying regional endpoints when creating the service client as shown in
4218    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4219    * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
4220    *   TestIamPermissionsRequest request =
4221    *       TestIamPermissionsRequest.newBuilder()
4222    *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
4223    *           .addAllPermissions(new ArrayList<String>())
4224    *           .build();
4225    *   ApiFuture<TestIamPermissionsResponse> future =
4226    *       notebookServiceClient.testIamPermissionsCallable().futureCall(request);
4227    *   // Do something.
4228    *   TestIamPermissionsResponse response = future.get();
4229    * }
4230    * }</pre>
4231    */
4232   public final UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsCallable()4233       testIamPermissionsCallable() {
4234     return stub.testIamPermissionsCallable();
4235   }
4236 
4237   @Override
close()4238   public final void close() {
4239     stub.close();
4240   }
4241 
4242   @Override
shutdown()4243   public void shutdown() {
4244     stub.shutdown();
4245   }
4246 
4247   @Override
isShutdown()4248   public boolean isShutdown() {
4249     return stub.isShutdown();
4250   }
4251 
4252   @Override
isTerminated()4253   public boolean isTerminated() {
4254     return stub.isTerminated();
4255   }
4256 
4257   @Override
shutdownNow()4258   public void shutdownNow() {
4259     stub.shutdownNow();
4260   }
4261 
4262   @Override
awaitTermination(long duration, TimeUnit unit)4263   public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
4264     return stub.awaitTermination(duration, unit);
4265   }
4266 
4267   public static class ListInstancesPagedResponse
4268       extends AbstractPagedListResponse<
4269           ListInstancesRequest,
4270           ListInstancesResponse,
4271           Instance,
4272           ListInstancesPage,
4273           ListInstancesFixedSizeCollection> {
4274 
createAsync( PageContext<ListInstancesRequest, ListInstancesResponse, Instance> context, ApiFuture<ListInstancesResponse> futureResponse)4275     public static ApiFuture<ListInstancesPagedResponse> createAsync(
4276         PageContext<ListInstancesRequest, ListInstancesResponse, Instance> context,
4277         ApiFuture<ListInstancesResponse> futureResponse) {
4278       ApiFuture<ListInstancesPage> futurePage =
4279           ListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse);
4280       return ApiFutures.transform(
4281           futurePage,
4282           input -> new ListInstancesPagedResponse(input),
4283           MoreExecutors.directExecutor());
4284     }
4285 
ListInstancesPagedResponse(ListInstancesPage page)4286     private ListInstancesPagedResponse(ListInstancesPage page) {
4287       super(page, ListInstancesFixedSizeCollection.createEmptyCollection());
4288     }
4289   }
4290 
4291   public static class ListInstancesPage
4292       extends AbstractPage<
4293           ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage> {
4294 
ListInstancesPage( PageContext<ListInstancesRequest, ListInstancesResponse, Instance> context, ListInstancesResponse response)4295     private ListInstancesPage(
4296         PageContext<ListInstancesRequest, ListInstancesResponse, Instance> context,
4297         ListInstancesResponse response) {
4298       super(context, response);
4299     }
4300 
createEmptyPage()4301     private static ListInstancesPage createEmptyPage() {
4302       return new ListInstancesPage(null, null);
4303     }
4304 
4305     @Override
createPage( PageContext<ListInstancesRequest, ListInstancesResponse, Instance> context, ListInstancesResponse response)4306     protected ListInstancesPage createPage(
4307         PageContext<ListInstancesRequest, ListInstancesResponse, Instance> context,
4308         ListInstancesResponse response) {
4309       return new ListInstancesPage(context, response);
4310     }
4311 
4312     @Override
createPageAsync( PageContext<ListInstancesRequest, ListInstancesResponse, Instance> context, ApiFuture<ListInstancesResponse> futureResponse)4313     public ApiFuture<ListInstancesPage> createPageAsync(
4314         PageContext<ListInstancesRequest, ListInstancesResponse, Instance> context,
4315         ApiFuture<ListInstancesResponse> futureResponse) {
4316       return super.createPageAsync(context, futureResponse);
4317     }
4318   }
4319 
4320   public static class ListInstancesFixedSizeCollection
4321       extends AbstractFixedSizeCollection<
4322           ListInstancesRequest,
4323           ListInstancesResponse,
4324           Instance,
4325           ListInstancesPage,
4326           ListInstancesFixedSizeCollection> {
4327 
ListInstancesFixedSizeCollection(List<ListInstancesPage> pages, int collectionSize)4328     private ListInstancesFixedSizeCollection(List<ListInstancesPage> pages, int collectionSize) {
4329       super(pages, collectionSize);
4330     }
4331 
createEmptyCollection()4332     private static ListInstancesFixedSizeCollection createEmptyCollection() {
4333       return new ListInstancesFixedSizeCollection(null, 0);
4334     }
4335 
4336     @Override
createCollection( List<ListInstancesPage> pages, int collectionSize)4337     protected ListInstancesFixedSizeCollection createCollection(
4338         List<ListInstancesPage> pages, int collectionSize) {
4339       return new ListInstancesFixedSizeCollection(pages, collectionSize);
4340     }
4341   }
4342 
4343   public static class ListEnvironmentsPagedResponse
4344       extends AbstractPagedListResponse<
4345           ListEnvironmentsRequest,
4346           ListEnvironmentsResponse,
4347           Environment,
4348           ListEnvironmentsPage,
4349           ListEnvironmentsFixedSizeCollection> {
4350 
createAsync( PageContext<ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> context, ApiFuture<ListEnvironmentsResponse> futureResponse)4351     public static ApiFuture<ListEnvironmentsPagedResponse> createAsync(
4352         PageContext<ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> context,
4353         ApiFuture<ListEnvironmentsResponse> futureResponse) {
4354       ApiFuture<ListEnvironmentsPage> futurePage =
4355           ListEnvironmentsPage.createEmptyPage().createPageAsync(context, futureResponse);
4356       return ApiFutures.transform(
4357           futurePage,
4358           input -> new ListEnvironmentsPagedResponse(input),
4359           MoreExecutors.directExecutor());
4360     }
4361 
ListEnvironmentsPagedResponse(ListEnvironmentsPage page)4362     private ListEnvironmentsPagedResponse(ListEnvironmentsPage page) {
4363       super(page, ListEnvironmentsFixedSizeCollection.createEmptyCollection());
4364     }
4365   }
4366 
4367   public static class ListEnvironmentsPage
4368       extends AbstractPage<
4369           ListEnvironmentsRequest, ListEnvironmentsResponse, Environment, ListEnvironmentsPage> {
4370 
ListEnvironmentsPage( PageContext<ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> context, ListEnvironmentsResponse response)4371     private ListEnvironmentsPage(
4372         PageContext<ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> context,
4373         ListEnvironmentsResponse response) {
4374       super(context, response);
4375     }
4376 
createEmptyPage()4377     private static ListEnvironmentsPage createEmptyPage() {
4378       return new ListEnvironmentsPage(null, null);
4379     }
4380 
4381     @Override
createPage( PageContext<ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> context, ListEnvironmentsResponse response)4382     protected ListEnvironmentsPage createPage(
4383         PageContext<ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> context,
4384         ListEnvironmentsResponse response) {
4385       return new ListEnvironmentsPage(context, response);
4386     }
4387 
4388     @Override
createPageAsync( PageContext<ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> context, ApiFuture<ListEnvironmentsResponse> futureResponse)4389     public ApiFuture<ListEnvironmentsPage> createPageAsync(
4390         PageContext<ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> context,
4391         ApiFuture<ListEnvironmentsResponse> futureResponse) {
4392       return super.createPageAsync(context, futureResponse);
4393     }
4394   }
4395 
4396   public static class ListEnvironmentsFixedSizeCollection
4397       extends AbstractFixedSizeCollection<
4398           ListEnvironmentsRequest,
4399           ListEnvironmentsResponse,
4400           Environment,
4401           ListEnvironmentsPage,
4402           ListEnvironmentsFixedSizeCollection> {
4403 
ListEnvironmentsFixedSizeCollection( List<ListEnvironmentsPage> pages, int collectionSize)4404     private ListEnvironmentsFixedSizeCollection(
4405         List<ListEnvironmentsPage> pages, int collectionSize) {
4406       super(pages, collectionSize);
4407     }
4408 
createEmptyCollection()4409     private static ListEnvironmentsFixedSizeCollection createEmptyCollection() {
4410       return new ListEnvironmentsFixedSizeCollection(null, 0);
4411     }
4412 
4413     @Override
createCollection( List<ListEnvironmentsPage> pages, int collectionSize)4414     protected ListEnvironmentsFixedSizeCollection createCollection(
4415         List<ListEnvironmentsPage> pages, int collectionSize) {
4416       return new ListEnvironmentsFixedSizeCollection(pages, collectionSize);
4417     }
4418   }
4419 
4420   public static class ListSchedulesPagedResponse
4421       extends AbstractPagedListResponse<
4422           ListSchedulesRequest,
4423           ListSchedulesResponse,
4424           Schedule,
4425           ListSchedulesPage,
4426           ListSchedulesFixedSizeCollection> {
4427 
createAsync( PageContext<ListSchedulesRequest, ListSchedulesResponse, Schedule> context, ApiFuture<ListSchedulesResponse> futureResponse)4428     public static ApiFuture<ListSchedulesPagedResponse> createAsync(
4429         PageContext<ListSchedulesRequest, ListSchedulesResponse, Schedule> context,
4430         ApiFuture<ListSchedulesResponse> futureResponse) {
4431       ApiFuture<ListSchedulesPage> futurePage =
4432           ListSchedulesPage.createEmptyPage().createPageAsync(context, futureResponse);
4433       return ApiFutures.transform(
4434           futurePage,
4435           input -> new ListSchedulesPagedResponse(input),
4436           MoreExecutors.directExecutor());
4437     }
4438 
ListSchedulesPagedResponse(ListSchedulesPage page)4439     private ListSchedulesPagedResponse(ListSchedulesPage page) {
4440       super(page, ListSchedulesFixedSizeCollection.createEmptyCollection());
4441     }
4442   }
4443 
4444   public static class ListSchedulesPage
4445       extends AbstractPage<
4446           ListSchedulesRequest, ListSchedulesResponse, Schedule, ListSchedulesPage> {
4447 
ListSchedulesPage( PageContext<ListSchedulesRequest, ListSchedulesResponse, Schedule> context, ListSchedulesResponse response)4448     private ListSchedulesPage(
4449         PageContext<ListSchedulesRequest, ListSchedulesResponse, Schedule> context,
4450         ListSchedulesResponse response) {
4451       super(context, response);
4452     }
4453 
createEmptyPage()4454     private static ListSchedulesPage createEmptyPage() {
4455       return new ListSchedulesPage(null, null);
4456     }
4457 
4458     @Override
createPage( PageContext<ListSchedulesRequest, ListSchedulesResponse, Schedule> context, ListSchedulesResponse response)4459     protected ListSchedulesPage createPage(
4460         PageContext<ListSchedulesRequest, ListSchedulesResponse, Schedule> context,
4461         ListSchedulesResponse response) {
4462       return new ListSchedulesPage(context, response);
4463     }
4464 
4465     @Override
createPageAsync( PageContext<ListSchedulesRequest, ListSchedulesResponse, Schedule> context, ApiFuture<ListSchedulesResponse> futureResponse)4466     public ApiFuture<ListSchedulesPage> createPageAsync(
4467         PageContext<ListSchedulesRequest, ListSchedulesResponse, Schedule> context,
4468         ApiFuture<ListSchedulesResponse> futureResponse) {
4469       return super.createPageAsync(context, futureResponse);
4470     }
4471   }
4472 
4473   public static class ListSchedulesFixedSizeCollection
4474       extends AbstractFixedSizeCollection<
4475           ListSchedulesRequest,
4476           ListSchedulesResponse,
4477           Schedule,
4478           ListSchedulesPage,
4479           ListSchedulesFixedSizeCollection> {
4480 
ListSchedulesFixedSizeCollection(List<ListSchedulesPage> pages, int collectionSize)4481     private ListSchedulesFixedSizeCollection(List<ListSchedulesPage> pages, int collectionSize) {
4482       super(pages, collectionSize);
4483     }
4484 
createEmptyCollection()4485     private static ListSchedulesFixedSizeCollection createEmptyCollection() {
4486       return new ListSchedulesFixedSizeCollection(null, 0);
4487     }
4488 
4489     @Override
createCollection( List<ListSchedulesPage> pages, int collectionSize)4490     protected ListSchedulesFixedSizeCollection createCollection(
4491         List<ListSchedulesPage> pages, int collectionSize) {
4492       return new ListSchedulesFixedSizeCollection(pages, collectionSize);
4493     }
4494   }
4495 
4496   public static class ListExecutionsPagedResponse
4497       extends AbstractPagedListResponse<
4498           ListExecutionsRequest,
4499           ListExecutionsResponse,
4500           Execution,
4501           ListExecutionsPage,
4502           ListExecutionsFixedSizeCollection> {
4503 
createAsync( PageContext<ListExecutionsRequest, ListExecutionsResponse, Execution> context, ApiFuture<ListExecutionsResponse> futureResponse)4504     public static ApiFuture<ListExecutionsPagedResponse> createAsync(
4505         PageContext<ListExecutionsRequest, ListExecutionsResponse, Execution> context,
4506         ApiFuture<ListExecutionsResponse> futureResponse) {
4507       ApiFuture<ListExecutionsPage> futurePage =
4508           ListExecutionsPage.createEmptyPage().createPageAsync(context, futureResponse);
4509       return ApiFutures.transform(
4510           futurePage,
4511           input -> new ListExecutionsPagedResponse(input),
4512           MoreExecutors.directExecutor());
4513     }
4514 
ListExecutionsPagedResponse(ListExecutionsPage page)4515     private ListExecutionsPagedResponse(ListExecutionsPage page) {
4516       super(page, ListExecutionsFixedSizeCollection.createEmptyCollection());
4517     }
4518   }
4519 
4520   public static class ListExecutionsPage
4521       extends AbstractPage<
4522           ListExecutionsRequest, ListExecutionsResponse, Execution, ListExecutionsPage> {
4523 
ListExecutionsPage( PageContext<ListExecutionsRequest, ListExecutionsResponse, Execution> context, ListExecutionsResponse response)4524     private ListExecutionsPage(
4525         PageContext<ListExecutionsRequest, ListExecutionsResponse, Execution> context,
4526         ListExecutionsResponse response) {
4527       super(context, response);
4528     }
4529 
createEmptyPage()4530     private static ListExecutionsPage createEmptyPage() {
4531       return new ListExecutionsPage(null, null);
4532     }
4533 
4534     @Override
createPage( PageContext<ListExecutionsRequest, ListExecutionsResponse, Execution> context, ListExecutionsResponse response)4535     protected ListExecutionsPage createPage(
4536         PageContext<ListExecutionsRequest, ListExecutionsResponse, Execution> context,
4537         ListExecutionsResponse response) {
4538       return new ListExecutionsPage(context, response);
4539     }
4540 
4541     @Override
createPageAsync( PageContext<ListExecutionsRequest, ListExecutionsResponse, Execution> context, ApiFuture<ListExecutionsResponse> futureResponse)4542     public ApiFuture<ListExecutionsPage> createPageAsync(
4543         PageContext<ListExecutionsRequest, ListExecutionsResponse, Execution> context,
4544         ApiFuture<ListExecutionsResponse> futureResponse) {
4545       return super.createPageAsync(context, futureResponse);
4546     }
4547   }
4548 
4549   public static class ListExecutionsFixedSizeCollection
4550       extends AbstractFixedSizeCollection<
4551           ListExecutionsRequest,
4552           ListExecutionsResponse,
4553           Execution,
4554           ListExecutionsPage,
4555           ListExecutionsFixedSizeCollection> {
4556 
ListExecutionsFixedSizeCollection(List<ListExecutionsPage> pages, int collectionSize)4557     private ListExecutionsFixedSizeCollection(List<ListExecutionsPage> pages, int collectionSize) {
4558       super(pages, collectionSize);
4559     }
4560 
createEmptyCollection()4561     private static ListExecutionsFixedSizeCollection createEmptyCollection() {
4562       return new ListExecutionsFixedSizeCollection(null, 0);
4563     }
4564 
4565     @Override
createCollection( List<ListExecutionsPage> pages, int collectionSize)4566     protected ListExecutionsFixedSizeCollection createCollection(
4567         List<ListExecutionsPage> pages, int collectionSize) {
4568       return new ListExecutionsFixedSizeCollection(pages, collectionSize);
4569     }
4570   }
4571 
4572   public static class ListLocationsPagedResponse
4573       extends AbstractPagedListResponse<
4574           ListLocationsRequest,
4575           ListLocationsResponse,
4576           Location,
4577           ListLocationsPage,
4578           ListLocationsFixedSizeCollection> {
4579 
createAsync( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ApiFuture<ListLocationsResponse> futureResponse)4580     public static ApiFuture<ListLocationsPagedResponse> createAsync(
4581         PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
4582         ApiFuture<ListLocationsResponse> futureResponse) {
4583       ApiFuture<ListLocationsPage> futurePage =
4584           ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
4585       return ApiFutures.transform(
4586           futurePage,
4587           input -> new ListLocationsPagedResponse(input),
4588           MoreExecutors.directExecutor());
4589     }
4590 
ListLocationsPagedResponse(ListLocationsPage page)4591     private ListLocationsPagedResponse(ListLocationsPage page) {
4592       super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
4593     }
4594   }
4595 
4596   public static class ListLocationsPage
4597       extends AbstractPage<
4598           ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
4599 
ListLocationsPage( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ListLocationsResponse response)4600     private ListLocationsPage(
4601         PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
4602         ListLocationsResponse response) {
4603       super(context, response);
4604     }
4605 
createEmptyPage()4606     private static ListLocationsPage createEmptyPage() {
4607       return new ListLocationsPage(null, null);
4608     }
4609 
4610     @Override
createPage( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ListLocationsResponse response)4611     protected ListLocationsPage createPage(
4612         PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
4613         ListLocationsResponse response) {
4614       return new ListLocationsPage(context, response);
4615     }
4616 
4617     @Override
createPageAsync( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ApiFuture<ListLocationsResponse> futureResponse)4618     public ApiFuture<ListLocationsPage> createPageAsync(
4619         PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
4620         ApiFuture<ListLocationsResponse> futureResponse) {
4621       return super.createPageAsync(context, futureResponse);
4622     }
4623   }
4624 
4625   public static class ListLocationsFixedSizeCollection
4626       extends AbstractFixedSizeCollection<
4627           ListLocationsRequest,
4628           ListLocationsResponse,
4629           Location,
4630           ListLocationsPage,
4631           ListLocationsFixedSizeCollection> {
4632 
ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize)4633     private ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize) {
4634       super(pages, collectionSize);
4635     }
4636 
createEmptyCollection()4637     private static ListLocationsFixedSizeCollection createEmptyCollection() {
4638       return new ListLocationsFixedSizeCollection(null, 0);
4639     }
4640 
4641     @Override
createCollection( List<ListLocationsPage> pages, int collectionSize)4642     protected ListLocationsFixedSizeCollection createCollection(
4643         List<ListLocationsPage> pages, int collectionSize) {
4644       return new ListLocationsFixedSizeCollection(pages, collectionSize);
4645     }
4646   }
4647 }
4648