This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *
- *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * GetInstanceRequest request = GetInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * Instance response = notebookServiceClient.getInstance(request);
- * }
- *
- *
- *
- * Note: close() needs to be called on the notebookServiceClient object to clean up resources + *
Note: close() needs to be called on the NotebookServiceClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * @@ -86,30 +75,28 @@ * *
To customize credentials: * - *
- *
+ * {@code
* NotebookServiceSettings notebookServiceSettings =
* NotebookServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* NotebookServiceClient notebookServiceClient =
* NotebookServiceClient.create(notebookServiceSettings);
- *
- *
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* NotebookServiceSettings notebookServiceSettings =
* NotebookServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
* NotebookServiceClient notebookServiceClient =
* NotebookServiceClient.create(notebookServiceSettings);
- *
- *
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class NotebookServiceClient implements BackgroundResource { private final NotebookServiceSettings settings; private final NotebookServiceStub stub; @@ -131,7 +118,7 @@ public static final NotebookServiceClient create(NotebookServiceSettings setting /** * Constructs an instance of NotebookServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer to use NotebookServiceSettings}. + * for advanced usage - prefer using create(NotebookServiceSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final NotebookServiceClient create(NotebookServiceStub stub) { @@ -169,30 +156,14 @@ public NotebookServiceStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists instances in a given project and location. * - *
Sample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * ListInstancesRequest request = ListInstancesRequest.newBuilder()
- * .setParent(parent)
- * .build();
- * for (Instance element : notebookServiceClient.listInstances(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -200,78 +171,31 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
return listInstancesPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists instances in a given project and location.
*
* Sample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * ListInstancesRequest request = ListInstancesRequest.newBuilder()
- * .setParent(parent)
- * .build();
- * ApiFuture<ListInstancesPagedResponse> future = notebookServiceClient.listInstancesPagedCallable().futureCall(request);
- * // Do something
- * for (Instance element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * ListInstancesRequest request = ListInstancesRequest.newBuilder()
- * .setParent(parent)
- * .build();
- * while (true) {
- * ListInstancesResponse response = notebookServiceClient.listInstancesCallable().call(request);
- * for (Instance element : response.getInstancesList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * GetInstanceRequest request = GetInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * Instance response = notebookServiceClient.getInstance(request);
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -279,820 +203,364 @@ public final Instance getInstance(GetInstanceRequest request) {
return getInstanceCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Instance.
*
* Sample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * GetInstanceRequest request = GetInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * ApiFuture<Instance> future = notebookServiceClient.getInstanceCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * String instanceId = "";
- * Instance instance = Instance.newBuilder().build();
- * CreateInstanceRequest request = CreateInstanceRequest.newBuilder()
- * .setParent(parent)
- * .setInstanceId(instanceId)
- * .setInstance(instance)
- * .build();
- * Instance response = notebookServiceClient.createInstanceAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * String instanceId = "";
- * Instance instance = Instance.newBuilder().build();
- * CreateInstanceRequest request = CreateInstanceRequest.newBuilder()
- * .setParent(parent)
- * .setInstanceId(instanceId)
- * .setInstance(instance)
- * .build();
- * OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.createInstanceOperationCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * String instanceId = "";
- * Instance instance = Instance.newBuilder().build();
- * CreateInstanceRequest request = CreateInstanceRequest.newBuilder()
- * .setParent(parent)
- * .setInstanceId(instanceId)
- * .setInstance(instance)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.createInstanceCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * String instanceId = "";
- * RegisterInstanceRequest request = RegisterInstanceRequest.newBuilder()
- * .setParent(parent)
- * .setInstanceId(instanceId)
- * .build();
- * Instance response = notebookServiceClient.registerInstanceAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * String instanceId = "";
- * RegisterInstanceRequest request = RegisterInstanceRequest.newBuilder()
- * .setParent(parent)
- * .setInstanceId(instanceId)
- * .build();
- * OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.registerInstanceOperationCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * String instanceId = "";
- * RegisterInstanceRequest request = RegisterInstanceRequest.newBuilder()
- * .setParent(parent)
- * .setInstanceId(instanceId)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.registerInstanceCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * Instance.AcceleratorType type = Instance.AcceleratorType.ACCELERATOR_TYPE_UNSPECIFIED;
- * long coreCount = 0L;
- * SetInstanceAcceleratorRequest request = SetInstanceAcceleratorRequest.newBuilder()
- * .setName(name)
- * .setType(type)
- * .setCoreCount(coreCount)
- * .build();
- * Instance response = notebookServiceClient.setInstanceAcceleratorAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * Instance.AcceleratorType type = Instance.AcceleratorType.ACCELERATOR_TYPE_UNSPECIFIED;
- * long coreCount = 0L;
- * SetInstanceAcceleratorRequest request = SetInstanceAcceleratorRequest.newBuilder()
- * .setName(name)
- * .setType(type)
- * .setCoreCount(coreCount)
- * .build();
- * OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.setInstanceAcceleratorOperationCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * Instance.AcceleratorType type = Instance.AcceleratorType.ACCELERATOR_TYPE_UNSPECIFIED;
- * long coreCount = 0L;
- * SetInstanceAcceleratorRequest request = SetInstanceAcceleratorRequest.newBuilder()
- * .setName(name)
- * .setType(type)
- * .setCoreCount(coreCount)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.setInstanceAcceleratorCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * String machineType = "";
- * SetInstanceMachineTypeRequest request = SetInstanceMachineTypeRequest.newBuilder()
- * .setName(name)
- * .setMachineType(machineType)
- * .build();
- * Instance response = notebookServiceClient.setInstanceMachineTypeAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * String machineType = "";
- * SetInstanceMachineTypeRequest request = SetInstanceMachineTypeRequest.newBuilder()
- * .setName(name)
- * .setMachineType(machineType)
- * .build();
- * OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.setInstanceMachineTypeOperationCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * String machineType = "";
- * SetInstanceMachineTypeRequest request = SetInstanceMachineTypeRequest.newBuilder()
- * .setName(name)
- * .setMachineType(machineType)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.setInstanceMachineTypeCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * SetInstanceLabelsRequest request = SetInstanceLabelsRequest.newBuilder()
- * .setName(name)
- * .build();
- * Instance response = notebookServiceClient.setInstanceLabelsAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * SetInstanceLabelsRequest request = SetInstanceLabelsRequest.newBuilder()
- * .setName(name)
- * .build();
- * OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.setInstanceLabelsOperationCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * SetInstanceLabelsRequest request = SetInstanceLabelsRequest.newBuilder()
- * .setName(name)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.setInstanceLabelsCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * notebookServiceClient.deleteInstanceAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * OperationFuture<Empty, OperationMetadata> future = notebookServiceClient.deleteInstanceOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.deleteInstanceCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * StartInstanceRequest request = StartInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * Instance response = notebookServiceClient.startInstanceAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * StartInstanceRequest request = StartInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.startInstanceOperationCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * StartInstanceRequest request = StartInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.startInstanceCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * StopInstanceRequest request = StopInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * Instance response = notebookServiceClient.stopInstanceAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * StopInstanceRequest request = StopInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.stopInstanceOperationCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * StopInstanceRequest request = StopInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.stopInstanceCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * ResetInstanceRequest request = ResetInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * Instance response = notebookServiceClient.resetInstanceAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * ResetInstanceRequest request = ResetInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.resetInstanceOperationCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * ResetInstanceRequest request = ResetInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.resetInstanceCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * String vmId = "";
- * ReportInstanceInfoRequest request = ReportInstanceInfoRequest.newBuilder()
- * .setName(name)
- * .setVmId(vmId)
- * .build();
- * Instance response = notebookServiceClient.reportInstanceInfoAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * String vmId = "";
- * ReportInstanceInfoRequest request = ReportInstanceInfoRequest.newBuilder()
- * .setName(name)
- * .setVmId(vmId)
- * .build();
- * OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.reportInstanceInfoOperationCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * String vmId = "";
- * ReportInstanceInfoRequest request = ReportInstanceInfoRequest.newBuilder()
- * .setName(name)
- * .setVmId(vmId)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.reportInstanceInfoCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String notebookInstance = "";
- * IsInstanceUpgradeableRequest request = IsInstanceUpgradeableRequest.newBuilder()
- * .setNotebookInstance(notebookInstance)
- * .build();
- * IsInstanceUpgradeableResponse response = notebookServiceClient.isInstanceUpgradeable(request);
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1101,201 +569,91 @@ public final IsInstanceUpgradeableResponse isInstanceUpgradeable(
return isInstanceUpgradeableCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Check if a notebook instance is upgradable.
*
* Sample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String notebookInstance = "";
- * IsInstanceUpgradeableRequest request = IsInstanceUpgradeableRequest.newBuilder()
- * .setNotebookInstance(notebookInstance)
- * .build();
- * ApiFuture<IsInstanceUpgradeableResponse> future = notebookServiceClient.isInstanceUpgradeableCallable().futureCall(request);
- * // Do something
- * IsInstanceUpgradeableResponse response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * Instance response = notebookServiceClient.upgradeInstanceAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.upgradeInstanceOperationCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.upgradeInstanceCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * String vmId = "";
- * UpgradeInstanceInternalRequest request = UpgradeInstanceInternalRequest.newBuilder()
- * .setName(name)
- * .setVmId(vmId)
- * .build();
- * Instance response = notebookServiceClient.upgradeInstanceInternalAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * String vmId = "";
- * UpgradeInstanceInternalRequest request = UpgradeInstanceInternalRequest.newBuilder()
- * .setName(name)
- * .setVmId(vmId)
- * .build();
- * OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.upgradeInstanceInternalOperationCallable().futureCall(request);
- * // Do something
- * Instance response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * String vmId = "";
- * UpgradeInstanceInternalRequest request = UpgradeInstanceInternalRequest.newBuilder()
- * .setName(name)
- * .setVmId(vmId)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.upgradeInstanceInternalCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
- * .setParent(parent)
- * .build();
- * for (Environment element : notebookServiceClient.listEnvironments(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1303,79 +661,32 @@ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequ
return listEnvironmentsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists environments in a project.
*
* Sample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
- * .setParent(parent)
- * .build();
- * ApiFuture<ListEnvironmentsPagedResponse> future = notebookServiceClient.listEnvironmentsPagedCallable().futureCall(request);
- * // Do something
- * for (Environment element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
- * .setParent(parent)
- * .build();
- * while (true) {
- * ListEnvironmentsResponse response = notebookServiceClient.listEnvironmentsCallable().call(request);
- * for (Environment element : response.getEnvironmentsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder()
- * .setName(name)
- * .build();
- * Environment response = notebookServiceClient.getEnvironment(request);
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1383,179 +694,77 @@ public final Environment getEnvironment(GetEnvironmentRequest request) {
return getEnvironmentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Environment.
*
* Sample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder()
- * .setName(name)
- * .build();
- * ApiFuture<Environment> future = notebookServiceClient.getEnvironmentCallable().futureCall(request);
- * // Do something
- * Environment response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * String environmentId = "";
- * Environment environment = Environment.newBuilder().build();
- * CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
- * .setParent(parent)
- * .setEnvironmentId(environmentId)
- * .setEnvironment(environment)
- * .build();
- * Environment response = notebookServiceClient.createEnvironmentAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * String environmentId = "";
- * Environment environment = Environment.newBuilder().build();
- * CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
- * .setParent(parent)
- * .setEnvironmentId(environmentId)
- * .setEnvironment(environment)
- * .build();
- * OperationFuture<Environment, OperationMetadata> future = notebookServiceClient.createEnvironmentOperationCallable().futureCall(request);
- * // Do something
- * Environment response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String parent = "";
- * String environmentId = "";
- * Environment environment = Environment.newBuilder().build();
- * CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
- * .setParent(parent)
- * .setEnvironmentId(environmentId)
- * .setEnvironment(environment)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.createEnvironmentCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder()
- * .setName(name)
- * .build();
- * notebookServiceClient.deleteEnvironmentAsync(request).get();
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder()
- * .setName(name)
- * .build();
- * OperationFuture<Empty, OperationMetadata> future = notebookServiceClient.deleteEnvironmentOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder()
- * .setName(name)
- * .build();
- * ApiFuture<Operation> future = notebookServiceClient.deleteEnvironmentCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of getInstance to 30 seconds: * - *
- *
+ * {@code
* NotebookServiceSettings.Builder notebookServiceSettingsBuilder =
* NotebookServiceSettings.newBuilder();
* notebookServiceSettingsBuilder
* .getInstanceSettings()
* .setRetrySettings(
- * notebookServiceSettingsBuilder.getInstanceSettings().getRetrySettings().toBuilder()
+ * notebookServiceSettingsBuilder
+ * .getInstanceSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* NotebookServiceSettings notebookServiceSettings = notebookServiceSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
-@BetaApi
+@Generated("by gapic-generator-java")
public class NotebookServiceSettings extends ClientSettingsThe interfaces provided are listed below, along with usage samples. - * - *
===================== NotebookServiceClient ===================== + *
======================= NotebookServiceClient ======================= * *
Service Description: API v1beta1 service for Cloud AI Platform Notebooks. * *
Sample for NotebookServiceClient: - * - *
- *
- * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
- * String name = "";
- * GetInstanceRequest request = GetInstanceRequest.newBuilder()
- * .setName(name)
- * .build();
- * Instance response = notebookServiceClient.getInstance(request);
- * }
- *
- *
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
package com.google.cloud.notebooks.v1beta1;
import javax.annotation.Generated;
diff --git a/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/GrpcNotebookServiceCallableFactory.java b/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/GrpcNotebookServiceCallableFactory.java
index a46f7bed..3cb8ec8d 100644
--- a/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/GrpcNotebookServiceCallableFactory.java
+++ b/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/GrpcNotebookServiceCallableFactory.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.notebooks.v1beta1.stub;
-import com.google.api.core.BetaApi;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcCallableFactory;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
@@ -31,18 +31,19 @@
import com.google.api.gax.rpc.StreamingCallSettings;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
import javax.annotation.Generated;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
- * gRPC callable factory implementation for Notebooks API.
+ * gRPC callable factory implementation for the NotebookService service API.
*
* This class is for advanced usage.
*/
@Generated("by gapic-generator")
-@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public class GrpcNotebookServiceCallableFactory implements GrpcStubCallableFactory {
+
@Override
public This class is for advanced usage and reflects the underlying API directly.
*/
-@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+@Generated("by gapic-generator-java")
public class GrpcNotebookServiceStub extends NotebookServiceStub {
-
private static final MethodDescriptor