From fd86bade171bda8f7d2461cf6a67bd23425fb40e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 21 Nov 2022 11:43:38 -0500 Subject: [PATCH] feat: [notebooks] added UpdateRuntime, UpgradeRuntime, DiagnoseRuntime, DiagnoseInstance to v1 API (#8804) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: added UpdateRuntime, UpgradeRuntime, DiagnoseRuntime, DiagnoseInstance to v1 API feat: add Instance.reservation_affinity, nic_type, can_ip_forward to v1beta1 API feat: add IsInstanceUpgradeableResponse.upgrade_image to v1beta1 API feat: added Location and IAM methods fix: deprecate AcceleratorType.NVIDIA_TESLA_K80 PiperOrigin-RevId: 489032946 Source-Link: https://github.com/googleapis/googleapis/commit/1d21a86868139db06481cc2d2a6e8e2dc8f1800a Source-Link: https://github.com/googleapis/googleapis-gen/commit/6da6c0850b02b2f0d6ab9c5862d021c4d16dadc9 Copy-Tag: eyJwIjoiamF2YS1ub3RlYm9va3MvLk93bEJvdC55YW1sIiwiaCI6IjZkYTZjMDg1MGIwMmIyZjBkNmFiOWM1ODYyZDAyMWM0ZDE2ZGFkYzkifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: add missing dependencies Co-authored-by: Owl Bot Co-authored-by: Diego Marquez --- java-notebooks/README.md | 32 +- java-notebooks/google-cloud-notebooks/pom.xml | 13 + .../v1/ManagedNotebookServiceClient.java | 913 ++++++++++- .../v1/ManagedNotebookServiceSettings.java | 134 ++ .../notebooks/v1/NotebookServiceClient.java | 589 +++++++ .../notebooks/v1/NotebookServiceSettings.java | 88 ++ .../cloud/notebooks/v1/gapic_metadata.json | 42 + .../stub/GrpcManagedNotebookServiceStub.java | 299 ++++ .../v1/stub/GrpcNotebookServiceStub.java | 211 +++ .../v1/stub/ManagedNotebookServiceStub.java | 66 + .../ManagedNotebookServiceStubSettings.java | 394 ++++- .../v1/stub/NotebookServiceStub.java | 46 + .../v1/stub/NotebookServiceStubSettings.java | 259 ++- .../v1beta1/NotebookServiceClient.java | 469 +++++- .../v1beta1/NotebookServiceSettings.java | 135 +- .../notebooks/v1beta1/gapic_metadata.json | 15 + .../cloud/notebooks/v1beta1/package-info.java | 4 +- .../v1beta1/stub/GrpcNotebookServiceStub.java | 167 ++ .../v1beta1/stub/NotebookServiceStub.java | 41 + .../stub/NotebookServiceStubSettings.java | 244 ++- .../v1/ManagedNotebookServiceClientTest.java | 486 +++++- .../cloud/notebooks/v1/MockIAMPolicy.java | 59 + .../cloud/notebooks/v1/MockIAMPolicyImpl.java | 127 ++ .../cloud/notebooks/v1/MockLocations.java | 59 + .../cloud/notebooks/v1/MockLocationsImpl.java | 105 ++ .../v1/MockManagedNotebookServiceImpl.java | 63 + .../notebooks/v1/MockNotebookServiceImpl.java | 21 + .../v1/NotebookServiceClientTest.java | 425 ++++- .../notebooks/v1beta1/MockIAMPolicy.java | 59 + .../notebooks/v1beta1/MockIAMPolicyImpl.java | 127 ++ .../notebooks/v1beta1/MockLocations.java | 59 + .../notebooks/v1beta1/MockLocationsImpl.java | 105 ++ .../v1beta1/NotebookServiceClientTest.java | 296 +++- .../v1/ManagedNotebookServiceGrpc.java | 352 ++++- .../notebooks/v1/NotebookServiceGrpc.java | 140 +- .../v1beta1/NotebookServiceGrpc.java | 24 + .../notebooks/v1/DiagnoseInstanceRequest.java | 930 +++++++++++ .../v1/DiagnoseInstanceRequestOrBuilder.java | 97 ++ .../notebooks/v1/DiagnoseRuntimeRequest.java | 929 +++++++++++ .../v1/DiagnoseRuntimeRequestOrBuilder.java | 97 ++ .../cloud/notebooks/v1/DiagnosticConfig.java | 1156 ++++++++++++++ .../v1/DiagnosticConfigOrBuilder.java | 140 ++ .../notebooks/v1/DiagnosticConfigProto.java | 82 + .../notebooks/v1/ManagedNotebooksProto.java | 268 ++-- .../cloud/notebooks/v1/NotebooksProto.java | 675 ++++---- .../v1/RuntimeAcceleratorConfig.java | 7 +- .../cloud/notebooks/v1/RuntimeProto.java | 204 +-- .../notebooks/v1/RuntimeSoftwareConfig.java | 692 ++++++++ .../v1/RuntimeSoftwareConfigOrBuilder.java | 94 ++ .../notebooks/v1/UpdateRuntimeRequest.java | 1404 +++++++++++++++++ .../v1/UpdateRuntimeRequestOrBuilder.java | 183 +++ .../notebooks/v1/UpgradeRuntimeRequest.java | 804 ++++++++++ .../v1/UpgradeRuntimeRequestOrBuilder.java | 77 + .../notebooks/v1/VirtualMachineConfig.java | 28 +- .../v1/VirtualMachineConfigOrBuilder.java | 8 +- .../notebooks/v1/diagnostic_config.proto | 57 + .../cloud/notebooks/v1/managed_service.proto | 102 ++ .../google/cloud/notebooks/v1/runtime.proto | 28 +- .../google/cloud/notebooks/v1/service.proto | 29 + .../v1beta1/CreateEnvironmentRequest.java | 56 +- .../CreateEnvironmentRequestOrBuilder.java | 16 +- .../cloud/notebooks/v1beta1/Instance.java | 1138 ++++++++++--- .../notebooks/v1beta1/InstanceOrBuilder.java | 184 ++- .../notebooks/v1beta1/InstanceProto.java | 150 +- .../IsInstanceUpgradeableResponse.java | 192 +++ ...sInstanceUpgradeableResponseOrBuilder.java | 29 + .../notebooks/v1beta1/NotebooksProto.java | 268 ++-- .../notebooks/v1beta1/OperationMetadata.java | 12 +- .../v1beta1/OperationMetadataOrBuilder.java | 3 +- .../v1beta1/ReservationAffinity.java | 1246 +++++++++++++++ .../v1beta1/ReservationAffinityOrBuilder.java | 130 ++ .../SetInstanceAcceleratorRequest.java | 32 +- ...etInstanceAcceleratorRequestOrBuilder.java | 8 +- .../cloud/notebooks/v1beta1/environment.proto | 8 +- .../cloud/notebooks/v1beta1/instance.proto | 156 +- .../cloud/notebooks/v1beta1/service.proto | 86 +- .../diagnoseruntime/AsyncDiagnoseRuntime.java | 53 + .../AsyncDiagnoseRuntimeLRO.java | 54 + .../diagnoseruntime/SyncDiagnoseRuntime.java | 49 + ...oseRuntimeRuntimenameDiagnosticconfig.java | 46 + ...DiagnoseRuntimeStringDiagnosticconfig.java | 46 + .../getiampolicy/AsyncGetIamPolicy.java | 53 + .../getiampolicy/SyncGetIamPolicy.java | 49 + .../getlocation/AsyncGetLocation.java | 47 + .../getlocation/SyncGetLocation.java | 43 + .../listlocations/AsyncListLocations.java | 55 + .../AsyncListLocationsPaged.java | 63 + .../listlocations/SyncListLocations.java | 51 + .../setiampolicy/AsyncSetIamPolicy.java | 54 + .../setiampolicy/SyncSetIamPolicy.java | 50 + .../AsyncTestIamPermissions.java | 53 + .../SyncTestIamPermissions.java | 50 + .../updateruntime/AsyncUpdateRuntime.java | 54 + .../updateruntime/AsyncUpdateRuntimeLRO.java | 54 + .../updateruntime/SyncUpdateRuntime.java | 49 + .../SyncUpdateRuntimeRuntimeFieldmask.java | 44 + .../upgraderuntime/AsyncUpgradeRuntime.java | 51 + .../AsyncUpgradeRuntimeLRO.java | 52 + .../upgraderuntime/SyncUpgradeRuntime.java | 47 + .../SyncUpgradeRuntimeString.java | 42 + .../AsyncDiagnoseInstance.java | 52 + .../AsyncDiagnoseInstanceLRO.java | 53 + .../SyncDiagnoseInstance.java | 48 + ...eInstanceInstancenameDiagnosticconfig.java | 44 + ...iagnoseInstanceStringDiagnosticconfig.java | 44 + .../getiampolicy/AsyncGetIamPolicy.java | 51 + .../getiampolicy/SyncGetIamPolicy.java | 48 + .../getlocation/AsyncGetLocation.java | 45 + .../getlocation/SyncGetLocation.java | 42 + .../listlocations/AsyncListLocations.java | 54 + .../AsyncListLocationsPaged.java | 62 + .../listlocations/SyncListLocations.java | 50 + .../setiampolicy/AsyncSetIamPolicy.java | 52 + .../setiampolicy/SyncSetIamPolicy.java | 49 + .../AsyncTestIamPermissions.java | 52 + .../SyncTestIamPermissions.java | 48 + .../getiampolicy/AsyncGetIamPolicy.java | 50 + .../getiampolicy/SyncGetIamPolicy.java | 47 + .../getlocation/AsyncGetLocation.java | 45 + .../getlocation/SyncGetLocation.java | 42 + .../listlocations/AsyncListLocations.java | 54 + .../AsyncListLocationsPaged.java | 62 + .../listlocations/SyncListLocations.java | 50 + .../setiampolicy/AsyncSetIamPolicy.java | 51 + .../setiampolicy/SyncSetIamPolicy.java | 48 + .../AsyncTestIamPermissions.java | 51 + .../SyncTestIamPermissions.java | 47 + 127 files changed, 19789 insertions(+), 1234 deletions(-) create mode 100644 java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockIAMPolicy.java create mode 100644 java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockIAMPolicyImpl.java create mode 100644 java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockLocations.java create mode 100644 java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockLocationsImpl.java create mode 100644 java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockIAMPolicy.java create mode 100644 java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockIAMPolicyImpl.java create mode 100644 java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockLocations.java create mode 100644 java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockLocationsImpl.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseInstanceRequest.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseInstanceRequestOrBuilder.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseRuntimeRequest.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseRuntimeRequestOrBuilder.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfig.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfigOrBuilder.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfigProto.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpdateRuntimeRequest.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpdateRuntimeRequestOrBuilder.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpgradeRuntimeRequest.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpgradeRuntimeRequestOrBuilder.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/diagnostic_config.proto create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/ReservationAffinity.java create mode 100644 java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/ReservationAffinityOrBuilder.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/AsyncDiagnoseRuntime.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/AsyncDiagnoseRuntimeLRO.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntime.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntimeRuntimenameDiagnosticconfig.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntimeStringDiagnosticconfig.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getiampolicy/AsyncGetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getiampolicy/SyncGetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getlocation/AsyncGetLocation.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getlocation/SyncGetLocation.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/AsyncListLocations.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/AsyncListLocationsPaged.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/SyncListLocations.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/setiampolicy/AsyncSetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/setiampolicy/SyncSetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/testiampermissions/AsyncTestIamPermissions.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/testiampermissions/SyncTestIamPermissions.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/AsyncUpdateRuntime.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/AsyncUpdateRuntimeLRO.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/SyncUpdateRuntime.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/SyncUpdateRuntimeRuntimeFieldmask.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/AsyncUpgradeRuntime.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/AsyncUpgradeRuntimeLRO.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/SyncUpgradeRuntime.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/SyncUpgradeRuntimeString.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/AsyncDiagnoseInstance.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/AsyncDiagnoseInstanceLRO.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstance.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstanceInstancenameDiagnosticconfig.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstanceStringDiagnosticconfig.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getiampolicy/AsyncGetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getiampolicy/SyncGetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getlocation/AsyncGetLocation.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getlocation/SyncGetLocation.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/AsyncListLocations.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/AsyncListLocationsPaged.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/SyncListLocations.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/setiampolicy/AsyncSetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/setiampolicy/SyncSetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/testiampermissions/AsyncTestIamPermissions.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/testiampermissions/SyncTestIamPermissions.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getiampolicy/AsyncGetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getiampolicy/SyncGetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getlocation/AsyncGetLocation.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getlocation/SyncGetLocation.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/AsyncListLocations.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/AsyncListLocationsPaged.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/SyncListLocations.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/setiampolicy/AsyncSetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/setiampolicy/SyncSetIamPolicy.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/testiampermissions/AsyncTestIamPermissions.java create mode 100644 java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/testiampermissions/SyncTestIamPermissions.java diff --git a/java-notebooks/README.md b/java-notebooks/README.md index c42cbe04acb1..0dbf31e45549 100644 --- a/java-notebooks/README.md +++ b/java-notebooks/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-notebooks - 1.3.0 + 1.4.0 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-notebooks:1.3.0' +implementation 'com.google.cloud:google-cloud-notebooks:1.4.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-notebooks" % "1.3.0" +libraryDependencies += "com.google.cloud" % "google-cloud-notebooks" % "1.4.0" ``` ## Authentication @@ -159,16 +159,16 @@ Java is a registered trademark of Oracle and/or its affiliates. [product-docs]: https://cloud.google.com/ai-platform-notebooks [javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-notebooks/latest/overview -[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-notebooks/java7.svg -[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-notebooks/java7.html -[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-notebooks/java8.svg -[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-notebooks/java8.html -[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-notebooks/java8-osx.svg -[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-notebooks/java8-osx.html -[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-notebooks/java8-win.svg -[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-notebooks/java8-win.html -[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-notebooks/java11.svg -[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-notebooks/java11.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-notebooks.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-notebooks&core=gav @@ -180,9 +180,9 @@ Java is a registered trademark of Oracle and/or its affiliates. [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects [cloud-sdk]: https://cloud.google.com/sdk/ [troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting -[contributing]: https://github.com/googleapis/java-notebooks/blob/main/CONTRIBUTING.md -[code-of-conduct]: https://github.com/googleapis/java-notebooks/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct -[license]: https://github.com/googleapis/java-notebooks/blob/main/LICENSE +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE [enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=notebooks.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM diff --git a/java-notebooks/google-cloud-notebooks/pom.xml b/java-notebooks/google-cloud-notebooks/pom.xml index 678169d48ccf..53be7d899ef9 100644 --- a/java-notebooks/google-cloud-notebooks/pom.xml +++ b/java-notebooks/google-cloud-notebooks/pom.xml @@ -87,6 +87,14 @@ grpc-google-cloud-notebooks-v1 test + + com.google.api.grpc + grpc-google-iam-v1 + + + com.google.api.grpc + proto-google-iam-v1 + com.google.api @@ -94,5 +102,10 @@ testlib test + + com.google.api.grpc + grpc-google-common-protos + test + diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceClient.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceClient.java index 185157a74f33..0e01598c553d 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceClient.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceClient.java @@ -26,12 +26,22 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1.stub.ManagedNotebookServiceStub; import com.google.cloud.notebooks.v1.stub.ManagedNotebookServiceStubSettings; import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; @@ -635,6 +645,141 @@ public final UnaryCallable createRuntimeCallabl return stub.createRuntimeCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update Notebook Runtime configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   Runtime runtime = Runtime.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Runtime response = managedNotebookServiceClient.updateRuntimeAsync(runtime, updateMask).get();
+   * }
+   * }
+ * + * @param runtime Required. The Runtime to be updated. + * @param updateMask Required. Specifies the path, relative to `Runtime`, of the field to update. + * For example, to change the software configuration kernels, the `update_mask` parameter + * would be specified as `software_config.kernels`, and the `PATCH` request body would specify + * the new value, as follows: + *

{ "software_config":{ "kernels": [{ 'repository': + * 'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag': 'latest' }], } } + *

Currently, only the following fields can be updated: - software_config.kernels - + * software_config.post_startup_script - software_config.custom_gpu_driver_path - + * software_config.idle_shutdown - software_config.idle_shutdown_timeout - + * software_config.disable_terminal + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateRuntimeAsync( + Runtime runtime, FieldMask updateMask) { + UpdateRuntimeRequest request = + UpdateRuntimeRequest.newBuilder().setRuntime(runtime).setUpdateMask(updateMask).build(); + return updateRuntimeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update Notebook Runtime configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   UpdateRuntimeRequest request =
+   *       UpdateRuntimeRequest.newBuilder()
+   *           .setRuntime(Runtime.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Runtime response = managedNotebookServiceClient.updateRuntimeAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateRuntimeAsync( + UpdateRuntimeRequest request) { + return updateRuntimeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update Notebook Runtime configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   UpdateRuntimeRequest request =
+   *       UpdateRuntimeRequest.newBuilder()
+   *           .setRuntime(Runtime.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       managedNotebookServiceClient.updateRuntimeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Runtime response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateRuntimeOperationCallable() { + return stub.updateRuntimeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update Notebook Runtime configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   UpdateRuntimeRequest request =
+   *       UpdateRuntimeRequest.newBuilder()
+   *           .setRuntime(Runtime.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       managedNotebookServiceClient.updateRuntimeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateRuntimeCallable() { + return stub.updateRuntimeCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a single Runtime. @@ -1286,6 +1431,126 @@ public final UnaryCallable resetRuntimeCallable( return stub.resetRuntimeCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Upgrades a Managed Notebook Runtime to the latest version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   String name = "name3373707";
+   *   Runtime response = managedNotebookServiceClient.upgradeRuntimeAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Format: + * `projects/{project_id}/locations/{location}/runtimes/{runtime_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture upgradeRuntimeAsync(String name) { + UpgradeRuntimeRequest request = UpgradeRuntimeRequest.newBuilder().setName(name).build(); + return upgradeRuntimeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Upgrades a Managed Notebook Runtime to the latest version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   UpgradeRuntimeRequest request =
+   *       UpgradeRuntimeRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Runtime response = managedNotebookServiceClient.upgradeRuntimeAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture upgradeRuntimeAsync( + UpgradeRuntimeRequest request) { + return upgradeRuntimeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Upgrades a Managed Notebook Runtime to the latest version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   UpgradeRuntimeRequest request =
+   *       UpgradeRuntimeRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       managedNotebookServiceClient.upgradeRuntimeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Runtime response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + upgradeRuntimeOperationCallable() { + return stub.upgradeRuntimeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Upgrades a Managed Notebook Runtime to the latest version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   UpgradeRuntimeRequest request =
+   *       UpgradeRuntimeRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       managedNotebookServiceClient.upgradeRuntimeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable upgradeRuntimeCallable() { + return stub.upgradeRuntimeCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Report and process a runtime event. @@ -1581,33 +1846,559 @@ public final RefreshRuntimeTokenInternalResponse refreshRuntimeTokenInternal( return stub.refreshRuntimeTokenInternalCallable(); } - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Diagnostic File and runs Diagnostic Tool given a Runtime. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   RuntimeName name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]");
+   *   DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build();
+   *   Runtime response =
+   *       managedNotebookServiceClient.diagnoseRuntimeAsync(name, diagnosticConfig).get();
+   * }
+   * }
+ * + * @param name Required. Format: + * `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}` + * @param diagnosticConfig Required. Defines flags that are used to run the diagnostic tool + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture diagnoseRuntimeAsync( + RuntimeName name, DiagnosticConfig diagnosticConfig) { + DiagnoseRuntimeRequest request = + DiagnoseRuntimeRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setDiagnosticConfig(diagnosticConfig) + .build(); + return diagnoseRuntimeAsync(request); } - @Override - public void shutdownNow() { - stub.shutdownNow(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Diagnostic File and runs Diagnostic Tool given a Runtime. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   String name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString();
+   *   DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build();
+   *   Runtime response =
+   *       managedNotebookServiceClient.diagnoseRuntimeAsync(name, diagnosticConfig).get();
+   * }
+   * }
+ * + * @param name Required. Format: + * `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}` + * @param diagnosticConfig Required. Defines flags that are used to run the diagnostic tool + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture diagnoseRuntimeAsync( + String name, DiagnosticConfig diagnosticConfig) { + DiagnoseRuntimeRequest request = + DiagnoseRuntimeRequest.newBuilder() + .setName(name) + .setDiagnosticConfig(diagnosticConfig) + .build(); + return diagnoseRuntimeAsync(request); } - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Diagnostic File and runs Diagnostic Tool given a Runtime. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   DiagnoseRuntimeRequest request =
+   *       DiagnoseRuntimeRequest.newBuilder()
+   *           .setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
+   *           .build();
+   *   Runtime response = managedNotebookServiceClient.diagnoseRuntimeAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture diagnoseRuntimeAsync( + DiagnoseRuntimeRequest request) { + return diagnoseRuntimeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Diagnostic File and runs Diagnostic Tool given a Runtime. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   DiagnoseRuntimeRequest request =
+   *       DiagnoseRuntimeRequest.newBuilder()
+   *           .setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       managedNotebookServiceClient.diagnoseRuntimeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Runtime response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + diagnoseRuntimeOperationCallable() { + return stub.diagnoseRuntimeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Diagnostic File and runs Diagnostic Tool given a Runtime. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   DiagnoseRuntimeRequest request =
+   *       DiagnoseRuntimeRequest.newBuilder()
+   *           .setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       managedNotebookServiceClient.diagnoseRuntimeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable diagnoseRuntimeCallable() { + return stub.diagnoseRuntimeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : managedNotebookServiceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       managedNotebookServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         managedNotebookServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = managedNotebookServiceClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       managedNotebookServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = managedNotebookServiceClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       managedNotebookServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = managedNotebookServiceClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       managedNotebookServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response =
+   *       managedNotebookServiceClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ManagedNotebookServiceClient managedNotebookServiceClient =
+   *     ManagedNotebookServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       managedNotebookServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return stub.awaitTermination(duration, unit); } @@ -1685,4 +2476,80 @@ protected ListRuntimesFixedSizeCollection createCollection( return new ListRuntimesFixedSizeCollection(pages, collectionSize); } } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceSettings.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceSettings.java index 708b0b68c007..fb44355234a6 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceSettings.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceSettings.java @@ -16,6 +16,7 @@ package com.google.cloud.notebooks.v1; +import static com.google.cloud.notebooks.v1.ManagedNotebookServiceClient.ListLocationsPagedResponse; import static com.google.cloud.notebooks.v1.ManagedNotebookServiceClient.ListRuntimesPagedResponse; import com.google.api.core.ApiFunction; @@ -30,7 +31,16 @@ import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1.stub.ManagedNotebookServiceStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -101,6 +111,18 @@ public UnaryCallSettings createRuntimeSettings( .createRuntimeOperationSettings(); } + /** Returns the object with the settings used for calls to updateRuntime. */ + public UnaryCallSettings updateRuntimeSettings() { + return ((ManagedNotebookServiceStubSettings) getStubSettings()).updateRuntimeSettings(); + } + + /** Returns the object with the settings used for calls to updateRuntime. */ + public OperationCallSettings + updateRuntimeOperationSettings() { + return ((ManagedNotebookServiceStubSettings) getStubSettings()) + .updateRuntimeOperationSettings(); + } + /** Returns the object with the settings used for calls to deleteRuntime. */ public UnaryCallSettings deleteRuntimeSettings() { return ((ManagedNotebookServiceStubSettings) getStubSettings()).deleteRuntimeSettings(); @@ -158,6 +180,18 @@ public UnaryCallSettings resetRuntimeSettings() return ((ManagedNotebookServiceStubSettings) getStubSettings()).resetRuntimeOperationSettings(); } + /** Returns the object with the settings used for calls to upgradeRuntime. */ + public UnaryCallSettings upgradeRuntimeSettings() { + return ((ManagedNotebookServiceStubSettings) getStubSettings()).upgradeRuntimeSettings(); + } + + /** Returns the object with the settings used for calls to upgradeRuntime. */ + public OperationCallSettings + upgradeRuntimeOperationSettings() { + return ((ManagedNotebookServiceStubSettings) getStubSettings()) + .upgradeRuntimeOperationSettings(); + } + /** Returns the object with the settings used for calls to reportRuntimeEvent. */ public UnaryCallSettings reportRuntimeEventSettings() { return ((ManagedNotebookServiceStubSettings) getStubSettings()).reportRuntimeEventSettings(); @@ -177,6 +211,45 @@ public UnaryCallSettings reportRuntimeEven .refreshRuntimeTokenInternalSettings(); } + /** Returns the object with the settings used for calls to diagnoseRuntime. */ + public UnaryCallSettings diagnoseRuntimeSettings() { + return ((ManagedNotebookServiceStubSettings) getStubSettings()).diagnoseRuntimeSettings(); + } + + /** Returns the object with the settings used for calls to diagnoseRuntime. */ + public OperationCallSettings + diagnoseRuntimeOperationSettings() { + return ((ManagedNotebookServiceStubSettings) getStubSettings()) + .diagnoseRuntimeOperationSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ManagedNotebookServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ManagedNotebookServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ManagedNotebookServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ManagedNotebookServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ManagedNotebookServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + public static final ManagedNotebookServiceSettings create(ManagedNotebookServiceStubSettings stub) throws IOException { return new ManagedNotebookServiceSettings.Builder(stub.toBuilder()).build(); @@ -298,6 +371,17 @@ public UnaryCallSettings.Builder createRuntimeS return getStubSettingsBuilder().createRuntimeOperationSettings(); } + /** Returns the builder for the settings used for calls to updateRuntime. */ + public UnaryCallSettings.Builder updateRuntimeSettings() { + return getStubSettingsBuilder().updateRuntimeSettings(); + } + + /** Returns the builder for the settings used for calls to updateRuntime. */ + public OperationCallSettings.Builder + updateRuntimeOperationSettings() { + return getStubSettingsBuilder().updateRuntimeOperationSettings(); + } + /** Returns the builder for the settings used for calls to deleteRuntime. */ public UnaryCallSettings.Builder deleteRuntimeSettings() { return getStubSettingsBuilder().deleteRuntimeSettings(); @@ -353,6 +437,17 @@ public UnaryCallSettings.Builder resetRuntimeSet return getStubSettingsBuilder().resetRuntimeOperationSettings(); } + /** Returns the builder for the settings used for calls to upgradeRuntime. */ + public UnaryCallSettings.Builder upgradeRuntimeSettings() { + return getStubSettingsBuilder().upgradeRuntimeSettings(); + } + + /** Returns the builder for the settings used for calls to upgradeRuntime. */ + public OperationCallSettings.Builder + upgradeRuntimeOperationSettings() { + return getStubSettingsBuilder().upgradeRuntimeOperationSettings(); + } + /** Returns the builder for the settings used for calls to reportRuntimeEvent. */ public UnaryCallSettings.Builder reportRuntimeEventSettings() { @@ -372,6 +467,45 @@ public UnaryCallSettings.Builder resetRuntimeSet return getStubSettingsBuilder().refreshRuntimeTokenInternalSettings(); } + /** Returns the builder for the settings used for calls to diagnoseRuntime. */ + public UnaryCallSettings.Builder diagnoseRuntimeSettings() { + return getStubSettingsBuilder().diagnoseRuntimeSettings(); + } + + /** Returns the builder for the settings used for calls to diagnoseRuntime. */ + public OperationCallSettings.Builder + diagnoseRuntimeOperationSettings() { + return getStubSettingsBuilder().diagnoseRuntimeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + @Override public ManagedNotebookServiceSettings build() throws IOException { return new ManagedNotebookServiceSettings(this); diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceClient.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceClient.java index 5f678a57aa9c..4e81c06400ba 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceClient.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceClient.java @@ -26,9 +26,18 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1.stub.NotebookServiceStub; import com.google.cloud.notebooks.v1.stub.NotebookServiceStubSettings; import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; @@ -1913,6 +1922,163 @@ public final UnaryCallable rollbackInstanceC return stub.rollbackInstanceCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Diagnostic File and runs Diagnostic Tool given an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build();
+   *   Instance response = notebookServiceClient.diagnoseInstanceAsync(name, diagnosticConfig).get();
+   * }
+   * }
+ * + * @param name Required. Format: + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * @param diagnosticConfig Required. Defines flags that are used to run the diagnostic tool + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture diagnoseInstanceAsync( + InstanceName name, DiagnosticConfig diagnosticConfig) { + DiagnoseInstanceRequest request = + DiagnoseInstanceRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setDiagnosticConfig(diagnosticConfig) + .build(); + return diagnoseInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Diagnostic File and runs Diagnostic Tool given an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build();
+   *   Instance response = notebookServiceClient.diagnoseInstanceAsync(name, diagnosticConfig).get();
+   * }
+   * }
+ * + * @param name Required. Format: + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * @param diagnosticConfig Required. Defines flags that are used to run the diagnostic tool + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture diagnoseInstanceAsync( + String name, DiagnosticConfig diagnosticConfig) { + DiagnoseInstanceRequest request = + DiagnoseInstanceRequest.newBuilder() + .setName(name) + .setDiagnosticConfig(diagnosticConfig) + .build(); + return diagnoseInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Diagnostic File and runs Diagnostic Tool given an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   DiagnoseInstanceRequest request =
+   *       DiagnoseInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
+   *           .build();
+   *   Instance response = notebookServiceClient.diagnoseInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture diagnoseInstanceAsync( + DiagnoseInstanceRequest request) { + return diagnoseInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Diagnostic File and runs Diagnostic Tool given an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   DiagnoseInstanceRequest request =
+   *       DiagnoseInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       notebookServiceClient.diagnoseInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + diagnoseInstanceOperationCallable() { + return stub.diagnoseInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Diagnostic File and runs Diagnostic Tool given an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   DiagnoseInstanceRequest request =
+   *       DiagnoseInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       notebookServiceClient.diagnoseInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable diagnoseInstanceCallable() { + return stub.diagnoseInstanceCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method @@ -3721,6 +3887,353 @@ public final UnaryCallable createExecutionCal return stub.createExecutionCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : notebookServiceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       notebookServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         notebookServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = notebookServiceClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = notebookServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = notebookServiceClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = notebookServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = notebookServiceClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = notebookServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = notebookServiceClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       notebookServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + @Override public final void close() { stub.close(); @@ -4055,4 +4568,80 @@ protected ListExecutionsFixedSizeCollection createCollection( return new ListExecutionsFixedSizeCollection(pages, collectionSize); } } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceSettings.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceSettings.java index e151f487f165..ef04bd546c02 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceSettings.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceSettings.java @@ -19,6 +19,7 @@ import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListEnvironmentsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListExecutionsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListInstancesPagedResponse; +import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListLocationsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListSchedulesPagedResponse; import com.google.api.core.ApiFunction; @@ -33,7 +34,16 @@ import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1.stub.NotebookServiceStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -267,6 +277,17 @@ public UnaryCallSettings rollbackInstanceSet return ((NotebookServiceStubSettings) getStubSettings()).rollbackInstanceOperationSettings(); } + /** Returns the object with the settings used for calls to diagnoseInstance. */ + public UnaryCallSettings diagnoseInstanceSettings() { + return ((NotebookServiceStubSettings) getStubSettings()).diagnoseInstanceSettings(); + } + + /** Returns the object with the settings used for calls to diagnoseInstance. */ + public OperationCallSettings + diagnoseInstanceOperationSettings() { + return ((NotebookServiceStubSettings) getStubSettings()).diagnoseInstanceOperationSettings(); + } + /** Returns the object with the settings used for calls to upgradeInstanceInternal. */ public UnaryCallSettings upgradeInstanceInternalSettings() { @@ -392,6 +413,33 @@ public UnaryCallSettings createExecutionSetti return ((NotebookServiceStubSettings) getStubSettings()).createExecutionOperationSettings(); } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((NotebookServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((NotebookServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((NotebookServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((NotebookServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((NotebookServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + public static final NotebookServiceSettings create(NotebookServiceStubSettings stub) throws IOException { return new NotebookServiceSettings.Builder(stub.toBuilder()).build(); @@ -683,6 +731,18 @@ public UnaryCallSettings.Builder upgradeInsta return getStubSettingsBuilder().rollbackInstanceOperationSettings(); } + /** Returns the builder for the settings used for calls to diagnoseInstance. */ + public UnaryCallSettings.Builder + diagnoseInstanceSettings() { + return getStubSettingsBuilder().diagnoseInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to diagnoseInstance. */ + public OperationCallSettings.Builder + diagnoseInstanceOperationSettings() { + return getStubSettingsBuilder().diagnoseInstanceOperationSettings(); + } + /** Returns the builder for the settings used for calls to upgradeInstanceInternal. */ public UnaryCallSettings.Builder upgradeInstanceInternalSettings() { @@ -811,6 +871,34 @@ public UnaryCallSettings.Builder createExecut return getStubSettingsBuilder().createExecutionOperationSettings(); } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + @Override public NotebookServiceSettings build() throws IOException { return new NotebookServiceSettings(this); diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/gapic_metadata.json b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/gapic_metadata.json index 3591664be2d9..1b0c750ab7f5 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/gapic_metadata.json +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/gapic_metadata.json @@ -16,9 +16,21 @@ "DeleteRuntime": { "methods": ["deleteRuntimeAsync", "deleteRuntimeAsync", "deleteRuntimeAsync", "deleteRuntimeOperationCallable", "deleteRuntimeCallable"] }, + "DiagnoseRuntime": { + "methods": ["diagnoseRuntimeAsync", "diagnoseRuntimeAsync", "diagnoseRuntimeAsync", "diagnoseRuntimeOperationCallable", "diagnoseRuntimeCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "GetRuntime": { "methods": ["getRuntime", "getRuntime", "getRuntime", "getRuntimeCallable"] }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, "ListRuntimes": { "methods": ["listRuntimes", "listRuntimes", "listRuntimes", "listRuntimesPagedCallable", "listRuntimesCallable"] }, @@ -31,6 +43,9 @@ "ResetRuntime": { "methods": ["resetRuntimeAsync", "resetRuntimeAsync", "resetRuntimeOperationCallable", "resetRuntimeCallable"] }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, "StartRuntime": { "methods": ["startRuntimeAsync", "startRuntimeAsync", "startRuntimeOperationCallable", "startRuntimeCallable"] }, @@ -39,6 +54,15 @@ }, "SwitchRuntime": { "methods": ["switchRuntimeAsync", "switchRuntimeAsync", "switchRuntimeOperationCallable", "switchRuntimeCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateRuntime": { + "methods": ["updateRuntimeAsync", "updateRuntimeAsync", "updateRuntimeOperationCallable", "updateRuntimeCallable"] + }, + "UpgradeRuntime": { + "methods": ["upgradeRuntimeAsync", "upgradeRuntimeAsync", "upgradeRuntimeOperationCallable", "upgradeRuntimeCallable"] } } } @@ -73,18 +97,27 @@ "DeleteSchedule": { "methods": ["deleteScheduleAsync", "deleteScheduleAsync", "deleteScheduleAsync", "deleteScheduleOperationCallable", "deleteScheduleCallable"] }, + "DiagnoseInstance": { + "methods": ["diagnoseInstanceAsync", "diagnoseInstanceAsync", "diagnoseInstanceAsync", "diagnoseInstanceOperationCallable", "diagnoseInstanceCallable"] + }, "GetEnvironment": { "methods": ["getEnvironment", "getEnvironment", "getEnvironmentCallable"] }, "GetExecution": { "methods": ["getExecution", "getExecution", "getExecution", "getExecutionCallable"] }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, "GetInstance": { "methods": ["getInstance", "getInstance", "getInstanceCallable"] }, "GetInstanceHealth": { "methods": ["getInstanceHealth", "getInstanceHealth", "getInstanceHealth", "getInstanceHealthCallable"] }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "GetSchedule": { "methods": ["getSchedule", "getSchedule", "getSchedule", "getScheduleCallable"] }, @@ -100,6 +133,9 @@ "ListInstances": { "methods": ["listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"] }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, "ListSchedules": { "methods": ["listSchedules", "listSchedules", "listSchedules", "listSchedulesPagedCallable", "listSchedulesCallable"] }, @@ -115,6 +151,9 @@ "RollbackInstance": { "methods": ["rollbackInstanceAsync", "rollbackInstanceOperationCallable", "rollbackInstanceCallable"] }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, "SetInstanceAccelerator": { "methods": ["setInstanceAcceleratorAsync", "setInstanceAcceleratorOperationCallable", "setInstanceAcceleratorCallable"] }, @@ -130,6 +169,9 @@ "StopInstance": { "methods": ["stopInstanceAsync", "stopInstanceOperationCallable", "stopInstanceCallable"] }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, "TriggerSchedule": { "methods": ["triggerScheduleAsync", "triggerScheduleOperationCallable", "triggerScheduleCallable"] }, diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/GrpcManagedNotebookServiceStub.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/GrpcManagedNotebookServiceStub.java index 04c25f494d88..f7101b93a067 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/GrpcManagedNotebookServiceStub.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/GrpcManagedNotebookServiceStub.java @@ -16,6 +16,7 @@ package com.google.cloud.notebooks.v1.stub; +import static com.google.cloud.notebooks.v1.ManagedNotebookServiceClient.ListLocationsPagedResponse; import static com.google.cloud.notebooks.v1.ManagedNotebookServiceClient.ListRuntimesPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -25,8 +26,13 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1.CreateRuntimeRequest; import com.google.cloud.notebooks.v1.DeleteRuntimeRequest; +import com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest; import com.google.cloud.notebooks.v1.GetRuntimeRequest; import com.google.cloud.notebooks.v1.ListRuntimesRequest; import com.google.cloud.notebooks.v1.ListRuntimesResponse; @@ -39,7 +45,14 @@ import com.google.cloud.notebooks.v1.StartRuntimeRequest; import com.google.cloud.notebooks.v1.StopRuntimeRequest; import com.google.cloud.notebooks.v1.SwitchRuntimeRequest; +import com.google.cloud.notebooks.v1.UpdateRuntimeRequest; +import com.google.cloud.notebooks.v1.UpgradeRuntimeRequest; import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; @@ -85,6 +98,16 @@ public class GrpcManagedNotebookServiceStub extends ManagedNotebookServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + updateRuntimeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.notebooks.v1.ManagedNotebookService/UpdateRuntime") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateRuntimeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteRuntimeMethodDescriptor = MethodDescriptor.newBuilder() @@ -131,6 +154,16 @@ public class GrpcManagedNotebookServiceStub extends ManagedNotebookServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + upgradeRuntimeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.notebooks.v1.ManagedNotebookService/UpgradeRuntime") + .setRequestMarshaller( + ProtoUtils.marshaller(UpgradeRuntimeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor reportRuntimeEventMethodDescriptor = MethodDescriptor.newBuilder() @@ -156,6 +189,62 @@ public class GrpcManagedNotebookServiceStub extends ManagedNotebookServiceStub { ProtoUtils.marshaller(RefreshRuntimeTokenInternalResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + diagnoseRuntimeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.notebooks.v1.ManagedNotebookService/DiagnoseRuntime") + .setRequestMarshaller( + ProtoUtils.marshaller(DiagnoseRuntimeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + private final UnaryCallable listRuntimesCallable; private final UnaryCallable listRuntimesPagedCallable; @@ -163,6 +252,9 @@ public class GrpcManagedNotebookServiceStub extends ManagedNotebookServiceStub { private final UnaryCallable createRuntimeCallable; private final OperationCallable createRuntimeOperationCallable; + private final UnaryCallable updateRuntimeCallable; + private final OperationCallable + updateRuntimeOperationCallable; private final UnaryCallable deleteRuntimeCallable; private final OperationCallable deleteRuntimeOperationCallable; @@ -178,12 +270,26 @@ public class GrpcManagedNotebookServiceStub extends ManagedNotebookServiceStub { private final UnaryCallable resetRuntimeCallable; private final OperationCallable resetRuntimeOperationCallable; + private final UnaryCallable upgradeRuntimeCallable; + private final OperationCallable + upgradeRuntimeOperationCallable; private final UnaryCallable reportRuntimeEventCallable; private final OperationCallable reportRuntimeEventOperationCallable; private final UnaryCallable< RefreshRuntimeTokenInternalRequest, RefreshRuntimeTokenInternalResponse> refreshRuntimeTokenInternalCallable; + private final UnaryCallable diagnoseRuntimeCallable; + private final OperationCallable + diagnoseRuntimeOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -259,6 +365,16 @@ protected GrpcManagedNotebookServiceStub( return params.build(); }) .build(); + GrpcCallSettings updateRuntimeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateRuntimeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("runtime.name", String.valueOf(request.getRuntime().getName())); + return params.build(); + }) + .build(); GrpcCallSettings deleteRuntimeTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteRuntimeMethodDescriptor) @@ -309,6 +425,16 @@ protected GrpcManagedNotebookServiceStub( return params.build(); }) .build(); + GrpcCallSettings upgradeRuntimeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(upgradeRuntimeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); GrpcCallSettings reportRuntimeEventTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(reportRuntimeEventMethodDescriptor) @@ -332,6 +458,67 @@ protected GrpcManagedNotebookServiceStub( return params.build(); }) .build(); + GrpcCallSettings diagnoseRuntimeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(diagnoseRuntimeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); this.listRuntimesCallable = callableFactory.createUnaryCallable( @@ -351,6 +538,15 @@ protected GrpcManagedNotebookServiceStub( settings.createRuntimeOperationSettings(), clientContext, operationsStub); + this.updateRuntimeCallable = + callableFactory.createUnaryCallable( + updateRuntimeTransportSettings, settings.updateRuntimeSettings(), clientContext); + this.updateRuntimeOperationCallable = + callableFactory.createOperationCallable( + updateRuntimeTransportSettings, + settings.updateRuntimeOperationSettings(), + clientContext, + operationsStub); this.deleteRuntimeCallable = callableFactory.createUnaryCallable( deleteRuntimeTransportSettings, settings.deleteRuntimeSettings(), clientContext); @@ -396,6 +592,15 @@ protected GrpcManagedNotebookServiceStub( settings.resetRuntimeOperationSettings(), clientContext, operationsStub); + this.upgradeRuntimeCallable = + callableFactory.createUnaryCallable( + upgradeRuntimeTransportSettings, settings.upgradeRuntimeSettings(), clientContext); + this.upgradeRuntimeOperationCallable = + callableFactory.createOperationCallable( + upgradeRuntimeTransportSettings, + settings.upgradeRuntimeOperationSettings(), + clientContext, + operationsStub); this.reportRuntimeEventCallable = callableFactory.createUnaryCallable( reportRuntimeEventTransportSettings, @@ -412,6 +617,35 @@ protected GrpcManagedNotebookServiceStub( refreshRuntimeTokenInternalTransportSettings, settings.refreshRuntimeTokenInternalSettings(), clientContext); + this.diagnoseRuntimeCallable = + callableFactory.createUnaryCallable( + diagnoseRuntimeTransportSettings, settings.diagnoseRuntimeSettings(), clientContext); + this.diagnoseRuntimeOperationCallable = + callableFactory.createOperationCallable( + diagnoseRuntimeTransportSettings, + settings.diagnoseRuntimeOperationSettings(), + clientContext, + operationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -447,6 +681,17 @@ public UnaryCallable createRuntimeCallable() { return createRuntimeOperationCallable; } + @Override + public UnaryCallable updateRuntimeCallable() { + return updateRuntimeCallable; + } + + @Override + public OperationCallable + updateRuntimeOperationCallable() { + return updateRuntimeOperationCallable; + } + @Override public UnaryCallable deleteRuntimeCallable() { return deleteRuntimeCallable; @@ -502,6 +747,17 @@ public UnaryCallable resetRuntimeCallable() { return resetRuntimeOperationCallable; } + @Override + public UnaryCallable upgradeRuntimeCallable() { + return upgradeRuntimeCallable; + } + + @Override + public OperationCallable + upgradeRuntimeOperationCallable() { + return upgradeRuntimeOperationCallable; + } + @Override public UnaryCallable reportRuntimeEventCallable() { return reportRuntimeEventCallable; @@ -519,6 +775,49 @@ public UnaryCallable reportRuntimeEventCal return refreshRuntimeTokenInternalCallable; } + @Override + public UnaryCallable diagnoseRuntimeCallable() { + return diagnoseRuntimeCallable; + } + + @Override + public OperationCallable + diagnoseRuntimeOperationCallable() { + return diagnoseRuntimeOperationCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + @Override public final void close() { try { diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/GrpcNotebookServiceStub.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/GrpcNotebookServiceStub.java index cb89e6fa1196..861a0c09eae9 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/GrpcNotebookServiceStub.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/GrpcNotebookServiceStub.java @@ -19,6 +19,7 @@ import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListEnvironmentsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListExecutionsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListInstancesPagedResponse; +import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListLocationsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListSchedulesPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -28,6 +29,10 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1.CreateEnvironmentRequest; import com.google.cloud.notebooks.v1.CreateExecutionRequest; import com.google.cloud.notebooks.v1.CreateInstanceRequest; @@ -36,6 +41,7 @@ import com.google.cloud.notebooks.v1.DeleteExecutionRequest; import com.google.cloud.notebooks.v1.DeleteInstanceRequest; import com.google.cloud.notebooks.v1.DeleteScheduleRequest; +import com.google.cloud.notebooks.v1.DiagnoseInstanceRequest; import com.google.cloud.notebooks.v1.Environment; import com.google.cloud.notebooks.v1.Execution; import com.google.cloud.notebooks.v1.GetEnvironmentRequest; @@ -74,6 +80,11 @@ import com.google.cloud.notebooks.v1.UpgradeInstanceInternalRequest; import com.google.cloud.notebooks.v1.UpgradeInstanceRequest; import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; @@ -286,6 +297,16 @@ public class GrpcNotebookServiceStub extends NotebookServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + diagnoseInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.notebooks.v1.NotebookService/DiagnoseInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(DiagnoseInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor upgradeInstanceInternalMethodDescriptor = MethodDescriptor.newBuilder() @@ -427,6 +448,52 @@ public class GrpcNotebookServiceStub extends NotebookServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + private final UnaryCallable listInstancesCallable; private final UnaryCallable listInstancesPagedCallable; @@ -483,6 +550,9 @@ public class GrpcNotebookServiceStub extends NotebookServiceStub { private final UnaryCallable rollbackInstanceCallable; private final OperationCallable rollbackInstanceOperationCallable; + private final UnaryCallable diagnoseInstanceCallable; + private final OperationCallable + diagnoseInstanceOperationCallable; private final UnaryCallable upgradeInstanceInternalCallable; private final OperationCallable @@ -521,6 +591,14 @@ public class GrpcNotebookServiceStub extends NotebookServiceStub { private final UnaryCallable createExecutionCallable; private final OperationCallable createExecutionOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -766,6 +844,16 @@ protected GrpcNotebookServiceStub( return params.build(); }) .build(); + GrpcCallSettings diagnoseInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(diagnoseInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); GrpcCallSettings upgradeInstanceInternalTransportSettings = GrpcCallSettings.newBuilder() @@ -909,6 +997,57 @@ protected GrpcNotebookServiceStub( return params.build(); }) .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); this.listInstancesCallable = callableFactory.createUnaryCallable( @@ -1072,6 +1211,15 @@ protected GrpcNotebookServiceStub( settings.rollbackInstanceOperationSettings(), clientContext, operationsStub); + this.diagnoseInstanceCallable = + callableFactory.createUnaryCallable( + diagnoseInstanceTransportSettings, settings.diagnoseInstanceSettings(), clientContext); + this.diagnoseInstanceOperationCallable = + callableFactory.createOperationCallable( + diagnoseInstanceTransportSettings, + settings.diagnoseInstanceOperationSettings(), + clientContext, + operationsStub); this.upgradeInstanceInternalCallable = callableFactory.createUnaryCallable( upgradeInstanceInternalTransportSettings, @@ -1177,6 +1325,26 @@ protected GrpcNotebookServiceStub( settings.createExecutionOperationSettings(), clientContext, operationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -1375,6 +1543,17 @@ public UnaryCallable rollbackInstanceCallabl return rollbackInstanceOperationCallable; } + @Override + public UnaryCallable diagnoseInstanceCallable() { + return diagnoseInstanceCallable; + } + + @Override + public OperationCallable + diagnoseInstanceOperationCallable() { + return diagnoseInstanceOperationCallable; + } + @Override public UnaryCallable upgradeInstanceInternalCallable() { @@ -1513,6 +1692,38 @@ public UnaryCallable createExecutionCallable( return createExecutionOperationCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + @Override public final void close() { try { diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/ManagedNotebookServiceStub.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/ManagedNotebookServiceStub.java index fdd43cb545be..79ecead02f5d 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/ManagedNotebookServiceStub.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/ManagedNotebookServiceStub.java @@ -16,13 +16,19 @@ package com.google.cloud.notebooks.v1.stub; +import static com.google.cloud.notebooks.v1.ManagedNotebookServiceClient.ListLocationsPagedResponse; import static com.google.cloud.notebooks.v1.ManagedNotebookServiceClient.ListRuntimesPagedResponse; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1.CreateRuntimeRequest; import com.google.cloud.notebooks.v1.DeleteRuntimeRequest; +import com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest; import com.google.cloud.notebooks.v1.GetRuntimeRequest; import com.google.cloud.notebooks.v1.ListRuntimesRequest; import com.google.cloud.notebooks.v1.ListRuntimesResponse; @@ -35,6 +41,13 @@ import com.google.cloud.notebooks.v1.StartRuntimeRequest; import com.google.cloud.notebooks.v1.StopRuntimeRequest; import com.google.cloud.notebooks.v1.SwitchRuntimeRequest; +import com.google.cloud.notebooks.v1.UpdateRuntimeRequest; +import com.google.cloud.notebooks.v1.UpgradeRuntimeRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; @@ -74,6 +87,15 @@ public UnaryCallable createRuntimeCallable() { throw new UnsupportedOperationException("Not implemented: createRuntimeCallable()"); } + public OperationCallable + updateRuntimeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateRuntimeOperationCallable()"); + } + + public UnaryCallable updateRuntimeCallable() { + throw new UnsupportedOperationException("Not implemented: updateRuntimeCallable()"); + } + public OperationCallable deleteRuntimeOperationCallable() { throw new UnsupportedOperationException("Not implemented: deleteRuntimeOperationCallable()"); @@ -119,6 +141,15 @@ public UnaryCallable resetRuntimeCallable() { throw new UnsupportedOperationException("Not implemented: resetRuntimeCallable()"); } + public OperationCallable + upgradeRuntimeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: upgradeRuntimeOperationCallable()"); + } + + public UnaryCallable upgradeRuntimeCallable() { + throw new UnsupportedOperationException("Not implemented: upgradeRuntimeCallable()"); + } + public OperationCallable reportRuntimeEventOperationCallable() { throw new UnsupportedOperationException( @@ -135,6 +166,41 @@ public UnaryCallable reportRuntimeEventCal "Not implemented: refreshRuntimeTokenInternalCallable()"); } + public OperationCallable + diagnoseRuntimeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: diagnoseRuntimeOperationCallable()"); + } + + public UnaryCallable diagnoseRuntimeCallable() { + throw new UnsupportedOperationException("Not implemented: diagnoseRuntimeCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + @Override public abstract void close(); } diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/ManagedNotebookServiceStubSettings.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/ManagedNotebookServiceStubSettings.java index 6082bd82543f..7e1c7d65ec93 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/ManagedNotebookServiceStubSettings.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/ManagedNotebookServiceStubSettings.java @@ -16,6 +16,7 @@ package com.google.cloud.notebooks.v1.stub; +import static com.google.cloud.notebooks.v1.ManagedNotebookServiceClient.ListLocationsPagedResponse; import static com.google.cloud.notebooks.v1.ManagedNotebookServiceClient.ListRuntimesPagedResponse; import com.google.api.core.ApiFunction; @@ -44,8 +45,13 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1.CreateRuntimeRequest; import com.google.cloud.notebooks.v1.DeleteRuntimeRequest; +import com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest; import com.google.cloud.notebooks.v1.GetRuntimeRequest; import com.google.cloud.notebooks.v1.ListRuntimesRequest; import com.google.cloud.notebooks.v1.ListRuntimesResponse; @@ -58,10 +64,17 @@ import com.google.cloud.notebooks.v1.StartRuntimeRequest; import com.google.cloud.notebooks.v1.StopRuntimeRequest; import com.google.cloud.notebooks.v1.SwitchRuntimeRequest; +import com.google.cloud.notebooks.v1.UpdateRuntimeRequest; +import com.google.cloud.notebooks.v1.UpgradeRuntimeRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -121,6 +134,9 @@ public class ManagedNotebookServiceStubSettings private final UnaryCallSettings createRuntimeSettings; private final OperationCallSettings createRuntimeOperationSettings; + private final UnaryCallSettings updateRuntimeSettings; + private final OperationCallSettings + updateRuntimeOperationSettings; private final UnaryCallSettings deleteRuntimeSettings; private final OperationCallSettings deleteRuntimeOperationSettings; @@ -136,12 +152,26 @@ public class ManagedNotebookServiceStubSettings private final UnaryCallSettings resetRuntimeSettings; private final OperationCallSettings resetRuntimeOperationSettings; + private final UnaryCallSettings upgradeRuntimeSettings; + private final OperationCallSettings + upgradeRuntimeOperationSettings; private final UnaryCallSettings reportRuntimeEventSettings; private final OperationCallSettings reportRuntimeEventOperationSettings; private final UnaryCallSettings< RefreshRuntimeTokenInternalRequest, RefreshRuntimeTokenInternalResponse> refreshRuntimeTokenInternalSettings; + private final UnaryCallSettings diagnoseRuntimeSettings; + private final OperationCallSettings + diagnoseRuntimeOperationSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; private static final PagedListDescriptor LIST_RUNTIMES_PAGE_STR_DESC = @@ -179,6 +209,42 @@ public Iterable extractResources(ListRuntimesResponse payload) { } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListRuntimesRequest, ListRuntimesResponse, ListRuntimesPagedResponse> LIST_RUNTIMES_PAGE_STR_FACT = @@ -196,6 +262,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listRuntimes. */ public PagedCallSettings listRuntimesSettings() { @@ -218,6 +301,17 @@ public UnaryCallSettings createRuntimeSettings( return createRuntimeOperationSettings; } + /** Returns the object with the settings used for calls to updateRuntime. */ + public UnaryCallSettings updateRuntimeSettings() { + return updateRuntimeSettings; + } + + /** Returns the object with the settings used for calls to updateRuntime. */ + public OperationCallSettings + updateRuntimeOperationSettings() { + return updateRuntimeOperationSettings; + } + /** Returns the object with the settings used for calls to deleteRuntime. */ public UnaryCallSettings deleteRuntimeSettings() { return deleteRuntimeSettings; @@ -273,6 +367,17 @@ public UnaryCallSettings resetRuntimeSettings() return resetRuntimeOperationSettings; } + /** Returns the object with the settings used for calls to upgradeRuntime. */ + public UnaryCallSettings upgradeRuntimeSettings() { + return upgradeRuntimeSettings; + } + + /** Returns the object with the settings used for calls to upgradeRuntime. */ + public OperationCallSettings + upgradeRuntimeOperationSettings() { + return upgradeRuntimeOperationSettings; + } + /** Returns the object with the settings used for calls to reportRuntimeEvent. */ public UnaryCallSettings reportRuntimeEventSettings() { return reportRuntimeEventSettings; @@ -290,6 +395,44 @@ public UnaryCallSettings reportRuntimeEven return refreshRuntimeTokenInternalSettings; } + /** Returns the object with the settings used for calls to diagnoseRuntime. */ + public UnaryCallSettings diagnoseRuntimeSettings() { + return diagnoseRuntimeSettings; + } + + /** Returns the object with the settings used for calls to diagnoseRuntime. */ + public OperationCallSettings + diagnoseRuntimeOperationSettings() { + return diagnoseRuntimeOperationSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + public ManagedNotebookServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -369,6 +512,8 @@ protected ManagedNotebookServiceStubSettings(Builder settingsBuilder) throws IOE getRuntimeSettings = settingsBuilder.getRuntimeSettings().build(); createRuntimeSettings = settingsBuilder.createRuntimeSettings().build(); createRuntimeOperationSettings = settingsBuilder.createRuntimeOperationSettings().build(); + updateRuntimeSettings = settingsBuilder.updateRuntimeSettings().build(); + updateRuntimeOperationSettings = settingsBuilder.updateRuntimeOperationSettings().build(); deleteRuntimeSettings = settingsBuilder.deleteRuntimeSettings().build(); deleteRuntimeOperationSettings = settingsBuilder.deleteRuntimeOperationSettings().build(); startRuntimeSettings = settingsBuilder.startRuntimeSettings().build(); @@ -379,11 +524,20 @@ protected ManagedNotebookServiceStubSettings(Builder settingsBuilder) throws IOE switchRuntimeOperationSettings = settingsBuilder.switchRuntimeOperationSettings().build(); resetRuntimeSettings = settingsBuilder.resetRuntimeSettings().build(); resetRuntimeOperationSettings = settingsBuilder.resetRuntimeOperationSettings().build(); + upgradeRuntimeSettings = settingsBuilder.upgradeRuntimeSettings().build(); + upgradeRuntimeOperationSettings = settingsBuilder.upgradeRuntimeOperationSettings().build(); reportRuntimeEventSettings = settingsBuilder.reportRuntimeEventSettings().build(); reportRuntimeEventOperationSettings = settingsBuilder.reportRuntimeEventOperationSettings().build(); refreshRuntimeTokenInternalSettings = settingsBuilder.refreshRuntimeTokenInternalSettings().build(); + diagnoseRuntimeSettings = settingsBuilder.diagnoseRuntimeSettings().build(); + diagnoseRuntimeOperationSettings = settingsBuilder.diagnoseRuntimeOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } /** Builder for ManagedNotebookServiceStubSettings. */ @@ -397,6 +551,9 @@ public static class Builder private final UnaryCallSettings.Builder createRuntimeSettings; private final OperationCallSettings.Builder createRuntimeOperationSettings; + private final UnaryCallSettings.Builder updateRuntimeSettings; + private final OperationCallSettings.Builder + updateRuntimeOperationSettings; private final UnaryCallSettings.Builder deleteRuntimeSettings; private final OperationCallSettings.Builder deleteRuntimeOperationSettings; @@ -412,6 +569,10 @@ public static class Builder private final UnaryCallSettings.Builder resetRuntimeSettings; private final OperationCallSettings.Builder resetRuntimeOperationSettings; + private final UnaryCallSettings.Builder + upgradeRuntimeSettings; + private final OperationCallSettings.Builder + upgradeRuntimeOperationSettings; private final UnaryCallSettings.Builder reportRuntimeEventSettings; private final OperationCallSettings.Builder< @@ -420,6 +581,18 @@ public static class Builder private final UnaryCallSettings.Builder< RefreshRuntimeTokenInternalRequest, RefreshRuntimeTokenInternalResponse> refreshRuntimeTokenInternalSettings; + private final UnaryCallSettings.Builder + diagnoseRuntimeSettings; + private final OperationCallSettings.Builder + diagnoseRuntimeOperationSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -472,6 +645,8 @@ protected Builder(ClientContext clientContext) { getRuntimeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createRuntimeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createRuntimeOperationSettings = OperationCallSettings.newBuilder(); + updateRuntimeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateRuntimeOperationSettings = OperationCallSettings.newBuilder(); deleteRuntimeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteRuntimeOperationSettings = OperationCallSettings.newBuilder(); startRuntimeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -482,22 +657,39 @@ protected Builder(ClientContext clientContext) { switchRuntimeOperationSettings = OperationCallSettings.newBuilder(); resetRuntimeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); resetRuntimeOperationSettings = OperationCallSettings.newBuilder(); + upgradeRuntimeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + upgradeRuntimeOperationSettings = OperationCallSettings.newBuilder(); reportRuntimeEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); reportRuntimeEventOperationSettings = OperationCallSettings.newBuilder(); refreshRuntimeTokenInternalSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + diagnoseRuntimeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + diagnoseRuntimeOperationSettings = OperationCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( listRuntimesSettings, getRuntimeSettings, createRuntimeSettings, + updateRuntimeSettings, deleteRuntimeSettings, startRuntimeSettings, stopRuntimeSettings, switchRuntimeSettings, resetRuntimeSettings, + upgradeRuntimeSettings, reportRuntimeEventSettings, - refreshRuntimeTokenInternalSettings); + refreshRuntimeTokenInternalSettings, + diagnoseRuntimeSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); initDefaults(this); } @@ -508,6 +700,8 @@ protected Builder(ManagedNotebookServiceStubSettings settings) { getRuntimeSettings = settings.getRuntimeSettings.toBuilder(); createRuntimeSettings = settings.createRuntimeSettings.toBuilder(); createRuntimeOperationSettings = settings.createRuntimeOperationSettings.toBuilder(); + updateRuntimeSettings = settings.updateRuntimeSettings.toBuilder(); + updateRuntimeOperationSettings = settings.updateRuntimeOperationSettings.toBuilder(); deleteRuntimeSettings = settings.deleteRuntimeSettings.toBuilder(); deleteRuntimeOperationSettings = settings.deleteRuntimeOperationSettings.toBuilder(); startRuntimeSettings = settings.startRuntimeSettings.toBuilder(); @@ -518,24 +712,41 @@ protected Builder(ManagedNotebookServiceStubSettings settings) { switchRuntimeOperationSettings = settings.switchRuntimeOperationSettings.toBuilder(); resetRuntimeSettings = settings.resetRuntimeSettings.toBuilder(); resetRuntimeOperationSettings = settings.resetRuntimeOperationSettings.toBuilder(); + upgradeRuntimeSettings = settings.upgradeRuntimeSettings.toBuilder(); + upgradeRuntimeOperationSettings = settings.upgradeRuntimeOperationSettings.toBuilder(); reportRuntimeEventSettings = settings.reportRuntimeEventSettings.toBuilder(); reportRuntimeEventOperationSettings = settings.reportRuntimeEventOperationSettings.toBuilder(); refreshRuntimeTokenInternalSettings = settings.refreshRuntimeTokenInternalSettings.toBuilder(); + diagnoseRuntimeSettings = settings.diagnoseRuntimeSettings.toBuilder(); + diagnoseRuntimeOperationSettings = settings.diagnoseRuntimeOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( listRuntimesSettings, getRuntimeSettings, createRuntimeSettings, + updateRuntimeSettings, deleteRuntimeSettings, startRuntimeSettings, stopRuntimeSettings, switchRuntimeSettings, resetRuntimeSettings, + upgradeRuntimeSettings, reportRuntimeEventSettings, - refreshRuntimeTokenInternalSettings); + refreshRuntimeTokenInternalSettings, + diagnoseRuntimeSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); } private static Builder createDefault() { @@ -567,6 +778,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .updateRuntimeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .deleteRuntimeSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -592,6 +808,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .upgradeRuntimeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .reportRuntimeEventSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -602,6 +823,36 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .diagnoseRuntimeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .createRuntimeOperationSettings() .setInitialCallSettings( @@ -626,6 +877,30 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .updateRuntimeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Runtime.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .deleteRuntimeOperationSettings() .setInitialCallSettings( @@ -745,6 +1020,30 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .upgradeRuntimeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Runtime.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .reportRuntimeEventOperationSettings() .setInitialCallSettings( @@ -769,6 +1068,30 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .diagnoseRuntimeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Runtime.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + return builder; } @@ -812,6 +1135,19 @@ public UnaryCallSettings.Builder createRuntimeS return createRuntimeOperationSettings; } + /** Returns the builder for the settings used for calls to updateRuntime. */ + public UnaryCallSettings.Builder updateRuntimeSettings() { + return updateRuntimeSettings; + } + + /** Returns the builder for the settings used for calls to updateRuntime. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateRuntimeOperationSettings() { + return updateRuntimeOperationSettings; + } + /** Returns the builder for the settings used for calls to deleteRuntime. */ public UnaryCallSettings.Builder deleteRuntimeSettings() { return deleteRuntimeSettings; @@ -877,6 +1213,19 @@ public UnaryCallSettings.Builder resetRuntimeSet return resetRuntimeOperationSettings; } + /** Returns the builder for the settings used for calls to upgradeRuntime. */ + public UnaryCallSettings.Builder upgradeRuntimeSettings() { + return upgradeRuntimeSettings; + } + + /** Returns the builder for the settings used for calls to upgradeRuntime. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + upgradeRuntimeOperationSettings() { + return upgradeRuntimeOperationSettings; + } + /** Returns the builder for the settings used for calls to reportRuntimeEvent. */ public UnaryCallSettings.Builder reportRuntimeEventSettings() { @@ -898,6 +1247,47 @@ public UnaryCallSettings.Builder resetRuntimeSet return refreshRuntimeTokenInternalSettings; } + /** Returns the builder for the settings used for calls to diagnoseRuntime. */ + public UnaryCallSettings.Builder diagnoseRuntimeSettings() { + return diagnoseRuntimeSettings; + } + + /** Returns the builder for the settings used for calls to diagnoseRuntime. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + diagnoseRuntimeOperationSettings() { + return diagnoseRuntimeOperationSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + @Override public ManagedNotebookServiceStubSettings build() throws IOException { return new ManagedNotebookServiceStubSettings(this); diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/NotebookServiceStub.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/NotebookServiceStub.java index cb6eeb263b5b..86dbb890dc20 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/NotebookServiceStub.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/NotebookServiceStub.java @@ -19,11 +19,16 @@ import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListEnvironmentsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListExecutionsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListInstancesPagedResponse; +import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListLocationsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListSchedulesPagedResponse; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1.CreateEnvironmentRequest; import com.google.cloud.notebooks.v1.CreateExecutionRequest; import com.google.cloud.notebooks.v1.CreateInstanceRequest; @@ -32,6 +37,7 @@ import com.google.cloud.notebooks.v1.DeleteExecutionRequest; import com.google.cloud.notebooks.v1.DeleteInstanceRequest; import com.google.cloud.notebooks.v1.DeleteScheduleRequest; +import com.google.cloud.notebooks.v1.DiagnoseInstanceRequest; import com.google.cloud.notebooks.v1.Environment; import com.google.cloud.notebooks.v1.Execution; import com.google.cloud.notebooks.v1.GetEnvironmentRequest; @@ -69,6 +75,11 @@ import com.google.cloud.notebooks.v1.UpdateShieldedInstanceConfigRequest; import com.google.cloud.notebooks.v1.UpgradeInstanceInternalRequest; import com.google.cloud.notebooks.v1.UpgradeInstanceRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; @@ -250,6 +261,15 @@ public UnaryCallable rollbackInstanceCallabl throw new UnsupportedOperationException("Not implemented: rollbackInstanceCallable()"); } + public OperationCallable + diagnoseInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: diagnoseInstanceOperationCallable()"); + } + + public UnaryCallable diagnoseInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: diagnoseInstanceCallable()"); + } + public OperationCallable upgradeInstanceInternalOperationCallable() { throw new UnsupportedOperationException( @@ -366,6 +386,32 @@ public UnaryCallable createExecutionCallable( throw new UnsupportedOperationException("Not implemented: createExecutionCallable()"); } + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + @Override public abstract void close(); } diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/NotebookServiceStubSettings.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/NotebookServiceStubSettings.java index 7db0b7328392..ea75b97b29ea 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/NotebookServiceStubSettings.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1/stub/NotebookServiceStubSettings.java @@ -19,6 +19,7 @@ import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListEnvironmentsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListExecutionsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListInstancesPagedResponse; +import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListLocationsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListSchedulesPagedResponse; import com.google.api.core.ApiFunction; @@ -47,6 +48,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1.CreateEnvironmentRequest; import com.google.cloud.notebooks.v1.CreateExecutionRequest; import com.google.cloud.notebooks.v1.CreateInstanceRequest; @@ -55,6 +60,7 @@ import com.google.cloud.notebooks.v1.DeleteExecutionRequest; import com.google.cloud.notebooks.v1.DeleteInstanceRequest; import com.google.cloud.notebooks.v1.DeleteScheduleRequest; +import com.google.cloud.notebooks.v1.DiagnoseInstanceRequest; import com.google.cloud.notebooks.v1.Environment; import com.google.cloud.notebooks.v1.Execution; import com.google.cloud.notebooks.v1.GetEnvironmentRequest; @@ -96,6 +102,11 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -201,6 +212,9 @@ public class NotebookServiceStubSettings extends StubSettings rollbackInstanceSettings; private final OperationCallSettings rollbackInstanceOperationSettings; + private final UnaryCallSettings diagnoseInstanceSettings; + private final OperationCallSettings + diagnoseInstanceOperationSettings; private final UnaryCallSettings upgradeInstanceInternalSettings; private final OperationCallSettings @@ -238,6 +252,14 @@ public class NotebookServiceStubSettings extends StubSettings createExecutionSettings; private final OperationCallSettings createExecutionOperationSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; private static final PagedListDescriptor LIST_INSTANCES_PAGE_STR_DESC = @@ -388,6 +410,42 @@ public Iterable extractResources(ListExecutionsResponse payload) { } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> LIST_INSTANCES_PAGE_STR_FACT = @@ -458,6 +516,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listInstances. */ public PagedCallSettings listInstancesSettings() { @@ -644,6 +719,17 @@ public UnaryCallSettings rollbackInstanceSet return rollbackInstanceOperationSettings; } + /** Returns the object with the settings used for calls to diagnoseInstance. */ + public UnaryCallSettings diagnoseInstanceSettings() { + return diagnoseInstanceSettings; + } + + /** Returns the object with the settings used for calls to diagnoseInstance. */ + public OperationCallSettings + diagnoseInstanceOperationSettings() { + return diagnoseInstanceOperationSettings; + } + /** Returns the object with the settings used for calls to upgradeInstanceInternal. */ public UnaryCallSettings upgradeInstanceInternalSettings() { @@ -768,6 +854,33 @@ public UnaryCallSettings createExecutionSetti return createExecutionOperationSettings; } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + public NotebookServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -884,6 +997,8 @@ protected NotebookServiceStubSettings(Builder settingsBuilder) throws IOExceptio upgradeInstanceOperationSettings = settingsBuilder.upgradeInstanceOperationSettings().build(); rollbackInstanceSettings = settingsBuilder.rollbackInstanceSettings().build(); rollbackInstanceOperationSettings = settingsBuilder.rollbackInstanceOperationSettings().build(); + diagnoseInstanceSettings = settingsBuilder.diagnoseInstanceSettings().build(); + diagnoseInstanceOperationSettings = settingsBuilder.diagnoseInstanceOperationSettings().build(); upgradeInstanceInternalSettings = settingsBuilder.upgradeInstanceInternalSettings().build(); upgradeInstanceInternalOperationSettings = settingsBuilder.upgradeInstanceInternalOperationSettings().build(); @@ -909,6 +1024,11 @@ protected NotebookServiceStubSettings(Builder settingsBuilder) throws IOExceptio deleteExecutionOperationSettings = settingsBuilder.deleteExecutionOperationSettings().build(); createExecutionSettings = settingsBuilder.createExecutionSettings().build(); createExecutionOperationSettings = settingsBuilder.createExecutionOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } /** Builder for NotebookServiceStubSettings. */ @@ -987,6 +1107,11 @@ public static class Builder extends StubSettings.Builder rollbackInstanceOperationSettings; + private final UnaryCallSettings.Builder + diagnoseInstanceSettings; + private final OperationCallSettings.Builder< + DiagnoseInstanceRequest, Instance, OperationMetadata> + diagnoseInstanceOperationSettings; private final UnaryCallSettings.Builder upgradeInstanceInternalSettings; private final OperationCallSettings.Builder< @@ -1035,6 +1160,14 @@ public static class Builder extends StubSettings.Builder createExecutionOperationSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -1116,6 +1249,8 @@ protected Builder(ClientContext clientContext) { upgradeInstanceOperationSettings = OperationCallSettings.newBuilder(); rollbackInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); rollbackInstanceOperationSettings = OperationCallSettings.newBuilder(); + diagnoseInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + diagnoseInstanceOperationSettings = OperationCallSettings.newBuilder(); upgradeInstanceInternalSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); upgradeInstanceInternalOperationSettings = OperationCallSettings.newBuilder(); listEnvironmentsSettings = PagedCallSettings.newBuilder(LIST_ENVIRONMENTS_PAGE_STR_FACT); @@ -1138,6 +1273,11 @@ protected Builder(ClientContext clientContext) { deleteExecutionOperationSettings = OperationCallSettings.newBuilder(); createExecutionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createExecutionOperationSettings = OperationCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -1160,6 +1300,7 @@ protected Builder(ClientContext clientContext) { getInstanceHealthSettings, upgradeInstanceSettings, rollbackInstanceSettings, + diagnoseInstanceSettings, upgradeInstanceInternalSettings, listEnvironmentsSettings, getEnvironmentSettings, @@ -1173,7 +1314,12 @@ protected Builder(ClientContext clientContext) { listExecutionsSettings, getExecutionSettings, deleteExecutionSettings, - createExecutionSettings); + createExecutionSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); initDefaults(this); } @@ -1220,6 +1366,8 @@ protected Builder(NotebookServiceStubSettings settings) { upgradeInstanceOperationSettings = settings.upgradeInstanceOperationSettings.toBuilder(); rollbackInstanceSettings = settings.rollbackInstanceSettings.toBuilder(); rollbackInstanceOperationSettings = settings.rollbackInstanceOperationSettings.toBuilder(); + diagnoseInstanceSettings = settings.diagnoseInstanceSettings.toBuilder(); + diagnoseInstanceOperationSettings = settings.diagnoseInstanceOperationSettings.toBuilder(); upgradeInstanceInternalSettings = settings.upgradeInstanceInternalSettings.toBuilder(); upgradeInstanceInternalOperationSettings = settings.upgradeInstanceInternalOperationSettings.toBuilder(); @@ -1243,6 +1391,11 @@ protected Builder(NotebookServiceStubSettings settings) { deleteExecutionOperationSettings = settings.deleteExecutionOperationSettings.toBuilder(); createExecutionSettings = settings.createExecutionSettings.toBuilder(); createExecutionOperationSettings = settings.createExecutionOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -1265,6 +1418,7 @@ protected Builder(NotebookServiceStubSettings settings) { getInstanceHealthSettings, upgradeInstanceSettings, rollbackInstanceSettings, + diagnoseInstanceSettings, upgradeInstanceInternalSettings, listEnvironmentsSettings, getEnvironmentSettings, @@ -1278,7 +1432,12 @@ protected Builder(NotebookServiceStubSettings settings) { listExecutionsSettings, getExecutionSettings, deleteExecutionSettings, - createExecutionSettings); + createExecutionSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); } private static Builder createDefault() { @@ -1390,6 +1549,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .diagnoseInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .upgradeInstanceInternalSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -1460,6 +1624,31 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .createInstanceOperationSettings() .setInitialCallSettings( @@ -1797,6 +1986,30 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .diagnoseInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .upgradeInstanceInternalOperationSettings() .setInitialCallSettings( @@ -2229,6 +2442,20 @@ public UnaryCallSettings.Builder upgradeInsta return rollbackInstanceOperationSettings; } + /** Returns the builder for the settings used for calls to diagnoseInstance. */ + public UnaryCallSettings.Builder + diagnoseInstanceSettings() { + return diagnoseInstanceSettings; + } + + /** Returns the builder for the settings used for calls to diagnoseInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + diagnoseInstanceOperationSettings() { + return diagnoseInstanceOperationSettings; + } + /** Returns the builder for the settings used for calls to upgradeInstanceInternal. */ public UnaryCallSettings.Builder upgradeInstanceInternalSettings() { @@ -2373,6 +2600,34 @@ public UnaryCallSettings.Builder createExecut return createExecutionOperationSettings; } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + @Override public NotebookServiceStubSettings build() throws IOException { return new NotebookServiceStubSettings(this); diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceClient.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceClient.java index ac447a1534d9..88808049e64c 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceClient.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceClient.java @@ -27,9 +27,18 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1beta1.stub.NotebookServiceStub; import com.google.cloud.notebooks.v1beta1.stub.NotebookServiceStubSettings; import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; @@ -1204,7 +1213,7 @@ public final UnaryCallable reportInstanceI // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Check if a notebook instance is upgradable. + * Check if a notebook instance is upgradable. Deprecated. Please consider using v1. * *

Sample code: * @@ -1225,7 +1234,9 @@ public final UnaryCallable reportInstanceI * * @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 + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final IsInstanceUpgradeableResponse isInstanceUpgradeable( IsInstanceUpgradeableRequest request) { return isInstanceUpgradeableCallable().call(request); @@ -1233,7 +1244,7 @@ public final IsInstanceUpgradeableResponse isInstanceUpgradeable( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Check if a notebook instance is upgradable. + * Check if a notebook instance is upgradable. Deprecated. Please consider using v1. * *

Sample code: * @@ -1254,7 +1265,10 @@ public final IsInstanceUpgradeableResponse isInstanceUpgradeable( * IsInstanceUpgradeableResponse response = future.get(); * } * } + * + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final UnaryCallable isInstanceUpgradeableCallable() { return stub.isInstanceUpgradeableCallable(); @@ -1262,7 +1276,7 @@ public final IsInstanceUpgradeableResponse isInstanceUpgradeable( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Upgrades a notebook instance to the latest version. + * Upgrades a notebook instance to the latest version. Deprecated. Please consider using v1. * *

Sample code: * @@ -1281,7 +1295,9 @@ public final IsInstanceUpgradeableResponse isInstanceUpgradeable( * * @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 + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final OperationFuture upgradeInstanceAsync( UpgradeInstanceRequest request) { return upgradeInstanceOperationCallable().futureCall(request); @@ -1289,7 +1305,7 @@ public final OperationFuture upgradeInstanceAsync( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Upgrades a notebook instance to the latest version. + * Upgrades a notebook instance to the latest version. Deprecated. Please consider using v1. * *

Sample code: * @@ -1308,7 +1324,10 @@ public final OperationFuture upgradeInstanceAsync( * Instance response = future.get(); * } * } + * + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final OperationCallable upgradeInstanceOperationCallable() { return stub.upgradeInstanceOperationCallable(); @@ -1316,7 +1335,7 @@ public final OperationFuture upgradeInstanceAsync( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Upgrades a notebook instance to the latest version. + * Upgrades a notebook instance to the latest version. Deprecated. Please consider using v1. * *

Sample code: * @@ -1335,7 +1354,10 @@ public final OperationFuture upgradeInstanceAsync( * Operation response = future.get(); * } * } + * + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final UnaryCallable upgradeInstanceCallable() { return stub.upgradeInstanceCallable(); } @@ -1343,7 +1365,7 @@ public final UnaryCallable upgradeInstanceCal // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method - * directly. + * directly. Deprecated. Please consider using v1. * *

Sample code: * @@ -1365,7 +1387,9 @@ public final UnaryCallable upgradeInstanceCal * * @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 + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final OperationFuture upgradeInstanceInternalAsync( UpgradeInstanceInternalRequest request) { return upgradeInstanceInternalOperationCallable().futureCall(request); @@ -1374,7 +1398,7 @@ public final OperationFuture upgradeInstanceInterna // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method - * directly. + * directly. Deprecated. Please consider using v1. * *

Sample code: * @@ -1396,7 +1420,10 @@ public final OperationFuture upgradeInstanceInterna * Instance response = future.get(); * } * } + * + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final OperationCallable upgradeInstanceInternalOperationCallable() { return stub.upgradeInstanceInternalOperationCallable(); @@ -1405,7 +1432,7 @@ public final OperationFuture upgradeInstanceInterna // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method - * directly. + * directly. Deprecated. Please consider using v1. * *

Sample code: * @@ -1427,7 +1454,10 @@ public final OperationFuture upgradeInstanceInterna * Operation response = future.get(); * } * } + * + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final UnaryCallable upgradeInstanceInternalCallable() { return stub.upgradeInstanceInternalCallable(); @@ -1762,6 +1792,353 @@ public final UnaryCallable deleteEnvironmen return stub.deleteEnvironmentCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : notebookServiceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       notebookServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         notebookServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = notebookServiceClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = notebookServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource("SetIamPolicyRequest1223629066".toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = notebookServiceClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource("SetIamPolicyRequest1223629066".toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = notebookServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource("GetIamPolicyRequest-1527610370".toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = notebookServiceClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource("GetIamPolicyRequest-1527610370".toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = notebookServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource("TestIamPermissionsRequest942398222".toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = notebookServiceClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource("TestIamPermissionsRequest942398222".toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       notebookServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + @Override public final void close() { stub.close(); @@ -1944,4 +2321,80 @@ protected ListEnvironmentsFixedSizeCollection createCollection( return new ListEnvironmentsFixedSizeCollection(pages, collectionSize); } } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceSettings.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceSettings.java index 03f6b2c428ec..c22578e16e82 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceSettings.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceSettings.java @@ -18,6 +18,7 @@ import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListEnvironmentsPagedResponse; import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListInstancesPagedResponse; +import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListLocationsPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; @@ -31,7 +32,16 @@ import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1beta1.stub.NotebookServiceStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -201,30 +211,55 @@ public UnaryCallSettings reportInstanceInf return ((NotebookServiceStubSettings) getStubSettings()).reportInstanceInfoOperationSettings(); } - /** Returns the object with the settings used for calls to isInstanceUpgradeable. */ + /** + * Returns the object with the settings used for calls to isInstanceUpgradeable. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings isInstanceUpgradeableSettings() { return ((NotebookServiceStubSettings) getStubSettings()).isInstanceUpgradeableSettings(); } - /** Returns the object with the settings used for calls to upgradeInstance. */ + /** + * Returns the object with the settings used for calls to upgradeInstance. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings upgradeInstanceSettings() { return ((NotebookServiceStubSettings) getStubSettings()).upgradeInstanceSettings(); } - /** Returns the object with the settings used for calls to upgradeInstance. */ + /** + * Returns the object with the settings used for calls to upgradeInstance. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public OperationCallSettings upgradeInstanceOperationSettings() { return ((NotebookServiceStubSettings) getStubSettings()).upgradeInstanceOperationSettings(); } - /** Returns the object with the settings used for calls to upgradeInstanceInternal. */ + /** + * Returns the object with the settings used for calls to upgradeInstanceInternal. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings upgradeInstanceInternalSettings() { return ((NotebookServiceStubSettings) getStubSettings()).upgradeInstanceInternalSettings(); } - /** Returns the object with the settings used for calls to upgradeInstanceInternal. */ + /** + * Returns the object with the settings used for calls to upgradeInstanceInternal. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public OperationCallSettings upgradeInstanceInternalOperationSettings() { return ((NotebookServiceStubSettings) getStubSettings()) @@ -265,6 +300,33 @@ public UnaryCallSettings deleteEnvironmentS return ((NotebookServiceStubSettings) getStubSettings()).deleteEnvironmentOperationSettings(); } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((NotebookServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((NotebookServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((NotebookServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((NotebookServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((NotebookServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + public static final NotebookServiceSettings create(NotebookServiceStubSettings stub) throws IOException { return new NotebookServiceSettings.Builder(stub.toBuilder()).build(); @@ -489,30 +551,55 @@ public UnaryCallSettings.Builder resetInstanceS return getStubSettingsBuilder().reportInstanceInfoOperationSettings(); } - /** Returns the builder for the settings used for calls to isInstanceUpgradeable. */ + /** + * Returns the builder for the settings used for calls to isInstanceUpgradeable. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings.Builder isInstanceUpgradeableSettings() { return getStubSettingsBuilder().isInstanceUpgradeableSettings(); } - /** Returns the builder for the settings used for calls to upgradeInstance. */ + /** + * Returns the builder for the settings used for calls to upgradeInstance. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings.Builder upgradeInstanceSettings() { return getStubSettingsBuilder().upgradeInstanceSettings(); } - /** Returns the builder for the settings used for calls to upgradeInstance. */ + /** + * Returns the builder for the settings used for calls to upgradeInstance. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public OperationCallSettings.Builder upgradeInstanceOperationSettings() { return getStubSettingsBuilder().upgradeInstanceOperationSettings(); } - /** Returns the builder for the settings used for calls to upgradeInstanceInternal. */ + /** + * Returns the builder for the settings used for calls to upgradeInstanceInternal. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings.Builder upgradeInstanceInternalSettings() { return getStubSettingsBuilder().upgradeInstanceInternalSettings(); } - /** Returns the builder for the settings used for calls to upgradeInstanceInternal. */ + /** + * Returns the builder for the settings used for calls to upgradeInstanceInternal. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public OperationCallSettings.Builder< UpgradeInstanceInternalRequest, Instance, OperationMetadata> upgradeInstanceInternalOperationSettings() { @@ -555,6 +642,34 @@ public UnaryCallSettings.Builder getEnvironm return getStubSettingsBuilder().deleteEnvironmentOperationSettings(); } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + @Override public NotebookServiceSettings build() throws IOException { return new NotebookServiceSettings(this); diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/gapic_metadata.json b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/gapic_metadata.json index 879e53a8d4b4..3c74ae175169 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/gapic_metadata.json +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/gapic_metadata.json @@ -25,9 +25,15 @@ "GetEnvironment": { "methods": ["getEnvironment", "getEnvironmentCallable"] }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, "GetInstance": { "methods": ["getInstance", "getInstanceCallable"] }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "IsInstanceUpgradeable": { "methods": ["isInstanceUpgradeable", "isInstanceUpgradeableCallable"] }, @@ -37,6 +43,9 @@ "ListInstances": { "methods": ["listInstances", "listInstancesPagedCallable", "listInstancesCallable"] }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, "RegisterInstance": { "methods": ["registerInstanceAsync", "registerInstanceOperationCallable", "registerInstanceCallable"] }, @@ -46,6 +55,9 @@ "ResetInstance": { "methods": ["resetInstanceAsync", "resetInstanceOperationCallable", "resetInstanceCallable"] }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, "SetInstanceAccelerator": { "methods": ["setInstanceAcceleratorAsync", "setInstanceAcceleratorOperationCallable", "setInstanceAcceleratorCallable"] }, @@ -61,6 +73,9 @@ "StopInstance": { "methods": ["stopInstanceAsync", "stopInstanceOperationCallable", "stopInstanceCallable"] }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, "UpgradeInstance": { "methods": ["upgradeInstanceAsync", "upgradeInstanceOperationCallable", "upgradeInstanceCallable"] }, diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/package-info.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/package-info.java index 5c65ea42e28b..90bb1c94b234 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/package-info.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Notebooks API + * + *

The interfaces provided are listed below, along with usage samples. * *

======================= NotebookServiceClient ======================= * diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/GrpcNotebookServiceStub.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/GrpcNotebookServiceStub.java index 822b94c61900..c837d7197ff3 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/GrpcNotebookServiceStub.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/GrpcNotebookServiceStub.java @@ -18,6 +18,7 @@ import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListEnvironmentsPagedResponse; import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListInstancesPagedResponse; +import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListLocationsPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; @@ -27,6 +28,10 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1beta1.CreateEnvironmentRequest; import com.google.cloud.notebooks.v1beta1.CreateInstanceRequest; import com.google.cloud.notebooks.v1beta1.DeleteEnvironmentRequest; @@ -53,6 +58,11 @@ import com.google.cloud.notebooks.v1beta1.UpgradeInstanceInternalRequest; import com.google.cloud.notebooks.v1beta1.UpgradeInstanceRequest; import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; @@ -266,6 +276,52 @@ public class GrpcNotebookServiceStub extends NotebookServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + private final UnaryCallable listInstancesCallable; private final UnaryCallable listInstancesPagedCallable; @@ -322,6 +378,14 @@ public class GrpcNotebookServiceStub extends NotebookServiceStub { private final UnaryCallable deleteEnvironmentCallable; private final OperationCallable deleteEnvironmentOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -564,6 +628,57 @@ protected GrpcNotebookServiceStub( return params.build(); }) .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); this.listInstancesCallable = callableFactory.createUnaryCallable( @@ -728,6 +843,26 @@ protected GrpcNotebookServiceStub( settings.deleteEnvironmentOperationSettings(), clientContext, operationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -931,6 +1066,38 @@ public UnaryCallable deleteEnvironmentCalla return deleteEnvironmentOperationCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + @Override public final void close() { try { diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/NotebookServiceStub.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/NotebookServiceStub.java index 18b227411c58..dd2565597f7e 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/NotebookServiceStub.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/NotebookServiceStub.java @@ -18,11 +18,16 @@ import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListEnvironmentsPagedResponse; import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListInstancesPagedResponse; +import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListLocationsPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1beta1.CreateEnvironmentRequest; import com.google.cloud.notebooks.v1beta1.CreateInstanceRequest; import com.google.cloud.notebooks.v1beta1.DeleteEnvironmentRequest; @@ -48,6 +53,11 @@ import com.google.cloud.notebooks.v1beta1.StopInstanceRequest; import com.google.cloud.notebooks.v1beta1.UpgradeInstanceInternalRequest; import com.google.cloud.notebooks.v1beta1.UpgradeInstanceRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; @@ -174,26 +184,31 @@ public UnaryCallable reportInstanceInfoCal throw new UnsupportedOperationException("Not implemented: reportInstanceInfoCallable()"); } + @Deprecated public UnaryCallable isInstanceUpgradeableCallable() { throw new UnsupportedOperationException("Not implemented: isInstanceUpgradeableCallable()"); } + @Deprecated public OperationCallable upgradeInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: upgradeInstanceOperationCallable()"); } + @Deprecated public UnaryCallable upgradeInstanceCallable() { throw new UnsupportedOperationException("Not implemented: upgradeInstanceCallable()"); } + @Deprecated public OperationCallable upgradeInstanceInternalOperationCallable() { throw new UnsupportedOperationException( "Not implemented: upgradeInstanceInternalOperationCallable()"); } + @Deprecated public UnaryCallable upgradeInstanceInternalCallable() { throw new UnsupportedOperationException("Not implemented: upgradeInstanceInternalCallable()"); @@ -233,6 +248,32 @@ public UnaryCallable deleteEnvironmentCalla throw new UnsupportedOperationException("Not implemented: deleteEnvironmentCallable()"); } + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + @Override public abstract void close(); } diff --git a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/NotebookServiceStubSettings.java b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/NotebookServiceStubSettings.java index 2e01b8dc899a..b0e8b19bbbfd 100644 --- a/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/NotebookServiceStubSettings.java +++ b/java-notebooks/google-cloud-notebooks/src/main/java/com/google/cloud/notebooks/v1beta1/stub/NotebookServiceStubSettings.java @@ -18,6 +18,7 @@ import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListEnvironmentsPagedResponse; import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListInstancesPagedResponse; +import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListLocationsPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; @@ -45,6 +46,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.notebooks.v1beta1.CreateEnvironmentRequest; import com.google.cloud.notebooks.v1beta1.CreateInstanceRequest; import com.google.cloud.notebooks.v1beta1.DeleteEnvironmentRequest; @@ -74,6 +79,11 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -177,6 +187,14 @@ public class NotebookServiceStubSettings extends StubSettings deleteEnvironmentSettings; private final OperationCallSettings deleteEnvironmentOperationSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; private static final PagedListDescriptor LIST_INSTANCES_PAGE_STR_DESC = @@ -254,6 +272,42 @@ public Iterable extractResources(ListEnvironmentsResponse payload) } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> LIST_INSTANCES_PAGE_STR_FACT = @@ -290,6 +344,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listInstances. */ public PagedCallSettings listInstancesSettings() { @@ -413,13 +484,23 @@ public UnaryCallSettings reportInstanceInf return reportInstanceInfoOperationSettings; } - /** Returns the object with the settings used for calls to isInstanceUpgradeable. */ + /** + * Returns the object with the settings used for calls to isInstanceUpgradeable. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings isInstanceUpgradeableSettings() { return isInstanceUpgradeableSettings; } - /** Returns the object with the settings used for calls to upgradeInstance. */ + /** + * Returns the object with the settings used for calls to upgradeInstance. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings upgradeInstanceSettings() { return upgradeInstanceSettings; } @@ -430,7 +511,12 @@ public UnaryCallSettings upgradeInstanceSetti return upgradeInstanceOperationSettings; } - /** Returns the object with the settings used for calls to upgradeInstanceInternal. */ + /** + * Returns the object with the settings used for calls to upgradeInstanceInternal. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings upgradeInstanceInternalSettings() { return upgradeInstanceInternalSettings; @@ -476,6 +562,33 @@ public UnaryCallSettings deleteEnvironmentS return deleteEnvironmentOperationSettings; } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + public NotebookServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -591,6 +704,11 @@ protected NotebookServiceStubSettings(Builder settingsBuilder) throws IOExceptio deleteEnvironmentSettings = settingsBuilder.deleteEnvironmentSettings().build(); deleteEnvironmentOperationSettings = settingsBuilder.deleteEnvironmentOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } /** Builder for NotebookServiceStubSettings. */ @@ -668,6 +786,14 @@ public static class Builder extends StubSettings.Builder deleteEnvironmentOperationSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -676,6 +802,9 @@ public static class Builder extends StubSettings.BuildernewArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -692,6 +821,17 @@ public static class Builder extends StubSettings.Builder>of( @@ -756,7 +901,12 @@ protected Builder(ClientContext clientContext) { listEnvironmentsSettings, getEnvironmentSettings, createEnvironmentSettings, - deleteEnvironmentSettings); + deleteEnvironmentSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); initDefaults(this); } @@ -800,6 +950,11 @@ protected Builder(NotebookServiceStubSettings settings) { createEnvironmentOperationSettings = settings.createEnvironmentOperationSettings.toBuilder(); deleteEnvironmentSettings = settings.deleteEnvironmentSettings.toBuilder(); deleteEnvironmentOperationSettings = settings.deleteEnvironmentOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -821,7 +976,12 @@ protected Builder(NotebookServiceStubSettings settings) { listEnvironmentsSettings, getEnvironmentSettings, createEnvironmentSettings, - deleteEnvironmentSettings); + deleteEnvironmentSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); } private static Builder createDefault() { @@ -933,6 +1093,31 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .createInstanceOperationSettings() .setInitialCallSettings( @@ -1434,13 +1619,23 @@ public UnaryCallSettings.Builder resetInstanceS return reportInstanceInfoOperationSettings; } - /** Returns the builder for the settings used for calls to isInstanceUpgradeable. */ + /** + * Returns the builder for the settings used for calls to isInstanceUpgradeable. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings.Builder isInstanceUpgradeableSettings() { return isInstanceUpgradeableSettings; } - /** Returns the builder for the settings used for calls to upgradeInstance. */ + /** + * Returns the builder for the settings used for calls to upgradeInstance. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings.Builder upgradeInstanceSettings() { return upgradeInstanceSettings; } @@ -1453,7 +1648,12 @@ public UnaryCallSettings.Builder upgradeInsta return upgradeInstanceOperationSettings; } - /** Returns the builder for the settings used for calls to upgradeInstanceInternal. */ + /** + * Returns the builder for the settings used for calls to upgradeInstanceInternal. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public UnaryCallSettings.Builder upgradeInstanceInternalSettings() { return upgradeInstanceInternalSettings; @@ -1508,6 +1708,34 @@ public UnaryCallSettings.Builder getEnvironm return deleteEnvironmentOperationSettings; } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + @Override public NotebookServiceStubSettings build() throws IOException { return new NotebookServiceStubSettings(this); diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceClientTest.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceClientTest.java index a749ebe4931e..19cc18b1e153 100644 --- a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceClientTest.java +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceClientTest.java @@ -16,6 +16,7 @@ package com.google.cloud.notebooks.v1; +import static com.google.cloud.notebooks.v1.ManagedNotebookServiceClient.ListLocationsPagedResponse; import static com.google.cloud.notebooks.v1.ManagedNotebookServiceClient.ListRuntimesPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -26,15 +27,31 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; +import com.google.protobuf.ByteString; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; @@ -48,6 +65,8 @@ @Generated("by gapic-generator-java") public class ManagedNotebookServiceClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; private static MockManagedNotebookService mockManagedNotebookService; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; @@ -56,10 +75,13 @@ public class ManagedNotebookServiceClientTest { @BeforeClass public static void startStaticServer() { mockManagedNotebookService = new MockManagedNotebookService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), - Arrays.asList(mockManagedNotebookService)); + Arrays.asList( + mockManagedNotebookService, mockLocations, mockIAMPolicy)); mockServiceHelper.start(); } @@ -373,6 +395,60 @@ public void createRuntimeExceptionTest2() throws Exception { } } + @Test + public void updateRuntimeTest() throws Exception { + Runtime expectedResponse = + Runtime.newBuilder() + .setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setAccessConfig(RuntimeAccessConfig.newBuilder().build()) + .setSoftwareConfig(RuntimeSoftwareConfig.newBuilder().build()) + .setMetrics(RuntimeMetrics.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateRuntimeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockManagedNotebookService.addResponse(resultOperation); + + Runtime runtime = Runtime.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Runtime actualResponse = client.updateRuntimeAsync(runtime, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockManagedNotebookService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateRuntimeRequest actualRequest = ((UpdateRuntimeRequest) actualRequests.get(0)); + + Assert.assertEquals(runtime, actualRequest.getRuntime()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateRuntimeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockManagedNotebookService.addException(exception); + + try { + Runtime runtime = Runtime.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateRuntimeAsync(runtime, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void deleteRuntimeTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); @@ -661,6 +737,57 @@ public void resetRuntimeExceptionTest() throws Exception { } } + @Test + public void upgradeRuntimeTest() throws Exception { + Runtime expectedResponse = + Runtime.newBuilder() + .setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setAccessConfig(RuntimeAccessConfig.newBuilder().build()) + .setSoftwareConfig(RuntimeSoftwareConfig.newBuilder().build()) + .setMetrics(RuntimeMetrics.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("upgradeRuntimeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockManagedNotebookService.addResponse(resultOperation); + + String name = "name3373707"; + + Runtime actualResponse = client.upgradeRuntimeAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockManagedNotebookService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpgradeRuntimeRequest actualRequest = ((UpgradeRuntimeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void upgradeRuntimeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockManagedNotebookService.addException(exception); + + try { + String name = "name3373707"; + client.upgradeRuntimeAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void reportRuntimeEventTest() throws Exception { Runtime expectedResponse = @@ -850,4 +977,361 @@ public void refreshRuntimeTokenInternalExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void diagnoseRuntimeTest() throws Exception { + Runtime expectedResponse = + Runtime.newBuilder() + .setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setAccessConfig(RuntimeAccessConfig.newBuilder().build()) + .setSoftwareConfig(RuntimeSoftwareConfig.newBuilder().build()) + .setMetrics(RuntimeMetrics.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("diagnoseRuntimeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockManagedNotebookService.addResponse(resultOperation); + + RuntimeName name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]"); + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + + Runtime actualResponse = client.diagnoseRuntimeAsync(name, diagnosticConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockManagedNotebookService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DiagnoseRuntimeRequest actualRequest = ((DiagnoseRuntimeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(diagnosticConfig, actualRequest.getDiagnosticConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void diagnoseRuntimeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockManagedNotebookService.addException(exception); + + try { + RuntimeName name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]"); + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + client.diagnoseRuntimeAsync(name, diagnosticConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void diagnoseRuntimeTest2() throws Exception { + Runtime expectedResponse = + Runtime.newBuilder() + .setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setAccessConfig(RuntimeAccessConfig.newBuilder().build()) + .setSoftwareConfig(RuntimeSoftwareConfig.newBuilder().build()) + .setMetrics(RuntimeMetrics.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("diagnoseRuntimeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockManagedNotebookService.addResponse(resultOperation); + + String name = "name3373707"; + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + + Runtime actualResponse = client.diagnoseRuntimeAsync(name, diagnosticConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockManagedNotebookService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DiagnoseRuntimeRequest actualRequest = ((DiagnoseRuntimeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(diagnosticConfig, actualRequest.getDiagnosticConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void diagnoseRuntimeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockManagedNotebookService.addException(exception); + + try { + String name = "name3373707"; + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + client.diagnoseRuntimeAsync(name, diagnosticConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockIAMPolicy.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockIAMPolicy.java new file mode 100644 index 000000000000..fc09ee3935a2 --- /dev/null +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockIAMPolicyImpl.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..062335ae0c86 --- /dev/null +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockLocations.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockLocations.java new file mode 100644 index 000000000000..0c021c634a6e --- /dev/null +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockLocationsImpl.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..c1381eefb876 --- /dev/null +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockManagedNotebookServiceImpl.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockManagedNotebookServiceImpl.java index 4e2ded6ce31c..7a39c10defb7 100644 --- a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockManagedNotebookServiceImpl.java +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockManagedNotebookServiceImpl.java @@ -121,6 +121,27 @@ public void createRuntime( } } + @Override + public void updateRuntime( + UpdateRuntimeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateRuntime, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void deleteRuntime( DeleteRuntimeRequest request, StreamObserver responseObserver) { @@ -225,6 +246,27 @@ public void resetRuntime( } } + @Override + public void upgradeRuntime( + UpgradeRuntimeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpgradeRuntime, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void reportRuntimeEvent( ReportRuntimeEventRequest request, StreamObserver responseObserver) { @@ -267,4 +309,25 @@ public void refreshRuntimeTokenInternal( Exception.class.getName()))); } } + + @Override + public void diagnoseRuntime( + DiagnoseRuntimeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DiagnoseRuntime, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockNotebookServiceImpl.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockNotebookServiceImpl.java index 555b1d5c6f27..f8b958ec54bc 100644 --- a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockNotebookServiceImpl.java +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/MockNotebookServiceImpl.java @@ -460,6 +460,27 @@ public void rollbackInstance( } } + @Override + public void diagnoseInstance( + DiagnoseInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DiagnoseInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void upgradeInstanceInternal( UpgradeInstanceInternalRequest request, StreamObserver responseObserver) { diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/NotebookServiceClientTest.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/NotebookServiceClientTest.java index f6aa66bfd215..08ba188ec20e 100644 --- a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/NotebookServiceClientTest.java +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1/NotebookServiceClientTest.java @@ -19,6 +19,7 @@ import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListEnvironmentsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListExecutionsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListInstancesPagedResponse; +import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListLocationsPagedResponse; import static com.google.cloud.notebooks.v1.NotebookServiceClient.ListSchedulesPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -29,11 +30,25 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; +import com.google.protobuf.ByteString; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; @@ -53,6 +68,8 @@ @Generated("by gapic-generator-java") public class NotebookServiceClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; private static MockNotebookService mockNotebookService; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; @@ -61,9 +78,12 @@ public class NotebookServiceClientTest { @BeforeClass public static void startStaticServer() { mockNotebookService = new MockNotebookService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockNotebookService)); + UUID.randomUUID().toString(), + Arrays.asList(mockNotebookService, mockLocations, mockIAMPolicy)); mockServiceHelper.start(); } @@ -1477,6 +1497,160 @@ public void rollbackInstanceExceptionTest() throws Exception { } } + @Test + public void diagnoseInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setPostStartupScript("postStartupScript870779112") + .setProxyUri("proxyUri-985185250") + .addAllInstanceOwners(new ArrayList()) + .setServiceAccount("serviceAccount1079137720") + .addAllServiceAccountScopes(new ArrayList()) + .setMachineType("machineType-218117087") + .setAcceleratorConfig(Instance.AcceleratorConfig.newBuilder().build()) + .setInstallGpuDriver(true) + .setCustomGpuDriverPath("customGpuDriverPath509224520") + .setBootDiskSizeGb(1398920548) + .setDataDiskSizeGb(-1668379732) + .setNoRemoveDataDisk(true) + .setKmsKey("kmsKey-1127483058") + .addAllDisks(new ArrayList()) + .setShieldedInstanceConfig(Instance.ShieldedInstanceConfig.newBuilder().build()) + .setNoPublicIp(true) + .setNoProxyAccess(true) + .setNetwork("network1843485230") + .setSubnet("subnet-891534499") + .putAllLabels(new HashMap()) + .putAllMetadata(new HashMap()) + .addAllTags(new ArrayList()) + .addAllUpgradeHistory(new ArrayList()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCreator("creator1028554796") + .setCanIpForward(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("diagnoseInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNotebookService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + + Instance actualResponse = client.diagnoseInstanceAsync(name, diagnosticConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNotebookService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DiagnoseInstanceRequest actualRequest = ((DiagnoseInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(diagnosticConfig, actualRequest.getDiagnosticConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void diagnoseInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotebookService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + client.diagnoseInstanceAsync(name, diagnosticConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void diagnoseInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setPostStartupScript("postStartupScript870779112") + .setProxyUri("proxyUri-985185250") + .addAllInstanceOwners(new ArrayList()) + .setServiceAccount("serviceAccount1079137720") + .addAllServiceAccountScopes(new ArrayList()) + .setMachineType("machineType-218117087") + .setAcceleratorConfig(Instance.AcceleratorConfig.newBuilder().build()) + .setInstallGpuDriver(true) + .setCustomGpuDriverPath("customGpuDriverPath509224520") + .setBootDiskSizeGb(1398920548) + .setDataDiskSizeGb(-1668379732) + .setNoRemoveDataDisk(true) + .setKmsKey("kmsKey-1127483058") + .addAllDisks(new ArrayList()) + .setShieldedInstanceConfig(Instance.ShieldedInstanceConfig.newBuilder().build()) + .setNoPublicIp(true) + .setNoProxyAccess(true) + .setNetwork("network1843485230") + .setSubnet("subnet-891534499") + .putAllLabels(new HashMap()) + .putAllMetadata(new HashMap()) + .addAllTags(new ArrayList()) + .addAllUpgradeHistory(new ArrayList()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCreator("creator1028554796") + .setCanIpForward(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("diagnoseInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNotebookService.addResponse(resultOperation); + + String name = "name3373707"; + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + + Instance actualResponse = client.diagnoseInstanceAsync(name, diagnosticConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNotebookService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DiagnoseInstanceRequest actualRequest = ((DiagnoseInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(diagnosticConfig, actualRequest.getDiagnosticConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void diagnoseInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotebookService.addException(exception); + + try { + String name = "name3373707"; + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + client.diagnoseInstanceAsync(name, diagnosticConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void upgradeInstanceInternalTest() throws Exception { Instance expectedResponse = @@ -2572,4 +2746,253 @@ public void createExecutionExceptionTest2() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockIAMPolicy.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockIAMPolicy.java new file mode 100644 index 000000000000..fc0ead8fccc2 --- /dev/null +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockIAMPolicyImpl.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..462b0a7a2eca --- /dev/null +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockLocations.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockLocations.java new file mode 100644 index 000000000000..b3db91eae50b --- /dev/null +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockLocationsImpl.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockLocationsImpl.java new file mode 100644 index 000000000000..ab161510fc5e --- /dev/null +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/NotebookServiceClientTest.java b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/NotebookServiceClientTest.java index 84c820889bb5..37f95f635c8d 100644 --- a/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/NotebookServiceClientTest.java +++ b/java-notebooks/google-cloud-notebooks/src/test/java/com/google/cloud/notebooks/v1beta1/NotebookServiceClientTest.java @@ -18,6 +18,7 @@ import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListEnvironmentsPagedResponse; import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListInstancesPagedResponse; +import static com.google.cloud.notebooks.v1beta1.NotebookServiceClient.ListLocationsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; @@ -27,11 +28,25 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; +import com.google.protobuf.ByteString; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; @@ -51,6 +66,8 @@ @Generated("by gapic-generator-java") public class NotebookServiceClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; private static MockNotebookService mockNotebookService; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; @@ -59,9 +76,12 @@ public class NotebookServiceClientTest { @BeforeClass public static void startStaticServer() { mockNotebookService = new MockNotebookService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockNotebookService)); + UUID.randomUUID().toString(), + Arrays.asList(mockNotebookService, mockLocations, mockIAMPolicy)); mockServiceHelper.start(); } @@ -166,6 +186,8 @@ public void getInstanceTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -224,6 +246,8 @@ public void createInstanceTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -302,6 +326,8 @@ public void registerInstanceTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -377,6 +403,8 @@ public void setInstanceAcceleratorTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -454,6 +482,8 @@ public void setInstanceMachineTypeTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -530,6 +560,8 @@ public void setInstanceLabelsTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -649,6 +681,8 @@ public void startInstanceTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -716,6 +750,8 @@ public void stopInstanceTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -782,6 +818,8 @@ public void resetInstanceTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -849,6 +887,8 @@ public void reportInstanceInfoTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -911,6 +951,7 @@ public void isInstanceUpgradeableTest() throws Exception { .setUpgradeable(true) .setUpgradeVersion("upgradeVersion-392903908") .setUpgradeInfo("upgradeInfo-1844902678") + .setUpgradeImage("upgradeImage-1357442913") .build(); mockNotebookService.addResponse(expectedResponse); @@ -974,6 +1015,8 @@ public void upgradeInstanceTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -1042,6 +1085,8 @@ public void upgradeInstanceInternalTest() throws Exception { .setSubnet("subnet-891534499") .putAllLabels(new HashMap()) .putAllMetadata(new HashMap()) + .setReservationAffinity(ReservationAffinity.newBuilder().build()) + .setCanIpForward(true) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .build(); @@ -1300,4 +1345,253 @@ public void deleteEnvironmentExceptionTest() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource("SetIamPolicyRequest1223629066".toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource("SetIamPolicyRequest1223629066".toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource("GetIamPolicyRequest-1527610370".toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource("GetIamPolicyRequest-1527610370".toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource("TestIamPermissionsRequest942398222".toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource("TestIamPermissionsRequest942398222".toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-notebooks/grpc-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceGrpc.java b/java-notebooks/grpc-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceGrpc.java index 4b62d610c7e7..bac16a032630 100644 --- a/java-notebooks/grpc-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceGrpc.java +++ b/java-notebooks/grpc-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebookServiceGrpc.java @@ -167,6 +167,49 @@ private ManagedNotebookServiceGrpc() {} return getCreateRuntimeMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.UpdateRuntimeRequest, com.google.longrunning.Operation> + getUpdateRuntimeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateRuntime", + requestType = com.google.cloud.notebooks.v1.UpdateRuntimeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.UpdateRuntimeRequest, com.google.longrunning.Operation> + getUpdateRuntimeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.UpdateRuntimeRequest, com.google.longrunning.Operation> + getUpdateRuntimeMethod; + if ((getUpdateRuntimeMethod = ManagedNotebookServiceGrpc.getUpdateRuntimeMethod) == null) { + synchronized (ManagedNotebookServiceGrpc.class) { + if ((getUpdateRuntimeMethod = ManagedNotebookServiceGrpc.getUpdateRuntimeMethod) == null) { + ManagedNotebookServiceGrpc.getUpdateRuntimeMethod = + getUpdateRuntimeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateRuntime")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.notebooks.v1.UpdateRuntimeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ManagedNotebookServiceMethodDescriptorSupplier("UpdateRuntime")) + .build(); + } + } + } + return getUpdateRuntimeMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.notebooks.v1.DeleteRuntimeRequest, com.google.longrunning.Operation> getDeleteRuntimeMethod; @@ -382,6 +425,50 @@ private ManagedNotebookServiceGrpc() {} return getResetRuntimeMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest, com.google.longrunning.Operation> + getUpgradeRuntimeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpgradeRuntime", + requestType = com.google.cloud.notebooks.v1.UpgradeRuntimeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest, com.google.longrunning.Operation> + getUpgradeRuntimeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest, com.google.longrunning.Operation> + getUpgradeRuntimeMethod; + if ((getUpgradeRuntimeMethod = ManagedNotebookServiceGrpc.getUpgradeRuntimeMethod) == null) { + synchronized (ManagedNotebookServiceGrpc.class) { + if ((getUpgradeRuntimeMethod = ManagedNotebookServiceGrpc.getUpgradeRuntimeMethod) + == null) { + ManagedNotebookServiceGrpc.getUpgradeRuntimeMethod = + getUpgradeRuntimeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpgradeRuntime")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ManagedNotebookServiceMethodDescriptorSupplier("UpgradeRuntime")) + .build(); + } + } + } + return getUpgradeRuntimeMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.notebooks.v1.ReportRuntimeEventRequest, com.google.longrunning.Operation> getReportRuntimeEventMethod; @@ -481,6 +568,50 @@ private ManagedNotebookServiceGrpc() {} return getRefreshRuntimeTokenInternalMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest, com.google.longrunning.Operation> + getDiagnoseRuntimeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DiagnoseRuntime", + requestType = com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest, com.google.longrunning.Operation> + getDiagnoseRuntimeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest, com.google.longrunning.Operation> + getDiagnoseRuntimeMethod; + if ((getDiagnoseRuntimeMethod = ManagedNotebookServiceGrpc.getDiagnoseRuntimeMethod) == null) { + synchronized (ManagedNotebookServiceGrpc.class) { + if ((getDiagnoseRuntimeMethod = ManagedNotebookServiceGrpc.getDiagnoseRuntimeMethod) + == null) { + ManagedNotebookServiceGrpc.getDiagnoseRuntimeMethod = + getDiagnoseRuntimeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DiagnoseRuntime")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ManagedNotebookServiceMethodDescriptorSupplier("DiagnoseRuntime")) + .build(); + } + } + } + return getDiagnoseRuntimeMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static ManagedNotebookServiceStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -574,6 +705,20 @@ public void createRuntime( getCreateRuntimeMethod(), responseObserver); } + /** + * + * + *
+     * Update Notebook Runtime configuration.
+     * 
+ */ + public void updateRuntime( + com.google.cloud.notebooks.v1.UpdateRuntimeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateRuntimeMethod(), responseObserver); + } + /** * * @@ -652,6 +797,20 @@ public void resetRuntime( getResetRuntimeMethod(), responseObserver); } + /** + * + * + *
+     * Upgrades a Managed Notebook Runtime to the latest version.
+     * 
+ */ + public void upgradeRuntime( + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpgradeRuntimeMethod(), responseObserver); + } + /** * * @@ -683,6 +842,20 @@ public void refreshRuntimeTokenInternal( getRefreshRuntimeTokenInternalMethod(), responseObserver); } + /** + * + * + *
+     * Creates a Diagnostic File and runs Diagnostic Tool given a Runtime.
+     * 
+ */ + public void diagnoseRuntime( + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDiagnoseRuntimeMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -705,6 +878,12 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.notebooks.v1.CreateRuntimeRequest, com.google.longrunning.Operation>(this, METHODID_CREATE_RUNTIME))) + .addMethod( + getUpdateRuntimeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.notebooks.v1.UpdateRuntimeRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_RUNTIME))) .addMethod( getDeleteRuntimeMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -735,6 +914,12 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.notebooks.v1.ResetRuntimeRequest, com.google.longrunning.Operation>(this, METHODID_RESET_RUNTIME))) + .addMethod( + getUpgradeRuntimeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest, + com.google.longrunning.Operation>(this, METHODID_UPGRADE_RUNTIME))) .addMethod( getReportRuntimeEventMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -748,6 +933,12 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.notebooks.v1.RefreshRuntimeTokenInternalRequest, com.google.cloud.notebooks.v1.RefreshRuntimeTokenInternalResponse>( this, METHODID_REFRESH_RUNTIME_TOKEN_INTERNAL))) + .addMethod( + getDiagnoseRuntimeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest, + com.google.longrunning.Operation>(this, METHODID_DIAGNOSE_RUNTIME))) .build(); } } @@ -819,6 +1010,22 @@ public void createRuntime( responseObserver); } + /** + * + * + *
+     * Update Notebook Runtime configuration.
+     * 
+ */ + public void updateRuntime( + com.google.cloud.notebooks.v1.UpdateRuntimeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateRuntimeMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -907,6 +1114,22 @@ public void resetRuntime( responseObserver); } + /** + * + * + *
+     * Upgrades a Managed Notebook Runtime to the latest version.
+     * 
+ */ + public void upgradeRuntime( + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpgradeRuntimeMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -941,6 +1164,22 @@ public void refreshRuntimeTokenInternal( request, responseObserver); } + + /** + * + * + *
+     * Creates a Diagnostic File and runs Diagnostic Tool given a Runtime.
+     * 
+ */ + public void diagnoseRuntime( + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDiagnoseRuntimeMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -1003,6 +1242,19 @@ public com.google.longrunning.Operation createRuntime( getChannel(), getCreateRuntimeMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Update Notebook Runtime configuration.
+     * 
+ */ + public com.google.longrunning.Operation updateRuntime( + com.google.cloud.notebooks.v1.UpdateRuntimeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateRuntimeMethod(), getCallOptions(), request); + } + /** * * @@ -1076,6 +1328,19 @@ public com.google.longrunning.Operation resetRuntime( getChannel(), getResetRuntimeMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Upgrades a Managed Notebook Runtime to the latest version.
+     * 
+ */ + public com.google.longrunning.Operation upgradeRuntime( + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpgradeRuntimeMethod(), getCallOptions(), request); + } + /** * * @@ -1103,6 +1368,19 @@ public com.google.longrunning.Operation reportRuntimeEvent( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getRefreshRuntimeTokenInternalMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Creates a Diagnostic File and runs Diagnostic Tool given a Runtime.
+     * 
+ */ + public com.google.longrunning.Operation diagnoseRuntime( + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDiagnoseRuntimeMethod(), getCallOptions(), request); + } } /** @@ -1166,6 +1444,19 @@ protected ManagedNotebookServiceFutureStub build( getChannel().newCall(getCreateRuntimeMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Update Notebook Runtime configuration.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateRuntime(com.google.cloud.notebooks.v1.UpdateRuntimeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateRuntimeMethod(), getCallOptions()), request); + } + /** * * @@ -1239,6 +1530,19 @@ protected ManagedNotebookServiceFutureStub build( getChannel().newCall(getResetRuntimeMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Upgrades a Managed Notebook Runtime to the latest version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + upgradeRuntime(com.google.cloud.notebooks.v1.UpgradeRuntimeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpgradeRuntimeMethod(), getCallOptions()), request); + } + /** * * @@ -1267,18 +1571,34 @@ protected ManagedNotebookServiceFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getRefreshRuntimeTokenInternalMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Creates a Diagnostic File and runs Diagnostic Tool given a Runtime.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + diagnoseRuntime(com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDiagnoseRuntimeMethod(), getCallOptions()), request); + } } private static final int METHODID_LIST_RUNTIMES = 0; private static final int METHODID_GET_RUNTIME = 1; private static final int METHODID_CREATE_RUNTIME = 2; - private static final int METHODID_DELETE_RUNTIME = 3; - private static final int METHODID_START_RUNTIME = 4; - private static final int METHODID_STOP_RUNTIME = 5; - private static final int METHODID_SWITCH_RUNTIME = 6; - private static final int METHODID_RESET_RUNTIME = 7; - private static final int METHODID_REPORT_RUNTIME_EVENT = 8; - private static final int METHODID_REFRESH_RUNTIME_TOKEN_INTERNAL = 9; + private static final int METHODID_UPDATE_RUNTIME = 3; + private static final int METHODID_DELETE_RUNTIME = 4; + private static final int METHODID_START_RUNTIME = 5; + private static final int METHODID_STOP_RUNTIME = 6; + private static final int METHODID_SWITCH_RUNTIME = 7; + private static final int METHODID_RESET_RUNTIME = 8; + private static final int METHODID_UPGRADE_RUNTIME = 9; + private static final int METHODID_REPORT_RUNTIME_EVENT = 10; + private static final int METHODID_REFRESH_RUNTIME_TOKEN_INTERNAL = 11; + private static final int METHODID_DIAGNOSE_RUNTIME = 12; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1314,6 +1634,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.notebooks.v1.CreateRuntimeRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_UPDATE_RUNTIME: + serviceImpl.updateRuntime( + (com.google.cloud.notebooks.v1.UpdateRuntimeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_DELETE_RUNTIME: serviceImpl.deleteRuntime( (com.google.cloud.notebooks.v1.DeleteRuntimeRequest) request, @@ -1339,6 +1664,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.notebooks.v1.ResetRuntimeRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_UPGRADE_RUNTIME: + serviceImpl.upgradeRuntime( + (com.google.cloud.notebooks.v1.UpgradeRuntimeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_REPORT_RUNTIME_EVENT: serviceImpl.reportRuntimeEvent( (com.google.cloud.notebooks.v1.ReportRuntimeEventRequest) request, @@ -1351,6 +1681,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv com.google.cloud.notebooks.v1.RefreshRuntimeTokenInternalResponse>) responseObserver); break; + case METHODID_DIAGNOSE_RUNTIME: + serviceImpl.diagnoseRuntime( + (com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -1418,13 +1753,16 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListRuntimesMethod()) .addMethod(getGetRuntimeMethod()) .addMethod(getCreateRuntimeMethod()) + .addMethod(getUpdateRuntimeMethod()) .addMethod(getDeleteRuntimeMethod()) .addMethod(getStartRuntimeMethod()) .addMethod(getStopRuntimeMethod()) .addMethod(getSwitchRuntimeMethod()) .addMethod(getResetRuntimeMethod()) + .addMethod(getUpgradeRuntimeMethod()) .addMethod(getReportRuntimeEventMethod()) .addMethod(getRefreshRuntimeTokenInternalMethod()) + .addMethod(getDiagnoseRuntimeMethod()) .build(); } } diff --git a/java-notebooks/grpc-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceGrpc.java b/java-notebooks/grpc-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceGrpc.java index e45e07b4d85d..720d3c168839 100644 --- a/java-notebooks/grpc-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceGrpc.java +++ b/java-notebooks/grpc-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/NotebookServiceGrpc.java @@ -908,6 +908,49 @@ private NotebookServiceGrpc() {} return getRollbackInstanceMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest, com.google.longrunning.Operation> + getDiagnoseInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DiagnoseInstance", + requestType = com.google.cloud.notebooks.v1.DiagnoseInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest, com.google.longrunning.Operation> + getDiagnoseInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest, com.google.longrunning.Operation> + getDiagnoseInstanceMethod; + if ((getDiagnoseInstanceMethod = NotebookServiceGrpc.getDiagnoseInstanceMethod) == null) { + synchronized (NotebookServiceGrpc.class) { + if ((getDiagnoseInstanceMethod = NotebookServiceGrpc.getDiagnoseInstanceMethod) == null) { + NotebookServiceGrpc.getDiagnoseInstanceMethod = + getDiagnoseInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DiagnoseInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new NotebookServiceMethodDescriptorSupplier("DiagnoseInstance")) + .build(); + } + } + } + return getDiagnoseInstanceMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.notebooks.v1.UpgradeInstanceInternalRequest, com.google.longrunning.Operation> @@ -1865,6 +1908,20 @@ public void rollbackInstance( getRollbackInstanceMethod(), responseObserver); } + /** + * + * + *
+     * Creates a Diagnostic File and runs Diagnostic Tool given an Instance.
+     * 
+ */ + public void diagnoseInstance( + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDiagnoseInstanceMethod(), responseObserver); + } + /** * * @@ -2187,6 +2244,12 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.notebooks.v1.RollbackInstanceRequest, com.google.longrunning.Operation>(this, METHODID_ROLLBACK_INSTANCE))) + .addMethod( + getDiagnoseInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_DIAGNOSE_INSTANCE))) .addMethod( getUpgradeInstanceInternalMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -2611,6 +2674,22 @@ public void rollbackInstance( responseObserver); } + /** + * + * + *
+     * Creates a Diagnostic File and runs Diagnostic Tool given an Instance.
+     * 
+ */ + public void diagnoseInstance( + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDiagnoseInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -3113,6 +3192,19 @@ public com.google.longrunning.Operation rollbackInstance( getChannel(), getRollbackInstanceMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Creates a Diagnostic File and runs Diagnostic Tool given an Instance.
+     * 
+ */ + public com.google.longrunning.Operation diagnoseInstance( + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDiagnoseInstanceMethod(), getCallOptions(), request); + } + /** * * @@ -3578,6 +3670,19 @@ protected NotebookServiceFutureStub build( getChannel().newCall(getRollbackInstanceMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Creates a Diagnostic File and runs Diagnostic Tool given an Instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + diagnoseInstance(com.google.cloud.notebooks.v1.DiagnoseInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDiagnoseInstanceMethod(), getCallOptions()), request); + } + /** * * @@ -3788,20 +3893,21 @@ protected NotebookServiceFutureStub build( private static final int METHODID_GET_INSTANCE_HEALTH = 16; private static final int METHODID_UPGRADE_INSTANCE = 17; private static final int METHODID_ROLLBACK_INSTANCE = 18; - private static final int METHODID_UPGRADE_INSTANCE_INTERNAL = 19; - private static final int METHODID_LIST_ENVIRONMENTS = 20; - private static final int METHODID_GET_ENVIRONMENT = 21; - private static final int METHODID_CREATE_ENVIRONMENT = 22; - private static final int METHODID_DELETE_ENVIRONMENT = 23; - private static final int METHODID_LIST_SCHEDULES = 24; - private static final int METHODID_GET_SCHEDULE = 25; - private static final int METHODID_DELETE_SCHEDULE = 26; - private static final int METHODID_CREATE_SCHEDULE = 27; - private static final int METHODID_TRIGGER_SCHEDULE = 28; - private static final int METHODID_LIST_EXECUTIONS = 29; - private static final int METHODID_GET_EXECUTION = 30; - private static final int METHODID_DELETE_EXECUTION = 31; - private static final int METHODID_CREATE_EXECUTION = 32; + private static final int METHODID_DIAGNOSE_INSTANCE = 19; + private static final int METHODID_UPGRADE_INSTANCE_INTERNAL = 20; + private static final int METHODID_LIST_ENVIRONMENTS = 21; + private static final int METHODID_GET_ENVIRONMENT = 22; + private static final int METHODID_CREATE_ENVIRONMENT = 23; + private static final int METHODID_DELETE_ENVIRONMENT = 24; + private static final int METHODID_LIST_SCHEDULES = 25; + private static final int METHODID_GET_SCHEDULE = 26; + private static final int METHODID_DELETE_SCHEDULE = 27; + private static final int METHODID_CREATE_SCHEDULE = 28; + private static final int METHODID_TRIGGER_SCHEDULE = 29; + private static final int METHODID_LIST_EXECUTIONS = 30; + private static final int METHODID_GET_EXECUTION = 31; + private static final int METHODID_DELETE_EXECUTION = 32; + private static final int METHODID_CREATE_EXECUTION = 33; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -3922,6 +4028,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.notebooks.v1.RollbackInstanceRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_DIAGNOSE_INSTANCE: + serviceImpl.diagnoseInstance( + (com.google.cloud.notebooks.v1.DiagnoseInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_UPGRADE_INSTANCE_INTERNAL: serviceImpl.upgradeInstanceInternal( (com.google.cloud.notebooks.v1.UpgradeInstanceInternalRequest) request, @@ -4081,6 +4192,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetInstanceHealthMethod()) .addMethod(getUpgradeInstanceMethod()) .addMethod(getRollbackInstanceMethod()) + .addMethod(getDiagnoseInstanceMethod()) .addMethod(getUpgradeInstanceInternalMethod()) .addMethod(getListEnvironmentsMethod()) .addMethod(getGetEnvironmentMethod()) diff --git a/java-notebooks/grpc-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceGrpc.java b/java-notebooks/grpc-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceGrpc.java index 2858762ac09d..eb0fea688128 100644 --- a/java-notebooks/grpc-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceGrpc.java +++ b/java-notebooks/grpc-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/NotebookServiceGrpc.java @@ -1150,8 +1150,10 @@ public void reportInstanceInfo( * *
      * Check if a notebook instance is upgradable.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public void isInstanceUpgradeable( com.google.cloud.notebooks.v1beta1.IsInstanceUpgradeableRequest request, io.grpc.stub.StreamObserver< @@ -1166,8 +1168,10 @@ public void isInstanceUpgradeable( * *
      * Upgrades a notebook instance to the latest version.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public void upgradeInstance( com.google.cloud.notebooks.v1beta1.UpgradeInstanceRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -1181,8 +1185,10 @@ public void upgradeInstance( *
      * Allows notebook instances to
      * call this endpoint to upgrade themselves. Do not use this method directly.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public void upgradeInstanceInternal( com.google.cloud.notebooks.v1beta1.UpgradeInstanceInternalRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -1595,8 +1601,10 @@ public void reportInstanceInfo( * *
      * Check if a notebook instance is upgradable.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public void isInstanceUpgradeable( com.google.cloud.notebooks.v1beta1.IsInstanceUpgradeableRequest request, io.grpc.stub.StreamObserver< @@ -1613,8 +1621,10 @@ public void isInstanceUpgradeable( * *
      * Upgrades a notebook instance to the latest version.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public void upgradeInstance( com.google.cloud.notebooks.v1beta1.UpgradeInstanceRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -1630,8 +1640,10 @@ public void upgradeInstance( *
      * Allows notebook instances to
      * call this endpoint to upgrade themselves. Do not use this method directly.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public void upgradeInstanceInternal( com.google.cloud.notebooks.v1beta1.UpgradeInstanceInternalRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -1894,8 +1906,10 @@ public com.google.longrunning.Operation reportInstanceInfo( * *
      * Check if a notebook instance is upgradable.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public com.google.cloud.notebooks.v1beta1.IsInstanceUpgradeableResponse isInstanceUpgradeable( com.google.cloud.notebooks.v1beta1.IsInstanceUpgradeableRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( @@ -1907,8 +1921,10 @@ public com.google.cloud.notebooks.v1beta1.IsInstanceUpgradeableResponse isInstan * *
      * Upgrades a notebook instance to the latest version.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public com.google.longrunning.Operation upgradeInstance( com.google.cloud.notebooks.v1beta1.UpgradeInstanceRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( @@ -1921,8 +1937,10 @@ public com.google.longrunning.Operation upgradeInstance( *
      * Allows notebook instances to
      * call this endpoint to upgrade themselves. Do not use this method directly.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public com.google.longrunning.Operation upgradeInstanceInternal( com.google.cloud.notebooks.v1beta1.UpgradeInstanceInternalRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( @@ -2172,8 +2190,10 @@ protected NotebookServiceFutureStub build( * *
      * Check if a notebook instance is upgradable.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.notebooks.v1beta1.IsInstanceUpgradeableResponse> isInstanceUpgradeable( @@ -2187,8 +2207,10 @@ protected NotebookServiceFutureStub build( * *
      * Upgrades a notebook instance to the latest version.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public com.google.common.util.concurrent.ListenableFuture upgradeInstance(com.google.cloud.notebooks.v1beta1.UpgradeInstanceRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( @@ -2201,8 +2223,10 @@ protected NotebookServiceFutureStub build( *
      * Allows notebook instances to
      * call this endpoint to upgrade themselves. Do not use this method directly.
+     * Deprecated. Please consider using v1.
      * 
*/ + @java.lang.Deprecated public com.google.common.util.concurrent.ListenableFuture upgradeInstanceInternal( com.google.cloud.notebooks.v1beta1.UpgradeInstanceInternalRequest request) { diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseInstanceRequest.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseInstanceRequest.java new file mode 100644 index 000000000000..7091149d54cc --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseInstanceRequest.java @@ -0,0 +1,930 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1/service.proto + +package com.google.cloud.notebooks.v1; + +/** + * + * + *
+ * Request for creating a notebook instance diagnostic file.
+ * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1.DiagnoseInstanceRequest} + */ +public final class DiagnoseInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.notebooks.v1.DiagnoseInstanceRequest) + DiagnoseInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DiagnoseInstanceRequest.newBuilder() to construct. + private DiagnoseInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DiagnoseInstanceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DiagnoseInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1.NotebooksProto + .internal_static_google_cloud_notebooks_v1_DiagnoseInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1.NotebooksProto + .internal_static_google_cloud_notebooks_v1_DiagnoseInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest.class, + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIAGNOSTIC_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.notebooks.v1.DiagnosticConfig diagnosticConfig_; + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the diagnosticConfig field is set. + */ + @java.lang.Override + public boolean hasDiagnosticConfig() { + return diagnosticConfig_ != null; + } + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The diagnosticConfig. + */ + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnosticConfig getDiagnosticConfig() { + return diagnosticConfig_ == null + ? com.google.cloud.notebooks.v1.DiagnosticConfig.getDefaultInstance() + : diagnosticConfig_; + } + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder getDiagnosticConfigOrBuilder() { + return getDiagnosticConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (diagnosticConfig_ != null) { + output.writeMessage(2, getDiagnosticConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (diagnosticConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDiagnosticConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.notebooks.v1.DiagnoseInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest other = + (com.google.cloud.notebooks.v1.DiagnoseInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasDiagnosticConfig() != other.hasDiagnosticConfig()) return false; + if (hasDiagnosticConfig()) { + if (!getDiagnosticConfig().equals(other.getDiagnosticConfig())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasDiagnosticConfig()) { + hash = (37 * hash) + DIAGNOSTIC_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDiagnosticConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for creating a notebook instance diagnostic file.
+   * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1.DiagnoseInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.notebooks.v1.DiagnoseInstanceRequest) + com.google.cloud.notebooks.v1.DiagnoseInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1.NotebooksProto + .internal_static_google_cloud_notebooks_v1_DiagnoseInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1.NotebooksProto + .internal_static_google_cloud_notebooks_v1_DiagnoseInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest.class, + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.notebooks.v1.DiagnoseInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (diagnosticConfigBuilder_ == null) { + diagnosticConfig_ = null; + } else { + diagnosticConfig_ = null; + diagnosticConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.notebooks.v1.NotebooksProto + .internal_static_google_cloud_notebooks_v1_DiagnoseInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnoseInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.notebooks.v1.DiagnoseInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnoseInstanceRequest build() { + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnoseInstanceRequest buildPartial() { + com.google.cloud.notebooks.v1.DiagnoseInstanceRequest result = + new com.google.cloud.notebooks.v1.DiagnoseInstanceRequest(this); + result.name_ = name_; + if (diagnosticConfigBuilder_ == null) { + result.diagnosticConfig_ = diagnosticConfig_; + } else { + result.diagnosticConfig_ = diagnosticConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.notebooks.v1.DiagnoseInstanceRequest) { + return mergeFrom((com.google.cloud.notebooks.v1.DiagnoseInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.notebooks.v1.DiagnoseInstanceRequest other) { + if (other == com.google.cloud.notebooks.v1.DiagnoseInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasDiagnosticConfig()) { + mergeDiagnosticConfig(other.getDiagnosticConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage( + getDiagnosticConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.notebooks.v1.DiagnosticConfig diagnosticConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1.DiagnosticConfig, + com.google.cloud.notebooks.v1.DiagnosticConfig.Builder, + com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder> + diagnosticConfigBuilder_; + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the diagnosticConfig field is set. + */ + public boolean hasDiagnosticConfig() { + return diagnosticConfigBuilder_ != null || diagnosticConfig_ != null; + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The diagnosticConfig. + */ + public com.google.cloud.notebooks.v1.DiagnosticConfig getDiagnosticConfig() { + if (diagnosticConfigBuilder_ == null) { + return diagnosticConfig_ == null + ? com.google.cloud.notebooks.v1.DiagnosticConfig.getDefaultInstance() + : diagnosticConfig_; + } else { + return diagnosticConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDiagnosticConfig(com.google.cloud.notebooks.v1.DiagnosticConfig value) { + if (diagnosticConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diagnosticConfig_ = value; + onChanged(); + } else { + diagnosticConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDiagnosticConfig( + com.google.cloud.notebooks.v1.DiagnosticConfig.Builder builderForValue) { + if (diagnosticConfigBuilder_ == null) { + diagnosticConfig_ = builderForValue.build(); + onChanged(); + } else { + diagnosticConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDiagnosticConfig(com.google.cloud.notebooks.v1.DiagnosticConfig value) { + if (diagnosticConfigBuilder_ == null) { + if (diagnosticConfig_ != null) { + diagnosticConfig_ = + com.google.cloud.notebooks.v1.DiagnosticConfig.newBuilder(diagnosticConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + diagnosticConfig_ = value; + } + onChanged(); + } else { + diagnosticConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDiagnosticConfig() { + if (diagnosticConfigBuilder_ == null) { + diagnosticConfig_ = null; + onChanged(); + } else { + diagnosticConfig_ = null; + diagnosticConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.notebooks.v1.DiagnosticConfig.Builder getDiagnosticConfigBuilder() { + + onChanged(); + return getDiagnosticConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder getDiagnosticConfigOrBuilder() { + if (diagnosticConfigBuilder_ != null) { + return diagnosticConfigBuilder_.getMessageOrBuilder(); + } else { + return diagnosticConfig_ == null + ? com.google.cloud.notebooks.v1.DiagnosticConfig.getDefaultInstance() + : diagnosticConfig_; + } + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1.DiagnosticConfig, + com.google.cloud.notebooks.v1.DiagnosticConfig.Builder, + com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder> + getDiagnosticConfigFieldBuilder() { + if (diagnosticConfigBuilder_ == null) { + diagnosticConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1.DiagnosticConfig, + com.google.cloud.notebooks.v1.DiagnosticConfig.Builder, + com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder>( + getDiagnosticConfig(), getParentForChildren(), isClean()); + diagnosticConfig_ = null; + } + return diagnosticConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.notebooks.v1.DiagnoseInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.notebooks.v1.DiagnoseInstanceRequest) + private static final com.google.cloud.notebooks.v1.DiagnoseInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.notebooks.v1.DiagnoseInstanceRequest(); + } + + public static com.google.cloud.notebooks.v1.DiagnoseInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DiagnoseInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnoseInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseInstanceRequestOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..ffd70107b60c --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseInstanceRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1/service.proto + +package com.google.cloud.notebooks.v1; + +public interface DiagnoseInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.notebooks.v1.DiagnoseInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the diagnosticConfig field is set. + */ + boolean hasDiagnosticConfig(); + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The diagnosticConfig. + */ + com.google.cloud.notebooks.v1.DiagnosticConfig getDiagnosticConfig(); + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder getDiagnosticConfigOrBuilder(); +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseRuntimeRequest.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseRuntimeRequest.java new file mode 100644 index 000000000000..e850cbffe92e --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseRuntimeRequest.java @@ -0,0 +1,929 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1/managed_service.proto + +package com.google.cloud.notebooks.v1; + +/** + * + * + *
+ * Request for creating a notebook instance diagnostic file.
+ * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1.DiagnoseRuntimeRequest} + */ +public final class DiagnoseRuntimeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.notebooks.v1.DiagnoseRuntimeRequest) + DiagnoseRuntimeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DiagnoseRuntimeRequest.newBuilder() to construct. + private DiagnoseRuntimeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DiagnoseRuntimeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DiagnoseRuntimeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_DiagnoseRuntimeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_DiagnoseRuntimeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest.class, + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIAGNOSTIC_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.notebooks.v1.DiagnosticConfig diagnosticConfig_; + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the diagnosticConfig field is set. + */ + @java.lang.Override + public boolean hasDiagnosticConfig() { + return diagnosticConfig_ != null; + } + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The diagnosticConfig. + */ + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnosticConfig getDiagnosticConfig() { + return diagnosticConfig_ == null + ? com.google.cloud.notebooks.v1.DiagnosticConfig.getDefaultInstance() + : diagnosticConfig_; + } + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder getDiagnosticConfigOrBuilder() { + return getDiagnosticConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (diagnosticConfig_ != null) { + output.writeMessage(2, getDiagnosticConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (diagnosticConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDiagnosticConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest)) { + return super.equals(obj); + } + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest other = + (com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasDiagnosticConfig() != other.hasDiagnosticConfig()) return false; + if (hasDiagnosticConfig()) { + if (!getDiagnosticConfig().equals(other.getDiagnosticConfig())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasDiagnosticConfig()) { + hash = (37 * hash) + DIAGNOSTIC_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDiagnosticConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for creating a notebook instance diagnostic file.
+   * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1.DiagnoseRuntimeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.notebooks.v1.DiagnoseRuntimeRequest) + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_DiagnoseRuntimeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_DiagnoseRuntimeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest.class, + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest.Builder.class); + } + + // Construct using com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (diagnosticConfigBuilder_ == null) { + diagnosticConfig_ = null; + } else { + diagnosticConfig_ = null; + diagnosticConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_DiagnoseRuntimeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest getDefaultInstanceForType() { + return com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest build() { + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest buildPartial() { + com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest result = + new com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest(this); + result.name_ = name_; + if (diagnosticConfigBuilder_ == null) { + result.diagnosticConfig_ = diagnosticConfig_; + } else { + result.diagnosticConfig_ = diagnosticConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest) { + return mergeFrom((com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest other) { + if (other == com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasDiagnosticConfig()) { + mergeDiagnosticConfig(other.getDiagnosticConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage( + getDiagnosticConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.notebooks.v1.DiagnosticConfig diagnosticConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1.DiagnosticConfig, + com.google.cloud.notebooks.v1.DiagnosticConfig.Builder, + com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder> + diagnosticConfigBuilder_; + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the diagnosticConfig field is set. + */ + public boolean hasDiagnosticConfig() { + return diagnosticConfigBuilder_ != null || diagnosticConfig_ != null; + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The diagnosticConfig. + */ + public com.google.cloud.notebooks.v1.DiagnosticConfig getDiagnosticConfig() { + if (diagnosticConfigBuilder_ == null) { + return diagnosticConfig_ == null + ? com.google.cloud.notebooks.v1.DiagnosticConfig.getDefaultInstance() + : diagnosticConfig_; + } else { + return diagnosticConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDiagnosticConfig(com.google.cloud.notebooks.v1.DiagnosticConfig value) { + if (diagnosticConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diagnosticConfig_ = value; + onChanged(); + } else { + diagnosticConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDiagnosticConfig( + com.google.cloud.notebooks.v1.DiagnosticConfig.Builder builderForValue) { + if (diagnosticConfigBuilder_ == null) { + diagnosticConfig_ = builderForValue.build(); + onChanged(); + } else { + diagnosticConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDiagnosticConfig(com.google.cloud.notebooks.v1.DiagnosticConfig value) { + if (diagnosticConfigBuilder_ == null) { + if (diagnosticConfig_ != null) { + diagnosticConfig_ = + com.google.cloud.notebooks.v1.DiagnosticConfig.newBuilder(diagnosticConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + diagnosticConfig_ = value; + } + onChanged(); + } else { + diagnosticConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDiagnosticConfig() { + if (diagnosticConfigBuilder_ == null) { + diagnosticConfig_ = null; + onChanged(); + } else { + diagnosticConfig_ = null; + diagnosticConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.notebooks.v1.DiagnosticConfig.Builder getDiagnosticConfigBuilder() { + + onChanged(); + return getDiagnosticConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder getDiagnosticConfigOrBuilder() { + if (diagnosticConfigBuilder_ != null) { + return diagnosticConfigBuilder_.getMessageOrBuilder(); + } else { + return diagnosticConfig_ == null + ? com.google.cloud.notebooks.v1.DiagnosticConfig.getDefaultInstance() + : diagnosticConfig_; + } + } + /** + * + * + *
+     * Required. Defines flags that are used to run the diagnostic tool
+     * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1.DiagnosticConfig, + com.google.cloud.notebooks.v1.DiagnosticConfig.Builder, + com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder> + getDiagnosticConfigFieldBuilder() { + if (diagnosticConfigBuilder_ == null) { + diagnosticConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1.DiagnosticConfig, + com.google.cloud.notebooks.v1.DiagnosticConfig.Builder, + com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder>( + getDiagnosticConfig(), getParentForChildren(), isClean()); + diagnosticConfig_ = null; + } + return diagnosticConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.notebooks.v1.DiagnoseRuntimeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.notebooks.v1.DiagnoseRuntimeRequest) + private static final com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest(); + } + + public static com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DiagnoseRuntimeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseRuntimeRequestOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseRuntimeRequestOrBuilder.java new file mode 100644 index 000000000000..63c53a122e0e --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnoseRuntimeRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1/managed_service.proto + +package com.google.cloud.notebooks.v1; + +public interface DiagnoseRuntimeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.notebooks.v1.DiagnoseRuntimeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the diagnosticConfig field is set. + */ + boolean hasDiagnosticConfig(); + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The diagnosticConfig. + */ + com.google.cloud.notebooks.v1.DiagnosticConfig getDiagnosticConfig(); + /** + * + * + *
+   * Required. Defines flags that are used to run the diagnostic tool
+   * 
+ * + * + * .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder getDiagnosticConfigOrBuilder(); +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfig.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfig.java new file mode 100644 index 000000000000..2b22fdda9fd2 --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfig.java @@ -0,0 +1,1156 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1/diagnostic_config.proto + +package com.google.cloud.notebooks.v1; + +/** + * + * + *
+ * Defines flags that are used to run the diagnostic tool
+ * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1.DiagnosticConfig} + */ +public final class DiagnosticConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.notebooks.v1.DiagnosticConfig) + DiagnosticConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use DiagnosticConfig.newBuilder() to construct. + private DiagnosticConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DiagnosticConfig() { + gcsBucket_ = ""; + relativePath_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DiagnosticConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1.DiagnosticConfigProto + .internal_static_google_cloud_notebooks_v1_DiagnosticConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1.DiagnosticConfigProto + .internal_static_google_cloud_notebooks_v1_DiagnosticConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1.DiagnosticConfig.class, + com.google.cloud.notebooks.v1.DiagnosticConfig.Builder.class); + } + + public static final int GCS_BUCKET_FIELD_NUMBER = 1; + private volatile java.lang.Object gcsBucket_; + /** + * + * + *
+   * Required. User Cloud Storage bucket location (REQUIRED)
+   * ## Must be formatted with path prefix (gs://$GCS_BUCKET)
+   * Permissions:
+   * User Managed Notebooks:
+   * - storage.buckets.writer: Must be given to the project's service account
+   * attached to VM.
+   * Google Managed Notebooks:
+   * - storage.buckets.writer: Must be given to the project's service account or
+   * ## user credentials attached to VM depending on authentication mode.
+   * Cloud Storage bucket Log file will be written to
+   * gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz
+   * 
+ * + * string gcs_bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The gcsBucket. + */ + @java.lang.Override + public java.lang.String getGcsBucket() { + java.lang.Object ref = gcsBucket_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gcsBucket_ = s; + return s; + } + } + /** + * + * + *
+   * Required. User Cloud Storage bucket location (REQUIRED)
+   * ## Must be formatted with path prefix (gs://$GCS_BUCKET)
+   * Permissions:
+   * User Managed Notebooks:
+   * - storage.buckets.writer: Must be given to the project's service account
+   * attached to VM.
+   * Google Managed Notebooks:
+   * - storage.buckets.writer: Must be given to the project's service account or
+   * ## user credentials attached to VM depending on authentication mode.
+   * Cloud Storage bucket Log file will be written to
+   * gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz
+   * 
+ * + * string gcs_bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for gcsBucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGcsBucketBytes() { + java.lang.Object ref = gcsBucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcsBucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RELATIVE_PATH_FIELD_NUMBER = 2; + private volatile java.lang.Object relativePath_; + /** + * + * + *
+   * Optional. Defines the relative storage path in the Cloud Storage bucket where the
+   * diagnostic logs will be written: Default path will be the root directory of
+   * the Cloud Storage bucket (gs://$GCS_BUCKET/$DATE_$TIME.tar.gz) Example of
+   * full path where Log file will be written: gs://$GCS_BUCKET/$RELATIVE_PATH/
+   * 
+ * + * string relative_path = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The relativePath. + */ + @java.lang.Override + public java.lang.String getRelativePath() { + java.lang.Object ref = relativePath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + relativePath_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Defines the relative storage path in the Cloud Storage bucket where the
+   * diagnostic logs will be written: Default path will be the root directory of
+   * the Cloud Storage bucket (gs://$GCS_BUCKET/$DATE_$TIME.tar.gz) Example of
+   * full path where Log file will be written: gs://$GCS_BUCKET/$RELATIVE_PATH/
+   * 
+ * + * string relative_path = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for relativePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRelativePathBytes() { + java.lang.Object ref = relativePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + relativePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPAIR_FLAG_ENABLED_FIELD_NUMBER = 3; + private boolean repairFlagEnabled_; + /** + * + * + *
+   * Optional. Enables flag to repair service for instance
+   * 
+ * + * bool repair_flag_enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The repairFlagEnabled. + */ + @java.lang.Override + public boolean getRepairFlagEnabled() { + return repairFlagEnabled_; + } + + public static final int PACKET_CAPTURE_FLAG_ENABLED_FIELD_NUMBER = 4; + private boolean packetCaptureFlagEnabled_; + /** + * + * + *
+   * Optional. Enables flag to capture packets from the instance for 30 seconds
+   * 
+ * + * bool packet_capture_flag_enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The packetCaptureFlagEnabled. + */ + @java.lang.Override + public boolean getPacketCaptureFlagEnabled() { + return packetCaptureFlagEnabled_; + } + + public static final int COPY_HOME_FILES_FLAG_ENABLED_FIELD_NUMBER = 5; + private boolean copyHomeFilesFlagEnabled_; + /** + * + * + *
+   * Optional. Enables flag to copy all `/home/jupyter` folder contents
+   * 
+ * + * bool copy_home_files_flag_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The copyHomeFilesFlagEnabled. + */ + @java.lang.Override + public boolean getCopyHomeFilesFlagEnabled() { + return copyHomeFilesFlagEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsBucket_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gcsBucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(relativePath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, relativePath_); + } + if (repairFlagEnabled_ != false) { + output.writeBool(3, repairFlagEnabled_); + } + if (packetCaptureFlagEnabled_ != false) { + output.writeBool(4, packetCaptureFlagEnabled_); + } + if (copyHomeFilesFlagEnabled_ != false) { + output.writeBool(5, copyHomeFilesFlagEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsBucket_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gcsBucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(relativePath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, relativePath_); + } + if (repairFlagEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, repairFlagEnabled_); + } + if (packetCaptureFlagEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, packetCaptureFlagEnabled_); + } + if (copyHomeFilesFlagEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, copyHomeFilesFlagEnabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.notebooks.v1.DiagnosticConfig)) { + return super.equals(obj); + } + com.google.cloud.notebooks.v1.DiagnosticConfig other = + (com.google.cloud.notebooks.v1.DiagnosticConfig) obj; + + if (!getGcsBucket().equals(other.getGcsBucket())) return false; + if (!getRelativePath().equals(other.getRelativePath())) return false; + if (getRepairFlagEnabled() != other.getRepairFlagEnabled()) return false; + if (getPacketCaptureFlagEnabled() != other.getPacketCaptureFlagEnabled()) return false; + if (getCopyHomeFilesFlagEnabled() != other.getCopyHomeFilesFlagEnabled()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + GCS_BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getGcsBucket().hashCode(); + hash = (37 * hash) + RELATIVE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getRelativePath().hashCode(); + hash = (37 * hash) + REPAIR_FLAG_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRepairFlagEnabled()); + hash = (37 * hash) + PACKET_CAPTURE_FLAG_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPacketCaptureFlagEnabled()); + hash = (37 * hash) + COPY_HOME_FILES_FLAG_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCopyHomeFilesFlagEnabled()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.notebooks.v1.DiagnosticConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines flags that are used to run the diagnostic tool
+   * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1.DiagnosticConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.notebooks.v1.DiagnosticConfig) + com.google.cloud.notebooks.v1.DiagnosticConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1.DiagnosticConfigProto + .internal_static_google_cloud_notebooks_v1_DiagnosticConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1.DiagnosticConfigProto + .internal_static_google_cloud_notebooks_v1_DiagnosticConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1.DiagnosticConfig.class, + com.google.cloud.notebooks.v1.DiagnosticConfig.Builder.class); + } + + // Construct using com.google.cloud.notebooks.v1.DiagnosticConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + gcsBucket_ = ""; + + relativePath_ = ""; + + repairFlagEnabled_ = false; + + packetCaptureFlagEnabled_ = false; + + copyHomeFilesFlagEnabled_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.notebooks.v1.DiagnosticConfigProto + .internal_static_google_cloud_notebooks_v1_DiagnosticConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnosticConfig getDefaultInstanceForType() { + return com.google.cloud.notebooks.v1.DiagnosticConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnosticConfig build() { + com.google.cloud.notebooks.v1.DiagnosticConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnosticConfig buildPartial() { + com.google.cloud.notebooks.v1.DiagnosticConfig result = + new com.google.cloud.notebooks.v1.DiagnosticConfig(this); + result.gcsBucket_ = gcsBucket_; + result.relativePath_ = relativePath_; + result.repairFlagEnabled_ = repairFlagEnabled_; + result.packetCaptureFlagEnabled_ = packetCaptureFlagEnabled_; + result.copyHomeFilesFlagEnabled_ = copyHomeFilesFlagEnabled_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.notebooks.v1.DiagnosticConfig) { + return mergeFrom((com.google.cloud.notebooks.v1.DiagnosticConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.notebooks.v1.DiagnosticConfig other) { + if (other == com.google.cloud.notebooks.v1.DiagnosticConfig.getDefaultInstance()) return this; + if (!other.getGcsBucket().isEmpty()) { + gcsBucket_ = other.gcsBucket_; + onChanged(); + } + if (!other.getRelativePath().isEmpty()) { + relativePath_ = other.relativePath_; + onChanged(); + } + if (other.getRepairFlagEnabled() != false) { + setRepairFlagEnabled(other.getRepairFlagEnabled()); + } + if (other.getPacketCaptureFlagEnabled() != false) { + setPacketCaptureFlagEnabled(other.getPacketCaptureFlagEnabled()); + } + if (other.getCopyHomeFilesFlagEnabled() != false) { + setCopyHomeFilesFlagEnabled(other.getCopyHomeFilesFlagEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + gcsBucket_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + relativePath_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 24: + { + repairFlagEnabled_ = input.readBool(); + + break; + } // case 24 + case 32: + { + packetCaptureFlagEnabled_ = input.readBool(); + + break; + } // case 32 + case 40: + { + copyHomeFilesFlagEnabled_ = input.readBool(); + + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object gcsBucket_ = ""; + /** + * + * + *
+     * Required. User Cloud Storage bucket location (REQUIRED)
+     * ## Must be formatted with path prefix (gs://$GCS_BUCKET)
+     * Permissions:
+     * User Managed Notebooks:
+     * - storage.buckets.writer: Must be given to the project's service account
+     * attached to VM.
+     * Google Managed Notebooks:
+     * - storage.buckets.writer: Must be given to the project's service account or
+     * ## user credentials attached to VM depending on authentication mode.
+     * Cloud Storage bucket Log file will be written to
+     * gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz
+     * 
+ * + * string gcs_bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The gcsBucket. + */ + public java.lang.String getGcsBucket() { + java.lang.Object ref = gcsBucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gcsBucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. User Cloud Storage bucket location (REQUIRED)
+     * ## Must be formatted with path prefix (gs://$GCS_BUCKET)
+     * Permissions:
+     * User Managed Notebooks:
+     * - storage.buckets.writer: Must be given to the project's service account
+     * attached to VM.
+     * Google Managed Notebooks:
+     * - storage.buckets.writer: Must be given to the project's service account or
+     * ## user credentials attached to VM depending on authentication mode.
+     * Cloud Storage bucket Log file will be written to
+     * gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz
+     * 
+ * + * string gcs_bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for gcsBucket. + */ + public com.google.protobuf.ByteString getGcsBucketBytes() { + java.lang.Object ref = gcsBucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcsBucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. User Cloud Storage bucket location (REQUIRED)
+     * ## Must be formatted with path prefix (gs://$GCS_BUCKET)
+     * Permissions:
+     * User Managed Notebooks:
+     * - storage.buckets.writer: Must be given to the project's service account
+     * attached to VM.
+     * Google Managed Notebooks:
+     * - storage.buckets.writer: Must be given to the project's service account or
+     * ## user credentials attached to VM depending on authentication mode.
+     * Cloud Storage bucket Log file will be written to
+     * gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz
+     * 
+ * + * string gcs_bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The gcsBucket to set. + * @return This builder for chaining. + */ + public Builder setGcsBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gcsBucket_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User Cloud Storage bucket location (REQUIRED)
+     * ## Must be formatted with path prefix (gs://$GCS_BUCKET)
+     * Permissions:
+     * User Managed Notebooks:
+     * - storage.buckets.writer: Must be given to the project's service account
+     * attached to VM.
+     * Google Managed Notebooks:
+     * - storage.buckets.writer: Must be given to the project's service account or
+     * ## user credentials attached to VM depending on authentication mode.
+     * Cloud Storage bucket Log file will be written to
+     * gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz
+     * 
+ * + * string gcs_bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearGcsBucket() { + + gcsBucket_ = getDefaultInstance().getGcsBucket(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User Cloud Storage bucket location (REQUIRED)
+     * ## Must be formatted with path prefix (gs://$GCS_BUCKET)
+     * Permissions:
+     * User Managed Notebooks:
+     * - storage.buckets.writer: Must be given to the project's service account
+     * attached to VM.
+     * Google Managed Notebooks:
+     * - storage.buckets.writer: Must be given to the project's service account or
+     * ## user credentials attached to VM depending on authentication mode.
+     * Cloud Storage bucket Log file will be written to
+     * gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz
+     * 
+ * + * string gcs_bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for gcsBucket to set. + * @return This builder for chaining. + */ + public Builder setGcsBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gcsBucket_ = value; + onChanged(); + return this; + } + + private java.lang.Object relativePath_ = ""; + /** + * + * + *
+     * Optional. Defines the relative storage path in the Cloud Storage bucket where the
+     * diagnostic logs will be written: Default path will be the root directory of
+     * the Cloud Storage bucket (gs://$GCS_BUCKET/$DATE_$TIME.tar.gz) Example of
+     * full path where Log file will be written: gs://$GCS_BUCKET/$RELATIVE_PATH/
+     * 
+ * + * string relative_path = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The relativePath. + */ + public java.lang.String getRelativePath() { + java.lang.Object ref = relativePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + relativePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Defines the relative storage path in the Cloud Storage bucket where the
+     * diagnostic logs will be written: Default path will be the root directory of
+     * the Cloud Storage bucket (gs://$GCS_BUCKET/$DATE_$TIME.tar.gz) Example of
+     * full path where Log file will be written: gs://$GCS_BUCKET/$RELATIVE_PATH/
+     * 
+ * + * string relative_path = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for relativePath. + */ + public com.google.protobuf.ByteString getRelativePathBytes() { + java.lang.Object ref = relativePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + relativePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Defines the relative storage path in the Cloud Storage bucket where the
+     * diagnostic logs will be written: Default path will be the root directory of
+     * the Cloud Storage bucket (gs://$GCS_BUCKET/$DATE_$TIME.tar.gz) Example of
+     * full path where Log file will be written: gs://$GCS_BUCKET/$RELATIVE_PATH/
+     * 
+ * + * string relative_path = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The relativePath to set. + * @return This builder for chaining. + */ + public Builder setRelativePath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + relativePath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Defines the relative storage path in the Cloud Storage bucket where the
+     * diagnostic logs will be written: Default path will be the root directory of
+     * the Cloud Storage bucket (gs://$GCS_BUCKET/$DATE_$TIME.tar.gz) Example of
+     * full path where Log file will be written: gs://$GCS_BUCKET/$RELATIVE_PATH/
+     * 
+ * + * string relative_path = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRelativePath() { + + relativePath_ = getDefaultInstance().getRelativePath(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Defines the relative storage path in the Cloud Storage bucket where the
+     * diagnostic logs will be written: Default path will be the root directory of
+     * the Cloud Storage bucket (gs://$GCS_BUCKET/$DATE_$TIME.tar.gz) Example of
+     * full path where Log file will be written: gs://$GCS_BUCKET/$RELATIVE_PATH/
+     * 
+ * + * string relative_path = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for relativePath to set. + * @return This builder for chaining. + */ + public Builder setRelativePathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + relativePath_ = value; + onChanged(); + return this; + } + + private boolean repairFlagEnabled_; + /** + * + * + *
+     * Optional. Enables flag to repair service for instance
+     * 
+ * + * bool repair_flag_enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The repairFlagEnabled. + */ + @java.lang.Override + public boolean getRepairFlagEnabled() { + return repairFlagEnabled_; + } + /** + * + * + *
+     * Optional. Enables flag to repair service for instance
+     * 
+ * + * bool repair_flag_enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The repairFlagEnabled to set. + * @return This builder for chaining. + */ + public Builder setRepairFlagEnabled(boolean value) { + + repairFlagEnabled_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Enables flag to repair service for instance
+     * 
+ * + * bool repair_flag_enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRepairFlagEnabled() { + + repairFlagEnabled_ = false; + onChanged(); + return this; + } + + private boolean packetCaptureFlagEnabled_; + /** + * + * + *
+     * Optional. Enables flag to capture packets from the instance for 30 seconds
+     * 
+ * + * bool packet_capture_flag_enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The packetCaptureFlagEnabled. + */ + @java.lang.Override + public boolean getPacketCaptureFlagEnabled() { + return packetCaptureFlagEnabled_; + } + /** + * + * + *
+     * Optional. Enables flag to capture packets from the instance for 30 seconds
+     * 
+ * + * bool packet_capture_flag_enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The packetCaptureFlagEnabled to set. + * @return This builder for chaining. + */ + public Builder setPacketCaptureFlagEnabled(boolean value) { + + packetCaptureFlagEnabled_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Enables flag to capture packets from the instance for 30 seconds
+     * 
+ * + * bool packet_capture_flag_enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPacketCaptureFlagEnabled() { + + packetCaptureFlagEnabled_ = false; + onChanged(); + return this; + } + + private boolean copyHomeFilesFlagEnabled_; + /** + * + * + *
+     * Optional. Enables flag to copy all `/home/jupyter` folder contents
+     * 
+ * + * bool copy_home_files_flag_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The copyHomeFilesFlagEnabled. + */ + @java.lang.Override + public boolean getCopyHomeFilesFlagEnabled() { + return copyHomeFilesFlagEnabled_; + } + /** + * + * + *
+     * Optional. Enables flag to copy all `/home/jupyter` folder contents
+     * 
+ * + * bool copy_home_files_flag_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The copyHomeFilesFlagEnabled to set. + * @return This builder for chaining. + */ + public Builder setCopyHomeFilesFlagEnabled(boolean value) { + + copyHomeFilesFlagEnabled_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Enables flag to copy all `/home/jupyter` folder contents
+     * 
+ * + * bool copy_home_files_flag_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCopyHomeFilesFlagEnabled() { + + copyHomeFilesFlagEnabled_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.notebooks.v1.DiagnosticConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.notebooks.v1.DiagnosticConfig) + private static final com.google.cloud.notebooks.v1.DiagnosticConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.notebooks.v1.DiagnosticConfig(); + } + + public static com.google.cloud.notebooks.v1.DiagnosticConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DiagnosticConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.DiagnosticConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfigOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfigOrBuilder.java new file mode 100644 index 000000000000..900fec64cd7c --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfigOrBuilder.java @@ -0,0 +1,140 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1/diagnostic_config.proto + +package com.google.cloud.notebooks.v1; + +public interface DiagnosticConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.notebooks.v1.DiagnosticConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. User Cloud Storage bucket location (REQUIRED)
+   * ## Must be formatted with path prefix (gs://$GCS_BUCKET)
+   * Permissions:
+   * User Managed Notebooks:
+   * - storage.buckets.writer: Must be given to the project's service account
+   * attached to VM.
+   * Google Managed Notebooks:
+   * - storage.buckets.writer: Must be given to the project's service account or
+   * ## user credentials attached to VM depending on authentication mode.
+   * Cloud Storage bucket Log file will be written to
+   * gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz
+   * 
+ * + * string gcs_bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The gcsBucket. + */ + java.lang.String getGcsBucket(); + /** + * + * + *
+   * Required. User Cloud Storage bucket location (REQUIRED)
+   * ## Must be formatted with path prefix (gs://$GCS_BUCKET)
+   * Permissions:
+   * User Managed Notebooks:
+   * - storage.buckets.writer: Must be given to the project's service account
+   * attached to VM.
+   * Google Managed Notebooks:
+   * - storage.buckets.writer: Must be given to the project's service account or
+   * ## user credentials attached to VM depending on authentication mode.
+   * Cloud Storage bucket Log file will be written to
+   * gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz
+   * 
+ * + * string gcs_bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for gcsBucket. + */ + com.google.protobuf.ByteString getGcsBucketBytes(); + + /** + * + * + *
+   * Optional. Defines the relative storage path in the Cloud Storage bucket where the
+   * diagnostic logs will be written: Default path will be the root directory of
+   * the Cloud Storage bucket (gs://$GCS_BUCKET/$DATE_$TIME.tar.gz) Example of
+   * full path where Log file will be written: gs://$GCS_BUCKET/$RELATIVE_PATH/
+   * 
+ * + * string relative_path = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The relativePath. + */ + java.lang.String getRelativePath(); + /** + * + * + *
+   * Optional. Defines the relative storage path in the Cloud Storage bucket where the
+   * diagnostic logs will be written: Default path will be the root directory of
+   * the Cloud Storage bucket (gs://$GCS_BUCKET/$DATE_$TIME.tar.gz) Example of
+   * full path where Log file will be written: gs://$GCS_BUCKET/$RELATIVE_PATH/
+   * 
+ * + * string relative_path = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for relativePath. + */ + com.google.protobuf.ByteString getRelativePathBytes(); + + /** + * + * + *
+   * Optional. Enables flag to repair service for instance
+   * 
+ * + * bool repair_flag_enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The repairFlagEnabled. + */ + boolean getRepairFlagEnabled(); + + /** + * + * + *
+   * Optional. Enables flag to capture packets from the instance for 30 seconds
+   * 
+ * + * bool packet_capture_flag_enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The packetCaptureFlagEnabled. + */ + boolean getPacketCaptureFlagEnabled(); + + /** + * + * + *
+   * Optional. Enables flag to copy all `/home/jupyter` folder contents
+   * 
+ * + * bool copy_home_files_flag_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The copyHomeFilesFlagEnabled. + */ + boolean getCopyHomeFilesFlagEnabled(); +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfigProto.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfigProto.java new file mode 100644 index 000000000000..b5a22ed8acd1 --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/DiagnosticConfigProto.java @@ -0,0 +1,82 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1/diagnostic_config.proto + +package com.google.cloud.notebooks.v1; + +public final class DiagnosticConfigProto { + private DiagnosticConfigProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_notebooks_v1_DiagnosticConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_notebooks_v1_DiagnosticConfig_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/cloud/notebooks/v1/diagnostic_c" + + "onfig.proto\022\031google.cloud.notebooks.v1\032\037" + + "google/api/field_behavior.proto\"\276\001\n\020Diag" + + "nosticConfig\022\027\n\ngcs_bucket\030\001 \001(\tB\003\340A\002\022\032\n" + + "\rrelative_path\030\002 \001(\tB\003\340A\001\022 \n\023repair_flag" + + "_enabled\030\003 \001(\010B\003\340A\001\022(\n\033packet_capture_fl" + + "ag_enabled\030\004 \001(\010B\003\340A\001\022)\n\034copy_home_files" + + "_flag_enabled\030\005 \001(\010B\003\340A\001B|\n\035com.google.c" + + "loud.notebooks.v1B\025DiagnosticConfigProto" + + "P\001ZBgoogle.golang.org/genproto/googleapi" + + "s/cloud/notebooks/v1;notebooksb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + }); + internal_static_google_cloud_notebooks_v1_DiagnosticConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_notebooks_v1_DiagnosticConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_notebooks_v1_DiagnosticConfig_descriptor, + new java.lang.String[] { + "GcsBucket", + "RelativePath", + "RepairFlagEnabled", + "PacketCaptureFlagEnabled", + "CopyHomeFilesFlagEnabled", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebooksProto.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebooksProto.java index 3b4e123a8ad6..74ebd729901c 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebooksProto.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/ManagedNotebooksProto.java @@ -63,10 +63,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_notebooks_v1_ResetRuntimeRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_notebooks_v1_ResetRuntimeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_notebooks_v1_UpgradeRuntimeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_notebooks_v1_UpgradeRuntimeRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_notebooks_v1_ReportRuntimeEventRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_notebooks_v1_ReportRuntimeEventRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_notebooks_v1_UpdateRuntimeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_notebooks_v1_UpdateRuntimeRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_notebooks_v1_RefreshRuntimeTokenInternalRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -75,6 +83,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_notebooks_v1_RefreshRuntimeTokenInternalResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_notebooks_v1_RefreshRuntimeTokenInternalResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_notebooks_v1_DiagnoseRuntimeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_notebooks_v1_DiagnoseRuntimeRequest_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -88,103 +100,131 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ice.proto\022\031google.cloud.notebooks.v1\032\034go" + "ogle/api/annotations.proto\032\027google/api/c" + "lient.proto\032\037google/api/field_behavior.p" - + "roto\032\031google/api/resource.proto\032%google/" - + "cloud/notebooks/v1/event.proto\032\'google/c" - + "loud/notebooks/v1/runtime.proto\032#google/" - + "longrunning/operations.proto\032\037google/pro" - + "tobuf/timestamp.proto\"v\n\023ListRuntimesReq" - + "uest\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\022 notebooks." - + "googleapis.com/Runtime\022\021\n\tpage_size\030\002 \001(" - + "\005\022\022\n\npage_token\030\003 \001(\t\"z\n\024ListRuntimesRes" - + "ponse\0224\n\010runtimes\030\001 \003(\0132\".google.cloud.n" - + "otebooks.v1.Runtime\022\027\n\017next_page_token\030\002" - + " \001(\t\022\023\n\013unreachable\030\003 \003(\t\"K\n\021GetRuntimeR" - + "equest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n notebooks." - + "googleapis.com/Runtime\"\267\001\n\024CreateRuntime" - + "Request\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\n noteboo" - + "ks.googleapis.com/Runtime\022\027\n\nruntime_id\030" - + "\002 \001(\tB\003\340A\002\0228\n\007runtime\030\003 \001(\0132\".google.clo" - + "ud.notebooks.v1.RuntimeB\003\340A\002\022\022\n\nrequest_" - + "id\030\004 \001(\t\"b\n\024DeleteRuntimeRequest\0226\n\004name" - + "\030\001 \001(\tB(\340A\002\372A\"\n notebooks.googleapis.com" - + "/Runtime\022\022\n\nrequest_id\030\002 \001(\t\"<\n\023StartRun" - + "timeRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\022\n\nreques" - + "t_id\030\002 \001(\t\";\n\022StopRuntimeRequest\022\021\n\004name" - + "\030\001 \001(\tB\003\340A\002\022\022\n\nrequest_id\030\002 \001(\t\"\244\001\n\024Swit" - + "chRuntimeRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\024\n\014m" - + "achine_type\030\002 \001(\t\022O\n\022accelerator_config\030" - + "\003 \001(\01323.google.cloud.notebooks.v1.Runtim" - + "eAcceleratorConfig\022\022\n\nrequest_id\030\004 \001(\t\"<" - + "\n\023ResetRuntimeRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002" - + "\022\022\n\nrequest_id\030\002 \001(\t\"\235\001\n\031ReportRuntimeEv" - + "entRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n notebo" - + "oks.googleapis.com/Runtime\022\022\n\005vm_id\030\002 \001(" - + "\tB\003\340A\002\0224\n\005event\030\003 \001(\0132 .google.cloud.not" - + "ebooks.v1.EventB\003\340A\002\"p\n\"RefreshRuntimeTo" - + "kenInternalRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"" - + "\n notebooks.googleapis.com/Runtime\022\022\n\005vm" - + "_id\030\002 \001(\tB\003\340A\002\"q\n#RefreshRuntimeTokenInt" - + "ernalResponse\022\024\n\014access_token\030\001 \001(\t\0224\n\013e" - + "xpire_time\030\002 \001(\0132\032.google.protobuf.Times" - + "tampB\003\340A\0032\311\020\n\026ManagedNotebookService\022\256\001\n" - + "\014ListRuntimes\022..google.cloud.notebooks.v" - + "1.ListRuntimesRequest\032/.google.cloud.not" - + "ebooks.v1.ListRuntimesResponse\"=\202\323\344\223\002.\022," - + "/v1/{parent=projects/*/locations/*}/runt" - + "imes\332A\006parent\022\233\001\n\nGetRuntime\022,.google.cl" - + "oud.notebooks.v1.GetRuntimeRequest\032\".goo" - + "gle.cloud.notebooks.v1.Runtime\";\202\323\344\223\002.\022," - + "/v1/{name=projects/*/locations/*/runtime" - + "s/*}\332A\004name\022\331\001\n\rCreateRuntime\022/.google.c" - + "loud.notebooks.v1.CreateRuntimeRequest\032\035" - + ".google.longrunning.Operation\"x\202\323\344\223\0027\",/" - + "v1/{parent=projects/*/locations/*}/runti" - + "mes:\007runtime\332A\031parent,runtime_id,runtime" - + "\312A\034\n\007Runtime\022\021OperationMetadata\022\311\001\n\rDele" - + "teRuntime\022/.google.cloud.notebooks.v1.De" - + "leteRuntimeRequest\032\035.google.longrunning." - + "Operation\"h\202\323\344\223\002.*,/v1/{name=projects/*/" - + "locations/*/runtimes/*}\332A\004name\312A*\n\025googl" - + "e.protobuf.Empty\022\021OperationMetadata\022\302\001\n\014" - + "StartRuntime\022..google.cloud.notebooks.v1" - + ".StartRuntimeRequest\032\035.google.longrunnin" - + "g.Operation\"c\202\323\344\223\0027\"2/v1/{name=projects/" - + "*/locations/*/runtimes/*}:start:\001*\332A\004nam" - + "e\312A\034\n\007Runtime\022\021OperationMetadata\022\277\001\n\013Sto" - + "pRuntime\022-.google.cloud.notebooks.v1.Sto" - + "pRuntimeRequest\032\035.google.longrunning.Ope" - + "ration\"b\202\323\344\223\0026\"1/v1/{name=projects/*/loc" - + "ations/*/runtimes/*}:stop:\001*\332A\004name\312A\034\n\007" - + "Runtime\022\021OperationMetadata\022\305\001\n\rSwitchRun" - + "time\022/.google.cloud.notebooks.v1.SwitchR" - + "untimeRequest\032\035.google.longrunning.Opera" - + "tion\"d\202\323\344\223\0028\"3/v1/{name=projects/*/locat" - + "ions/*/runtimes/*}:switch:\001*\332A\004name\312A\034\n\007" - + "Runtime\022\021OperationMetadata\022\302\001\n\014ResetRunt" - + "ime\022..google.cloud.notebooks.v1.ResetRun" - + "timeRequest\032\035.google.longrunning.Operati" - + "on\"c\202\323\344\223\0027\"2/v1/{name=projects/*/locatio" - + "ns/*/runtimes/*}:reset:\001*\332A\004name\312A\034\n\007Run" - + "time\022\021OperationMetadata\022\324\001\n\022ReportRuntim" - + "eEvent\0224.google.cloud.notebooks.v1.Repor" - + "tRuntimeEventRequest\032\035.google.longrunnin" - + "g.Operation\"i\202\323\344\223\002=\"8/v1/{name=projects/" - + "*/locations/*/runtimes/*}:reportEvent:\001*" - + "\332A\004name\312A\034\n\007Runtime\022\021OperationMetadata\022\376" - + "\001\n\033RefreshRuntimeTokenInternal\022=.google." - + "cloud.notebooks.v1.RefreshRuntimeTokenIn" - + "ternalRequest\032>.google.cloud.notebooks.v" - + "1.RefreshRuntimeTokenInternalResponse\"`\202" - + "\323\344\223\002M\"H/v1/{name=projects/*/locations/*/" - + "runtimes/*}:refreshRuntimeTokenInternal:" - + "\001*\332A\nname,vm_id\032L\312A\030notebooks.googleapis" - + ".com\322A.https://www.googleapis.com/auth/c" - + "loud-platformB\323\001\n\035com.google.cloud.noteb" - + "ooks.v1B\025ManagedNotebooksProtoP\001ZBgoogle" - + ".golang.org/genproto/googleapis/cloud/no" - + "tebooks/v1;notebooks\252\002\031Google.Cloud.Note" - + "books.V1\312\002\031Google\\Cloud\\Notebooks\\V1\352\002\034G" - + "oogle::Cloud::Notebooks::V1b\006proto3" + + "roto\032\031google/api/resource.proto\0321google/" + + "cloud/notebooks/v1/diagnostic_config.pro" + + "to\032%google/cloud/notebooks/v1/event.prot" + + "o\032\'google/cloud/notebooks/v1/runtime.pro" + + "to\032#google/longrunning/operations.proto\032" + + " google/protobuf/field_mask.proto\032\037googl" + + "e/protobuf/timestamp.proto\"v\n\023ListRuntim" + + "esRequest\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\022 noteb" + + "ooks.googleapis.com/Runtime\022\021\n\tpage_size" + + "\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"z\n\024ListRuntim" + + "esResponse\0224\n\010runtimes\030\001 \003(\0132\".google.cl" + + "oud.notebooks.v1.Runtime\022\027\n\017next_page_to" + + "ken\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"K\n\021GetRun" + + "timeRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n noteb" + + "ooks.googleapis.com/Runtime\"\267\001\n\024CreateRu" + + "ntimeRequest\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\n no" + + "tebooks.googleapis.com/Runtime\022\027\n\nruntim" + + "e_id\030\002 \001(\tB\003\340A\002\0228\n\007runtime\030\003 \001(\0132\".googl" + + "e.cloud.notebooks.v1.RuntimeB\003\340A\002\022\022\n\nreq" + + "uest_id\030\004 \001(\t\"b\n\024DeleteRuntimeRequest\0226\n" + + "\004name\030\001 \001(\tB(\340A\002\372A\"\n notebooks.googleapi" + + "s.com/Runtime\022\022\n\nrequest_id\030\002 \001(\t\"<\n\023Sta" + + "rtRuntimeRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\022\n\nr" + + "equest_id\030\002 \001(\t\";\n\022StopRuntimeRequest\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022\022\n\nrequest_id\030\002 \001(\t\"\244\001\n" + + "\024SwitchRuntimeRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002" + + "\022\024\n\014machine_type\030\002 \001(\t\022O\n\022accelerator_co" + + "nfig\030\003 \001(\01323.google.cloud.notebooks.v1.R" + + "untimeAcceleratorConfig\022\022\n\nrequest_id\030\004 " + + "\001(\t\"<\n\023ResetRuntimeRequest\022\021\n\004name\030\001 \001(\t" + + "B\003\340A\002\022\022\n\nrequest_id\030\002 \001(\t\">\n\025UpgradeRunt" + + "imeRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\022\n\nrequest" + + "_id\030\002 \001(\t\"\235\001\n\031ReportRuntimeEventRequest\022" + + "6\n\004name\030\001 \001(\tB(\340A\002\372A\"\n notebooks.googlea" + + "pis.com/Runtime\022\022\n\005vm_id\030\002 \001(\tB\003\340A\002\0224\n\005e" + + "vent\030\003 \001(\0132 .google.cloud.notebooks.v1.E" + + "ventB\003\340A\002\"\232\001\n\024UpdateRuntimeRequest\0228\n\007ru" + + "ntime\030\001 \001(\0132\".google.cloud.notebooks.v1." + + "RuntimeB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.goog" + + "le.protobuf.FieldMaskB\003\340A\002\022\022\n\nrequest_id" + + "\030\003 \001(\t\"p\n\"RefreshRuntimeTokenInternalReq" + + "uest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n notebooks.go" + + "ogleapis.com/Runtime\022\022\n\005vm_id\030\002 \001(\tB\003\340A\002" + + "\"q\n#RefreshRuntimeTokenInternalResponse\022" + + "\024\n\014access_token\030\001 \001(\t\0224\n\013expire_time\030\002 \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\003\"\235\001\n\026" + + "DiagnoseRuntimeRequest\0226\n\004name\030\001 \001(\tB(\340A" + + "\002\372A\"\n notebooks.googleapis.com/Runtime\022K" + + "\n\021diagnostic_config\030\002 \001(\0132+.google.cloud" + + ".notebooks.v1.DiagnosticConfigB\003\340A\0022\322\025\n\026" + + "ManagedNotebookService\022\256\001\n\014ListRuntimes\022" + + "..google.cloud.notebooks.v1.ListRuntimes" + + "Request\032/.google.cloud.notebooks.v1.List" + + "RuntimesResponse\"=\202\323\344\223\002.\022,/v1/{parent=pr" + + "ojects/*/locations/*}/runtimes\332A\006parent\022" + + "\233\001\n\nGetRuntime\022,.google.cloud.notebooks." + + "v1.GetRuntimeRequest\032\".google.cloud.note" + + "books.v1.Runtime\";\202\323\344\223\002.\022,/v1/{name=proj" + + "ects/*/locations/*/runtimes/*}\332A\004name\022\331\001" + + "\n\rCreateRuntime\022/.google.cloud.notebooks" + + ".v1.CreateRuntimeRequest\032\035.google.longru" + + "nning.Operation\"x\202\323\344\223\0027\",/v1/{parent=pro" + + "jects/*/locations/*}/runtimes:\007runtime\332A" + + "\031parent,runtime_id,runtime\312A\034\n\007Runtime\022\021" + + "OperationMetadata\022\333\001\n\rUpdateRuntime\022/.go" + + "ogle.cloud.notebooks.v1.UpdateRuntimeReq" + + "uest\032\035.google.longrunning.Operation\"z\202\323\344" + + "\223\002?24/v1/{runtime.name=projects/*/locati" + + "ons/*/runtimes/*}:\007runtime\332A\023runtime,upd" + + "ate_mask\312A\034\n\007Runtime\022\021OperationMetadata\022" + + "\311\001\n\rDeleteRuntime\022/.google.cloud.noteboo" + + "ks.v1.DeleteRuntimeRequest\032\035.google.long" + + "running.Operation\"h\202\323\344\223\002.*,/v1/{name=pro" + + "jects/*/locations/*/runtimes/*}\332A\004name\312A" + + "*\n\025google.protobuf.Empty\022\021OperationMetad" + + "ata\022\302\001\n\014StartRuntime\022..google.cloud.note" + + "books.v1.StartRuntimeRequest\032\035.google.lo" + + "ngrunning.Operation\"c\202\323\344\223\0027\"2/v1/{name=p" + + "rojects/*/locations/*/runtimes/*}:start:" + + "\001*\332A\004name\312A\034\n\007Runtime\022\021OperationMetadata" + + "\022\277\001\n\013StopRuntime\022-.google.cloud.notebook" + + "s.v1.StopRuntimeRequest\032\035.google.longrun" + + "ning.Operation\"b\202\323\344\223\0026\"1/v1/{name=projec" + + "ts/*/locations/*/runtimes/*}:stop:\001*\332A\004n" + + "ame\312A\034\n\007Runtime\022\021OperationMetadata\022\305\001\n\rS" + + "witchRuntime\022/.google.cloud.notebooks.v1" + + ".SwitchRuntimeRequest\032\035.google.longrunni" + + "ng.Operation\"d\202\323\344\223\0028\"3/v1/{name=projects" + + "/*/locations/*/runtimes/*}:switch:\001*\332A\004n" + + "ame\312A\034\n\007Runtime\022\021OperationMetadata\022\302\001\n\014R" + + "esetRuntime\022..google.cloud.notebooks.v1." + + "ResetRuntimeRequest\032\035.google.longrunning" + + ".Operation\"c\202\323\344\223\0027\"2/v1/{name=projects/*" + + "/locations/*/runtimes/*}:reset:\001*\332A\004name" + + "\312A\034\n\007Runtime\022\021OperationMetadata\022\310\001\n\016Upgr" + + "adeRuntime\0220.google.cloud.notebooks.v1.U" + + "pgradeRuntimeRequest\032\035.google.longrunnin" + + "g.Operation\"e\202\323\344\223\0029\"4/v1/{name=projects/" + + "*/locations/*/runtimes/*}:upgrade:\001*\332A\004n" + + "ame\312A\034\n\007Runtime\022\021OperationMetadata\022\324\001\n\022R" + + "eportRuntimeEvent\0224.google.cloud.noteboo" + + "ks.v1.ReportRuntimeEventRequest\032\035.google" + + ".longrunning.Operation\"i\202\323\344\223\002=\"8/v1/{nam" + + "e=projects/*/locations/*/runtimes/*}:rep" + + "ortEvent:\001*\332A\004name\312A\034\n\007Runtime\022\021Operatio" + + "nMetadata\022\376\001\n\033RefreshRuntimeTokenInterna" + + "l\022=.google.cloud.notebooks.v1.RefreshRun" + + "timeTokenInternalRequest\032>.google.cloud." + + "notebooks.v1.RefreshRuntimeTokenInternal" + + "Response\"`\202\323\344\223\002M\"H/v1/{name=projects/*/l" + + "ocations/*/runtimes/*}:refreshRuntimeTok" + + "enInternal:\001*\332A\nname,vm_id\022\335\001\n\017DiagnoseR" + + "untime\0221.google.cloud.notebooks.v1.Diagn" + + "oseRuntimeRequest\032\035.google.longrunning.O" + + "peration\"x\202\323\344\223\002:\"5/v1/{name=projects/*/l" + + "ocations/*/runtimes/*}:diagnose:\001*\332A\026nam" + + "e,diagnostic_config\312A\034\n\007Runtime\022\021Operati" + + "onMetadata\032L\312A\030notebooks.googleapis.com\322" + + "A.https://www.googleapis.com/auth/cloud-" + + "platformB\323\001\n\035com.google.cloud.notebooks." + + "v1B\025ManagedNotebooksProtoP\001ZBgoogle.gola" + + "ng.org/genproto/googleapis/cloud/noteboo" + + "ks/v1;notebooks\252\002\031Google.Cloud.Notebooks" + + ".V1\312\002\031Google\\Cloud\\Notebooks\\V1\352\002\034Google" + + "::Cloud::Notebooks::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -194,9 +234,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.notebooks.v1.DiagnosticConfigProto.getDescriptor(), com.google.cloud.notebooks.v1.EventProto.getDescriptor(), com.google.cloud.notebooks.v1.RuntimeProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_cloud_notebooks_v1_ListRuntimesRequest_descriptor = @@ -271,16 +313,32 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "RequestId", }); - internal_static_google_cloud_notebooks_v1_ReportRuntimeEventRequest_descriptor = + internal_static_google_cloud_notebooks_v1_UpgradeRuntimeRequest_descriptor = getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_notebooks_v1_UpgradeRuntimeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_notebooks_v1_UpgradeRuntimeRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", + }); + internal_static_google_cloud_notebooks_v1_ReportRuntimeEventRequest_descriptor = + getDescriptor().getMessageTypes().get(10); internal_static_google_cloud_notebooks_v1_ReportRuntimeEventRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_ReportRuntimeEventRequest_descriptor, new java.lang.String[] { "Name", "VmId", "Event", }); + internal_static_google_cloud_notebooks_v1_UpdateRuntimeRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_notebooks_v1_UpdateRuntimeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_notebooks_v1_UpdateRuntimeRequest_descriptor, + new java.lang.String[] { + "Runtime", "UpdateMask", "RequestId", + }); internal_static_google_cloud_notebooks_v1_RefreshRuntimeTokenInternalRequest_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_notebooks_v1_RefreshRuntimeTokenInternalRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_RefreshRuntimeTokenInternalRequest_descriptor, @@ -288,13 +346,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "VmId", }); internal_static_google_cloud_notebooks_v1_RefreshRuntimeTokenInternalResponse_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(13); internal_static_google_cloud_notebooks_v1_RefreshRuntimeTokenInternalResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_RefreshRuntimeTokenInternalResponse_descriptor, new java.lang.String[] { "AccessToken", "ExpireTime", }); + internal_static_google_cloud_notebooks_v1_DiagnoseRuntimeRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_notebooks_v1_DiagnoseRuntimeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_notebooks_v1_DiagnoseRuntimeRequest_descriptor, + new java.lang.String[] { + "Name", "DiagnosticConfig", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -310,9 +376,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.notebooks.v1.DiagnosticConfigProto.getDescriptor(); com.google.cloud.notebooks.v1.EventProto.getDescriptor(); com.google.cloud.notebooks.v1.RuntimeProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/NotebooksProto.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/NotebooksProto.java index 90246b5311ef..56a786049a0a 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/NotebooksProto.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/NotebooksProto.java @@ -151,6 +151,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_notebooks_v1_ListEnvironmentsRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_notebooks_v1_ListEnvironmentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_notebooks_v1_DiagnoseInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_notebooks_v1_DiagnoseInstanceRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_notebooks_v1_ListEnvironmentsResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -224,318 +228,329 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "o\022\031google.cloud.notebooks.v1\032\034google/api" + "/annotations.proto\032\027google/api/client.pr" + "oto\032\037google/api/field_behavior.proto\032\031go" - + "ogle/api/resource.proto\032+google/cloud/no" - + "tebooks/v1/environment.proto\032)google/clo" - + "ud/notebooks/v1/execution.proto\032(google/" - + "cloud/notebooks/v1/instance.proto\032/googl" - + "e/cloud/notebooks/v1/instance_config.pro" - + "to\032(google/cloud/notebooks/v1/schedule.p" - + "roto\032#google/longrunning/operations.prot" - + "o\032\037google/protobuf/timestamp.proto\"\357\001\n\021O" - + "perationMetadata\022/\n\013create_time\030\001 \001(\0132\032." - + "google.protobuf.Timestamp\022,\n\010end_time\030\002 " - + "\001(\0132\032.google.protobuf.Timestamp\022\016\n\006targe" - + "t\030\003 \001(\t\022\014\n\004verb\030\004 \001(\t\022\026\n\016status_message\030" - + "\005 \001(\t\022\036\n\026requested_cancellation\030\006 \001(\010\022\023\n" - + "\013api_version\030\007 \001(\t\022\020\n\010endpoint\030\010 \001(\t\"R\n\024" - + "ListInstancesRequest\022\023\n\006parent\030\001 \001(\tB\003\340A" - + "\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t" - + "\"}\n\025ListInstancesResponse\0226\n\tinstances\030\001" - + " \003(\0132#.google.cloud.notebooks.v1.Instanc" - + "e\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachabl" - + "e\030\003 \003(\t\"\'\n\022GetInstanceRequest\022\021\n\004name\030\001 " - + "\001(\tB\003\340A\002\"\202\001\n\025CreateInstanceRequest\022\023\n\006pa" - + "rent\030\001 \001(\tB\003\340A\002\022\030\n\013instance_id\030\002 \001(\tB\003\340A" - + "\002\022:\n\010instance\030\003 \001(\0132#.google.cloud.noteb" - + "ooks.v1.InstanceB\003\340A\002\"H\n\027RegisterInstanc" - + "eRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\030\n\013instanc" - + "e_id\030\002 \001(\tB\003\340A\002\"\223\001\n\035SetInstanceAccelerat" - + "orRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022F\n\004type\030\002 \001" - + "(\01623.google.cloud.notebooks.v1.Instance." - + "AcceleratorTypeB\003\340A\002\022\027\n\ncore_count\030\003 \001(\003" - + "B\003\340A\002\"M\n\035SetInstanceMachineTypeRequest\022\021" - + "\n\004name\030\001 \001(\tB\003\340A\002\022\031\n\014machine_type\030\002 \001(\tB" - + "\003\340A\002\"k\n\033UpdateInstanceConfigRequest\022\021\n\004n" - + "ame\030\001 \001(\tB\003\340A\002\0229\n\006config\030\002 \001(\0132).google." - + "cloud.notebooks.v1.InstanceConfig\"\255\001\n\030Se" - + "tInstanceLabelsRequest\022\021\n\004name\030\001 \001(\tB\003\340A" - + "\002\022O\n\006labels\030\002 \003(\0132?.google.cloud.noteboo" - + "ks.v1.SetInstanceLabelsRequest.LabelsEnt" - + "ry\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" - + "\002 \001(\t:\0028\001\"\276\001\n\"UpdateInstanceMetadataItem" - + "sRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022W\n\005items\030\002 \003" - + "(\0132H.google.cloud.notebooks.v1.UpdateIns" - + "tanceMetadataItemsRequest.ItemsEntry\032,\n\n" - + "ItemsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" - + "8\001\"\255\001\n#UpdateInstanceMetadataItemsRespon" - + "se\022X\n\005items\030\001 \003(\0132I.google.cloud.noteboo" - + "ks.v1.UpdateInstanceMetadataItemsRespons" - + "e.ItemsEntry\032,\n\nItemsEntry\022\013\n\003key\030\001 \001(\t\022" - + "\r\n\005value\030\002 \001(\t:\0028\001\"\226\001\n#UpdateShieldedIns" - + "tanceConfigRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\\\n" - + "\030shielded_instance_config\030\002 \001(\0132:.google" - + ".cloud.notebooks.v1.Instance.ShieldedIns" - + "tanceConfig\"*\n\025DeleteInstanceRequest\022\021\n\004" - + "name\030\001 \001(\tB\003\340A\002\")\n\024StartInstanceRequest\022" - + "\021\n\004name\030\001 \001(\tB\003\340A\002\"(\n\023StopInstanceReques" - + "t\022\021\n\004name\030\001 \001(\tB\003\340A\002\")\n\024ResetInstanceReq" - + "uest\022\021\n\004name\030\001 \001(\tB\003\340A\002\"\311\001\n\031ReportInstan" - + "ceInfoRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\022\n\005vm_i" - + "d\030\002 \001(\tB\003\340A\002\022T\n\010metadata\030\003 \003(\0132B.google." - + "cloud.notebooks.v1.ReportInstanceInfoReq" - + "uest.MetadataEntry\032/\n\rMetadataEntry\022\013\n\003k" - + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"y\n\034IsInstanc" - + "eUpgradeableRequest\022\036\n\021notebook_instance" - + "\030\001 \001(\tB\003\340A\002\0229\n\004type\030\002 \001(\0162&.google.cloud" - + ".notebooks.v1.UpgradeTypeB\003\340A\001\"z\n\035IsInst" - + "anceUpgradeableResponse\022\023\n\013upgradeable\030\001" - + " \001(\010\022\027\n\017upgrade_version\030\002 \001(\t\022\024\n\014upgrade" - + "_info\030\003 \001(\t\022\025\n\rupgrade_image\030\004 \001(\t\"S\n\030Ge" - + "tInstanceHealthRequest\0227\n\004name\030\001 \001(\tB)\340A" - + "\002\372A#\n!notebooks.googleapis.com/Instance\"" - + "\204\003\n\031GetInstanceHealthResponse\022[\n\014health_" - + "state\030\001 \001(\0162@.google.cloud.notebooks.v1." - + "GetInstanceHealthResponse.HealthStateB\003\340" - + "A\003\022^\n\013health_info\030\002 \003(\0132D.google.cloud.n" - + "otebooks.v1.GetInstanceHealthResponse.He" - + "althInfoEntryB\003\340A\003\0321\n\017HealthInfoEntry\022\013\n" - + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"w\n\013HealthS" - + "tate\022\034\n\030HEALTH_STATE_UNSPECIFIED\020\000\022\013\n\007HE" - + "ALTHY\020\001\022\r\n\tUNHEALTHY\020\002\022\027\n\023AGENT_NOT_INST" - + "ALLED\020\003\022\025\n\021AGENT_NOT_RUNNING\020\004\"f\n\026Upgrad" - + "eInstanceRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\0229\n\004t" - + "ype\030\002 \001(\0162&.google.cloud.notebooks.v1.Up" - + "gradeTypeB\003\340A\001\"J\n\027RollbackInstanceReques" - + "t\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\034\n\017target_snapshot\030" - + "\002 \001(\tB\003\340A\002\"\202\001\n\036UpgradeInstanceInternalRe" - + "quest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\022\n\005vm_id\030\002 \001(\tB" - + "\003\340A\002\0229\n\004type\030\003 \001(\0162&.google.cloud.notebo" - + "oks.v1.UpgradeTypeB\003\340A\001\"U\n\027ListEnvironme" - + "ntsRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\021\n\tpage_" - + "size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\206\001\n\030ListE" - + "nvironmentsResponse\022<\n\014environments\030\001 \003(" - + "\0132&.google.cloud.notebooks.v1.Environmen" - + "t\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachabl" - + "e\030\003 \003(\t\"*\n\025GetEnvironmentRequest\022\021\n\004name" - + "\030\001 \001(\tB\003\340A\002\"\216\001\n\030CreateEnvironmentRequest" - + "\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\033\n\016environment_id\030" - + "\002 \001(\tB\003\340A\002\022@\n\013environment\030\003 \001(\0132&.google" - + ".cloud.notebooks.v1.EnvironmentB\003\340A\002\"-\n\030" - + "DeleteEnvironmentRequest\022\021\n\004name\030\001 \001(\tB\003" - + "\340A\002\"\232\001\n\024ListSchedulesRequest\0229\n\006parent\030\001" - + " \001(\tB)\340A\002\372A#\n!notebooks.googleapis.com/S" - + "chedule\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token" - + "\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t" - + "\"}\n\025ListSchedulesResponse\0226\n\tschedules\030\001" - + " \003(\0132#.google.cloud.notebooks.v1.Schedul" - + "e\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachabl" - + "e\030\003 \003(\t\"M\n\022GetScheduleRequest\0227\n\004name\030\001 " - + "\001(\tB)\340A\002\372A#\n!notebooks.googleapis.com/Sc" - + "hedule\"P\n\025DeleteScheduleRequest\0227\n\004name\030" - + "\001 \001(\tB)\340A\002\372A#\n!notebooks.googleapis.com/" - + "Schedule\"\250\001\n\025CreateScheduleRequest\0229\n\006pa" - + "rent\030\001 \001(\tB)\340A\002\372A#\n!notebooks.googleapis" - + ".com/Schedule\022\030\n\013schedule_id\030\002 \001(\tB\003\340A\002\022" - + ":\n\010schedule\030\003 \001(\0132#.google.cloud.noteboo" - + "ks.v1.ScheduleB\003\340A\002\"Q\n\026TriggerScheduleRe" - + "quest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!notebooks.g" - + "oogleapis.com/Schedule\"\234\001\n\025ListExecution" - + "sRequest\022:\n\006parent\030\001 \001(\tB*\340A\002\372A$\n\"notebo" - + "oks.googleapis.com/Execution\022\021\n\tpage_siz" - + "e\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 " - + "\001(\t\022\020\n\010order_by\030\005 \001(\t\"\200\001\n\026ListExecutions" - + "Response\0228\n\nexecutions\030\001 \003(\0132$.google.cl" - + "oud.notebooks.v1.Execution\022\027\n\017next_page_" - + "token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"O\n\023GetE" - + "xecutionRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"n" - + "otebooks.googleapis.com/Execution\"R\n\026Del" - + "eteExecutionRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A" - + "$\n\"notebooks.googleapis.com/Execution\"\255\001" - + "\n\026CreateExecutionRequest\022:\n\006parent\030\001 \001(\t" - + "B*\340A\002\372A$\n\"notebooks.googleapis.com/Execu" - + "tion\022\031\n\014execution_id\030\002 \001(\tB\003\340A\002\022<\n\texecu" - + "tion\030\003 \001(\0132$.google.cloud.notebooks.v1.E" - + "xecutionB\003\340A\002*u\n\013UpgradeType\022\034\n\030UPGRADE_" - + "TYPE_UNSPECIFIED\020\000\022\025\n\021UPGRADE_FRAMEWORK\020" - + "\001\022\016\n\nUPGRADE_OS\020\002\022\020\n\014UPGRADE_CUDA\020\003\022\017\n\013U" - + "PGRADE_ALL\020\0042\3265\n\017NotebookService\022\262\001\n\rLis" - + "tInstances\022/.google.cloud.notebooks.v1.L" - + "istInstancesRequest\0320.google.cloud.noteb" - + "ooks.v1.ListInstancesResponse\">\202\323\344\223\002/\022-/" - + "v1/{parent=projects/*/locations/*}/insta" - + "nces\332A\006parent\022\237\001\n\013GetInstance\022-.google.c" - + "loud.notebooks.v1.GetInstanceRequest\032#.g" - + "oogle.cloud.notebooks.v1.Instance\"<\202\323\344\223\002" - + "/\022-/v1/{name=projects/*/locations/*/inst" - + "ances/*}\332A\004name\022\340\001\n\016CreateInstance\0220.goo" - + "gle.cloud.notebooks.v1.CreateInstanceReq" - + "uest\032\035.google.longrunning.Operation\"}\202\323\344" - + "\223\0029\"-/v1/{parent=projects/*/locations/*}" - + "/instances:\010instance\332A\033parent,instance,i" - + "nstance_id\312A\035\n\010Instance\022\021OperationMetada" - + "ta\022\310\001\n\020RegisterInstance\0222.google.cloud.n" - + "otebooks.v1.RegisterInstanceRequest\032\035.go" - + "ogle.longrunning.Operation\"a\202\323\344\223\002;\"6/v1/" - + "{parent=projects/*/locations/*}/instance" - + "s:register:\001*\312A\035\n\010Instance\022\021OperationMet" - + "adata\022\332\001\n\026SetInstanceAccelerator\0228.googl" - + "e.cloud.notebooks.v1.SetInstanceAccelera" - + "torRequest\032\035.google.longrunning.Operatio" - + "n\"g\202\323\344\223\002A2.google.cloud.notebooks" - + ".v1.UpdateShieldedInstanceConfigRequest\032" - + "\035.google.longrunning.Operation\"u\202\323\344\223\002O2J" - + "/v1/{name=projects/*/locations/*/instanc" - + "es/*}:updateShieldedInstanceConfig:\001*\312A\035" - + "\n\010Instance\022\021OperationMetadata\022\313\001\n\021SetIns" - + "tanceLabels\0223.google.cloud.notebooks.v1." - + "SetInstanceLabelsRequest\032\035.google.longru" - + "nning.Operation\"b\202\323\344\223\002<27/v1/{name=proje" - + "cts/*/locations/*/instances/*}:setLabels" - + ":\001*\312A\035\n\010Instance\022\021OperationMetadata\022\352\001\n\033" - + "UpdateInstanceMetadataItems\022=.google.clo" - + "ud.notebooks.v1.UpdateInstanceMetadataIt" - + "emsRequest\032>.google.cloud.notebooks.v1.U" - + "pdateInstanceMetadataItemsResponse\"L\202\323\344\223" - + "\002F2A/v1/{name=projects/*/locations/*/ins" - + "tances/*}:updateMetadataItems:\001*\022\314\001\n\016Del" - + "eteInstance\0220.google.cloud.notebooks.v1." - + "DeleteInstanceRequest\032\035.google.longrunni" - + "ng.Operation\"i\202\323\344\223\002/*-/v1/{name=projects" - + "/*/locations/*/instances/*}\332A\004name\312A*\n\025g" - + "oogle.protobuf.Empty\022\021OperationMetadata\022" - + "\277\001\n\rStartInstance\022/.google.cloud.noteboo" - + "ks.v1.StartInstanceRequest\032\035.google.long" - + "running.Operation\"^\202\323\344\223\0028\"3/v1/{name=pro" - + "jects/*/locations/*/instances/*}:start:\001" - + "*\312A\035\n\010Instance\022\021OperationMetadata\022\274\001\n\014St" - + "opInstance\022..google.cloud.notebooks.v1.S" - + "topInstanceRequest\032\035.google.longrunning." - + "Operation\"]\202\323\344\223\0027\"2/v1/{name=projects/*/" - + "locations/*/instances/*}:stop:\001*\312A\035\n\010Ins" - + "tance\022\021OperationMetadata\022\277\001\n\rResetInstan" - + "ce\022/.google.cloud.notebooks.v1.ResetInst" - + "anceRequest\032\035.google.longrunning.Operati" - + "on\"^\202\323\344\223\0028\"3/v1/{name=projects/*/locatio" - + "ns/*/instances/*}:reset:\001*\312A\035\n\010Instance\022" - + "\021OperationMetadata\022\312\001\n\022ReportInstanceInf" - + "o\0224.google.cloud.notebooks.v1.ReportInst" - + "anceInfoRequest\032\035.google.longrunning.Ope" - + "ration\"_\202\323\344\223\0029\"4/v1/{name=projects/*/loc" - + "ations/*/instances/*}:report:\001*\312A\035\n\010Inst" - + "ance\022\021OperationMetadata\022\334\001\n\025IsInstanceUp" - + "gradeable\0227.google.cloud.notebooks.v1.Is" - + "InstanceUpgradeableRequest\0328.google.clou" - + "d.notebooks.v1.IsInstanceUpgradeableResp" - + "onse\"P\202\323\344\223\002J\022H/v1/{notebook_instance=pro" - + "jects/*/locations/*/instances/*}:isUpgra" - + "deable\022\316\001\n\021GetInstanceHealth\0223.google.cl" - + "oud.notebooks.v1.GetInstanceHealthReques" - + "t\0324.google.cloud.notebooks.v1.GetInstanc" - + "eHealthResponse\"N\202\323\344\223\002A\022?/v1/{name=proje" - + "cts/*/locations/*/instances/*}:getInstan" - + "ceHealth\332A\004name\022\305\001\n\017UpgradeInstance\0221.go" - + "ogle.cloud.notebooks.v1.UpgradeInstanceR" - + "equest\032\035.google.longrunning.Operation\"`\202" - + "\323\344\223\002:\"5/v1/{name=projects/*/locations/*/" - + "instances/*}:upgrade:\001*\312A\035\n\010Instance\022\021Op" - + "erationMetadata\022\310\001\n\020RollbackInstance\0222.g" - + "oogle.cloud.notebooks.v1.RollbackInstanc" + + "ogle/api/resource.proto\0321google/cloud/no" + + "tebooks/v1/diagnostic_config.proto\032+goog" + + "le/cloud/notebooks/v1/environment.proto\032" + + ")google/cloud/notebooks/v1/execution.pro" + + "to\032(google/cloud/notebooks/v1/instance.p" + + "roto\032/google/cloud/notebooks/v1/instance" + + "_config.proto\032(google/cloud/notebooks/v1" + + "/schedule.proto\032#google/longrunning/oper" + + "ations.proto\032\037google/protobuf/timestamp." + + "proto\"\357\001\n\021OperationMetadata\022/\n\013create_ti" + + "me\030\001 \001(\0132\032.google.protobuf.Timestamp\022,\n\010" + + "end_time\030\002 \001(\0132\032.google.protobuf.Timesta" + + "mp\022\016\n\006target\030\003 \001(\t\022\014\n\004verb\030\004 \001(\t\022\026\n\016stat" + + "us_message\030\005 \001(\t\022\036\n\026requested_cancellati" + + "on\030\006 \001(\010\022\023\n\013api_version\030\007 \001(\t\022\020\n\010endpoin" + + "t\030\010 \001(\t\"R\n\024ListInstancesRequest\022\023\n\006paren" + + "t\030\001 \001(\tB\003\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_" + + "token\030\003 \001(\t\"}\n\025ListInstancesResponse\0226\n\t" + + "instances\030\001 \003(\0132#.google.cloud.notebooks" + + ".v1.Instance\022\027\n\017next_page_token\030\002 \001(\t\022\023\n" + + "\013unreachable\030\003 \003(\t\"\'\n\022GetInstanceRequest" + + "\022\021\n\004name\030\001 \001(\tB\003\340A\002\"\202\001\n\025CreateInstanceRe" + + "quest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\030\n\013instance_i" + + "d\030\002 \001(\tB\003\340A\002\022:\n\010instance\030\003 \001(\0132#.google." + + "cloud.notebooks.v1.InstanceB\003\340A\002\"H\n\027Regi" + + "sterInstanceRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002" + + "\022\030\n\013instance_id\030\002 \001(\tB\003\340A\002\"\223\001\n\035SetInstan" + + "ceAcceleratorRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022" + + "F\n\004type\030\002 \001(\01623.google.cloud.notebooks.v" + + "1.Instance.AcceleratorTypeB\003\340A\002\022\027\n\ncore_" + + "count\030\003 \001(\003B\003\340A\002\"M\n\035SetInstanceMachineTy" + + "peRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\031\n\014machine_" + + "type\030\002 \001(\tB\003\340A\002\"k\n\033UpdateInstanceConfigR" + + "equest\022\021\n\004name\030\001 \001(\tB\003\340A\002\0229\n\006config\030\002 \001(" + + "\0132).google.cloud.notebooks.v1.InstanceCo" + + "nfig\"\255\001\n\030SetInstanceLabelsRequest\022\021\n\004nam" + + "e\030\001 \001(\tB\003\340A\002\022O\n\006labels\030\002 \003(\0132?.google.cl" + + "oud.notebooks.v1.SetInstanceLabelsReques" + + "t.LabelsEntry\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\276\001\n\"UpdateInstanceM" + + "etadataItemsRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022W" + + "\n\005items\030\002 \003(\0132H.google.cloud.notebooks.v" + + "1.UpdateInstanceMetadataItemsRequest.Ite" + + "msEntry\032,\n\nItemsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001\"\255\001\n#UpdateInstanceMetadata" + + "ItemsResponse\022X\n\005items\030\001 \003(\0132I.google.cl" + + "oud.notebooks.v1.UpdateInstanceMetadataI" + + "temsResponse.ItemsEntry\032,\n\nItemsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\226\001\n#Update" + + "ShieldedInstanceConfigRequest\022\021\n\004name\030\001 " + + "\001(\tB\003\340A\002\022\\\n\030shielded_instance_config\030\002 \001" + + "(\0132:.google.cloud.notebooks.v1.Instance." + + "ShieldedInstanceConfig\"*\n\025DeleteInstance" + + "Request\022\021\n\004name\030\001 \001(\tB\003\340A\002\")\n\024StartInsta" + + "nceRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\"(\n\023StopIns" + + "tanceRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\")\n\024Reset" + + "InstanceRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\"\311\001\n\031R" + + "eportInstanceInfoRequest\022\021\n\004name\030\001 \001(\tB\003" + + "\340A\002\022\022\n\005vm_id\030\002 \001(\tB\003\340A\002\022T\n\010metadata\030\003 \003(" + + "\0132B.google.cloud.notebooks.v1.ReportInst" + + "anceInfoRequest.MetadataEntry\032/\n\rMetadat" + + "aEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"y" + + "\n\034IsInstanceUpgradeableRequest\022\036\n\021notebo" + + "ok_instance\030\001 \001(\tB\003\340A\002\0229\n\004type\030\002 \001(\0162&.g" + + "oogle.cloud.notebooks.v1.UpgradeTypeB\003\340A" + + "\001\"z\n\035IsInstanceUpgradeableResponse\022\023\n\013up" + + "gradeable\030\001 \001(\010\022\027\n\017upgrade_version\030\002 \001(\t" + + "\022\024\n\014upgrade_info\030\003 \001(\t\022\025\n\rupgrade_image\030" + + "\004 \001(\t\"S\n\030GetInstanceHealthRequest\0227\n\004nam" + + "e\030\001 \001(\tB)\340A\002\372A#\n!notebooks.googleapis.co" + + "m/Instance\"\204\003\n\031GetInstanceHealthResponse" + + "\022[\n\014health_state\030\001 \001(\0162@.google.cloud.no" + + "tebooks.v1.GetInstanceHealthResponse.Hea" + + "lthStateB\003\340A\003\022^\n\013health_info\030\002 \003(\0132D.goo" + + "gle.cloud.notebooks.v1.GetInstanceHealth" + + "Response.HealthInfoEntryB\003\340A\003\0321\n\017HealthI" + + "nfoEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" + + "\"w\n\013HealthState\022\034\n\030HEALTH_STATE_UNSPECIF" + + "IED\020\000\022\013\n\007HEALTHY\020\001\022\r\n\tUNHEALTHY\020\002\022\027\n\023AGE" + + "NT_NOT_INSTALLED\020\003\022\025\n\021AGENT_NOT_RUNNING\020" + + "\004\"f\n\026UpgradeInstanceRequest\022\021\n\004name\030\001 \001(" + + "\tB\003\340A\002\0229\n\004type\030\002 \001(\0162&.google.cloud.note" + + "books.v1.UpgradeTypeB\003\340A\001\"J\n\027RollbackIns" + + "tanceRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\034\n\017targe" + + "t_snapshot\030\002 \001(\tB\003\340A\002\"\202\001\n\036UpgradeInstanc" + + "eInternalRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\022\n\005v" + + "m_id\030\002 \001(\tB\003\340A\002\0229\n\004type\030\003 \001(\0162&.google.c" + + "loud.notebooks.v1.UpgradeTypeB\003\340A\001\"U\n\027Li" + + "stEnvironmentsRequest\022\023\n\006parent\030\001 \001(\tB\003\340" + + "A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(" + + "\t\"\237\001\n\027DiagnoseInstanceRequest\0227\n\004name\030\001 " + + "\001(\tB)\340A\002\372A#\n!notebooks.googleapis.com/In" + + "stance\022K\n\021diagnostic_config\030\002 \001(\0132+.goog" + + "le.cloud.notebooks.v1.DiagnosticConfigB\003" + + "\340A\002\"\206\001\n\030ListEnvironmentsResponse\022<\n\014envi" + + "ronments\030\001 \003(\0132&.google.cloud.notebooks." + + "v1.Environment\022\027\n\017next_page_token\030\002 \001(\t\022" + + "\023\n\013unreachable\030\003 \003(\t\"*\n\025GetEnvironmentRe" + + "quest\022\021\n\004name\030\001 \001(\tB\003\340A\002\"\216\001\n\030CreateEnvir" + + "onmentRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\033\n\016en" + + "vironment_id\030\002 \001(\tB\003\340A\002\022@\n\013environment\030\003" + + " \001(\0132&.google.cloud.notebooks.v1.Environ" + + "mentB\003\340A\002\"-\n\030DeleteEnvironmentRequest\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\"\232\001\n\024ListSchedulesReques" + + "t\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!notebooks.goo" + + "gleapis.com/Schedule\022\021\n\tpage_size\030\002 \001(\005\022" + + "\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010o" + + "rder_by\030\005 \001(\t\"}\n\025ListSchedulesResponse\0226" + + "\n\tschedules\030\001 \003(\0132#.google.cloud.noteboo" + + "ks.v1.Schedule\022\027\n\017next_page_token\030\002 \001(\t\022" + + "\023\n\013unreachable\030\003 \003(\t\"M\n\022GetScheduleReque" + + "st\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!notebooks.goog" + + "leapis.com/Schedule\"P\n\025DeleteScheduleReq" + + "uest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!notebooks.go" + + "ogleapis.com/Schedule\"\250\001\n\025CreateSchedule" + + "Request\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!noteboo" + + "ks.googleapis.com/Schedule\022\030\n\013schedule_i" + + "d\030\002 \001(\tB\003\340A\002\022:\n\010schedule\030\003 \001(\0132#.google." + + "cloud.notebooks.v1.ScheduleB\003\340A\002\"Q\n\026Trig" + + "gerScheduleRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#" + + "\n!notebooks.googleapis.com/Schedule\"\234\001\n\025" + + "ListExecutionsRequest\022:\n\006parent\030\001 \001(\tB*\340" + + "A\002\372A$\n\"notebooks.googleapis.com/Executio" + + "n\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t" + + "\022\016\n\006filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"\200\001\n\026L" + + "istExecutionsResponse\0228\n\nexecutions\030\001 \003(" + + "\0132$.google.cloud.notebooks.v1.Execution\022" + + "\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachable\030" + + "\003 \003(\t\"O\n\023GetExecutionRequest\0228\n\004name\030\001 \001" + + "(\tB*\340A\002\372A$\n\"notebooks.googleapis.com/Exe" + + "cution\"R\n\026DeleteExecutionRequest\0228\n\004name" + + "\030\001 \001(\tB*\340A\002\372A$\n\"notebooks.googleapis.com" + + "/Execution\"\255\001\n\026CreateExecutionRequest\022:\n" + + "\006parent\030\001 \001(\tB*\340A\002\372A$\n\"notebooks.googlea" + + "pis.com/Execution\022\031\n\014execution_id\030\002 \001(\tB" + + "\003\340A\002\022<\n\texecution\030\003 \001(\0132$.google.cloud.n" + + "otebooks.v1.ExecutionB\003\340A\002*u\n\013UpgradeTyp" + + "e\022\034\n\030UPGRADE_TYPE_UNSPECIFIED\020\000\022\025\n\021UPGRA" + + "DE_FRAMEWORK\020\001\022\016\n\nUPGRADE_OS\020\002\022\020\n\014UPGRAD" + + "E_CUDA\020\003\022\017\n\013UPGRADE_ALL\020\0042\2727\n\017NotebookSe" + + "rvice\022\262\001\n\rListInstances\022/.google.cloud.n" + + "otebooks.v1.ListInstancesRequest\0320.googl" + + "e.cloud.notebooks.v1.ListInstancesRespon" + + "se\">\202\323\344\223\002/\022-/v1/{parent=projects/*/locat" + + "ions/*}/instances\332A\006parent\022\237\001\n\013GetInstan" + + "ce\022-.google.cloud.notebooks.v1.GetInstan" + + "ceRequest\032#.google.cloud.notebooks.v1.In" + + "stance\"<\202\323\344\223\002/\022-/v1/{name=projects/*/loc" + + "ations/*/instances/*}\332A\004name\022\340\001\n\016CreateI" + + "nstance\0220.google.cloud.notebooks.v1.Crea" + + "teInstanceRequest\032\035.google.longrunning.O" + + "peration\"}\202\323\344\223\0029\"-/v1/{parent=projects/*" + + "/locations/*}/instances:\010instance\332A\033pare" + + "nt,instance,instance_id\312A\035\n\010Instance\022\021Op" + + "erationMetadata\022\310\001\n\020RegisterInstance\0222.g" + + "oogle.cloud.notebooks.v1.RegisterInstanc" + "eRequest\032\035.google.longrunning.Operation\"" - + "a\202\323\344\223\002;\"6/v1/{name=projects/*/locations/" - + "*/instances/*}:rollback:\001*\312A\035\n\010Instance\022" - + "\021OperationMetadata\022\335\001\n\027UpgradeInstanceIn" - + "ternal\0229.google.cloud.notebooks.v1.Upgra" - + "deInstanceInternalRequest\032\035.google.longr" - + "unning.Operation\"h\202\323\344\223\002B\"=/v1/{name=proj" - + "ects/*/locations/*/instances/*}:upgradeI" - + "nternal:\001*\312A\035\n\010Instance\022\021OperationMetada" - + "ta\022\276\001\n\020ListEnvironments\0222.google.cloud.n" - + "otebooks.v1.ListEnvironmentsRequest\0323.go" - + "ogle.cloud.notebooks.v1.ListEnvironments" - + "Response\"A\202\323\344\223\0022\0220/v1/{parent=projects/*" - + "/locations/*}/environments\332A\006parent\022\253\001\n\016" - + "GetEnvironment\0220.google.cloud.notebooks." - + "v1.GetEnvironmentRequest\032&.google.cloud." - + "notebooks.v1.Environment\"?\202\323\344\223\0022\0220/v1/{n" - + "ame=projects/*/locations/*/environments/" - + "*}\332A\004name\022\366\001\n\021CreateEnvironment\0223.google" - + ".cloud.notebooks.v1.CreateEnvironmentReq" - + "uest\032\035.google.longrunning.Operation\"\214\001\202\323" - + "\344\223\002?\"0/v1/{parent=projects/*/locations/*" - + "}/environments:\013environment\332A!parent,env" - + "ironment,environment_id\312A \n\013Environment\022" - + "\021OperationMetadata\022\325\001\n\021DeleteEnvironment" - + "\0223.google.cloud.notebooks.v1.DeleteEnvir" - + "onmentRequest\032\035.google.longrunning.Opera" - + "tion\"l\202\323\344\223\0022*0/v1/{name=projects/*/locat" - + "ions/*/environments/*}\332A\004name\312A*\n\025google" - + ".protobuf.Empty\022\021OperationMetadata\022\262\001\n\rL" - + "istSchedules\022/.google.cloud.notebooks.v1" - + ".ListSchedulesRequest\0320.google.cloud.not" - + "ebooks.v1.ListSchedulesResponse\">\202\323\344\223\002/\022" - + "-/v1/{parent=projects/*/locations/*}/sch" - + "edules\332A\006parent\022\237\001\n\013GetSchedule\022-.google" - + ".cloud.notebooks.v1.GetScheduleRequest\032#" - + ".google.cloud.notebooks.v1.Schedule\"<\202\323\344" - + "\223\002/\022-/v1/{name=projects/*/locations/*/sc" - + "hedules/*}\332A\004name\022\314\001\n\016DeleteSchedule\0220.g" - + "oogle.cloud.notebooks.v1.DeleteScheduleR" - + "equest\032\035.google.longrunning.Operation\"i\202" - + "\323\344\223\002/*-/v1/{name=projects/*/locations/*/" - + "schedules/*}\332A\004name\312A*\n\025google.protobuf." - + "Empty\022\021OperationMetadata\022\340\001\n\016CreateSched" - + "ule\0220.google.cloud.notebooks.v1.CreateSc" - + "heduleRequest\032\035.google.longrunning.Opera" - + "tion\"}\202\323\344\223\0029\"-/v1/{parent=projects/*/loc" - + "ations/*}/schedules:\010schedule\332A\033parent,s" - + "chedule,schedule_id\312A\035\n\010Schedule\022\021Operat" - + "ionMetadata\022\305\001\n\017TriggerSchedule\0221.google" - + ".cloud.notebooks.v1.TriggerScheduleReque" - + "st\032\035.google.longrunning.Operation\"`\202\323\344\223\002" - + ":\"5/v1/{name=projects/*/locations/*/sche" - + "dules/*}:trigger:\001*\312A\035\n\010Schedule\022\021Operat" - + "ionMetadata\022\266\001\n\016ListExecutions\0220.google." - + "cloud.notebooks.v1.ListExecutionsRequest" - + "\0321.google.cloud.notebooks.v1.ListExecuti" - + "onsResponse\"?\202\323\344\223\0020\022./v1/{parent=project" - + "s/*/locations/*}/executions\332A\006parent\022\243\001\n" - + "\014GetExecution\022..google.cloud.notebooks.v" - + "1.GetExecutionRequest\032$.google.cloud.not" - + "ebooks.v1.Execution\"=\202\323\344\223\0020\022./v1/{name=p" - + "rojects/*/locations/*/executions/*}\332A\004na" - + "me\022\317\001\n\017DeleteExecution\0221.google.cloud.no" - + "tebooks.v1.DeleteExecutionRequest\032\035.goog" - + "le.longrunning.Operation\"j\202\323\344\223\0020*./v1/{n" - + "ame=projects/*/locations/*/executions/*}" + + "a\202\323\344\223\002;\"6/v1/{parent=projects/*/location" + + "s/*}/instances:register:\001*\312A\035\n\010Instance\022" + + "\021OperationMetadata\022\332\001\n\026SetInstanceAccele" + + "rator\0228.google.cloud.notebooks.v1.SetIns" + + "tanceAcceleratorRequest\032\035.google.longrun" + + "ning.Operation\"g\202\323\344\223\002A2.google.cl" + + "oud.notebooks.v1.UpdateShieldedInstanceC" + + "onfigRequest\032\035.google.longrunning.Operat" + + "ion\"u\202\323\344\223\002O2J/v1/{name=projects/*/locati" + + "ons/*/instances/*}:updateShieldedInstanc" + + "eConfig:\001*\312A\035\n\010Instance\022\021OperationMetada" + + "ta\022\313\001\n\021SetInstanceLabels\0223.google.cloud." + + "notebooks.v1.SetInstanceLabelsRequest\032\035." + + "google.longrunning.Operation\"b\202\323\344\223\002<27/v" + + "1/{name=projects/*/locations/*/instances" + + "/*}:setLabels:\001*\312A\035\n\010Instance\022\021Operation" + + "Metadata\022\352\001\n\033UpdateInstanceMetadataItems" + + "\022=.google.cloud.notebooks.v1.UpdateInsta" + + "nceMetadataItemsRequest\032>.google.cloud.n" + + "otebooks.v1.UpdateInstanceMetadataItemsR" + + "esponse\"L\202\323\344\223\002F2A/v1/{name=projects/*/lo" + + "cations/*/instances/*}:updateMetadataIte" + + "ms:\001*\022\314\001\n\016DeleteInstance\0220.google.cloud." + + "notebooks.v1.DeleteInstanceRequest\032\035.goo" + + "gle.longrunning.Operation\"i\202\323\344\223\002/*-/v1/{" + + "name=projects/*/locations/*/instances/*}" + "\332A\004name\312A*\n\025google.protobuf.Empty\022\021Opera" - + "tionMetadata\022\350\001\n\017CreateExecution\0221.googl" - + "e.cloud.notebooks.v1.CreateExecutionRequ" - + "est\032\035.google.longrunning.Operation\"\202\001\202\323\344" - + "\223\002;\"./v1/{parent=projects/*/locations/*}" - + "/executions:\texecution\332A\035parent,executio" - + "n,execution_id\312A\036\n\tExecution\022\021OperationM" - + "etadata\032L\312A\030notebooks.googleapis.com\322A.h" - + "ttps://www.googleapis.com/auth/cloud-pla" - + "tformB\314\001\n\035com.google.cloud.notebooks.v1B" - + "\016NotebooksProtoP\001ZBgoogle.golang.org/gen" - + "proto/googleapis/cloud/notebooks/v1;note" - + "books\252\002\031Google.Cloud.Notebooks.V1\312\002\031Goog" - + "le\\Cloud\\Notebooks\\V1\352\002\034Google::Cloud::N" - + "otebooks::V1b\006proto3" + + "tionMetadata\022\277\001\n\rStartInstance\022/.google." + + "cloud.notebooks.v1.StartInstanceRequest\032" + + "\035.google.longrunning.Operation\"^\202\323\344\223\0028\"3" + + "/v1/{name=projects/*/locations/*/instanc" + + "es/*}:start:\001*\312A\035\n\010Instance\022\021OperationMe" + + "tadata\022\274\001\n\014StopInstance\022..google.cloud.n" + + "otebooks.v1.StopInstanceRequest\032\035.google" + + ".longrunning.Operation\"]\202\323\344\223\0027\"2/v1/{nam" + + "e=projects/*/locations/*/instances/*}:st" + + "op:\001*\312A\035\n\010Instance\022\021OperationMetadata\022\277\001" + + "\n\rResetInstance\022/.google.cloud.notebooks" + + ".v1.ResetInstanceRequest\032\035.google.longru" + + "nning.Operation\"^\202\323\344\223\0028\"3/v1/{name=proje" + + "cts/*/locations/*/instances/*}:reset:\001*\312" + + "A\035\n\010Instance\022\021OperationMetadata\022\312\001\n\022Repo" + + "rtInstanceInfo\0224.google.cloud.notebooks." + + "v1.ReportInstanceInfoRequest\032\035.google.lo" + + "ngrunning.Operation\"_\202\323\344\223\0029\"4/v1/{name=p" + + "rojects/*/locations/*/instances/*}:repor" + + "t:\001*\312A\035\n\010Instance\022\021OperationMetadata\022\334\001\n" + + "\025IsInstanceUpgradeable\0227.google.cloud.no" + + "tebooks.v1.IsInstanceUpgradeableRequest\032" + + "8.google.cloud.notebooks.v1.IsInstanceUp" + + "gradeableResponse\"P\202\323\344\223\002J\022H/v1/{notebook" + + "_instance=projects/*/locations/*/instanc" + + "es/*}:isUpgradeable\022\316\001\n\021GetInstanceHealt" + + "h\0223.google.cloud.notebooks.v1.GetInstanc" + + "eHealthRequest\0324.google.cloud.notebooks." + + "v1.GetInstanceHealthResponse\"N\202\323\344\223\002A\022?/v" + + "1/{name=projects/*/locations/*/instances" + + "/*}:getInstanceHealth\332A\004name\022\305\001\n\017Upgrade" + + "Instance\0221.google.cloud.notebooks.v1.Upg" + + "radeInstanceRequest\032\035.google.longrunning" + + ".Operation\"`\202\323\344\223\002:\"5/v1/{name=projects/*" + + "/locations/*/instances/*}:upgrade:\001*\312A\035\n" + + "\010Instance\022\021OperationMetadata\022\310\001\n\020Rollbac" + + "kInstance\0222.google.cloud.notebooks.v1.Ro" + + "llbackInstanceRequest\032\035.google.longrunni" + + "ng.Operation\"a\202\323\344\223\002;\"6/v1/{name=projects" + + "/*/locations/*/instances/*}:rollback:\001*\312" + + "A\035\n\010Instance\022\021OperationMetadata\022\341\001\n\020Diag" + + "noseInstance\0222.google.cloud.notebooks.v1" + + ".DiagnoseInstanceRequest\032\035.google.longru" + + "nning.Operation\"z\202\323\344\223\002;\"6/v1/{name=proje" + + "cts/*/locations/*/instances/*}:diagnose:" + + "\001*\332A\026name,diagnostic_config\312A\035\n\010Instance" + + "\022\021OperationMetadata\022\335\001\n\027UpgradeInstanceI" + + "nternal\0229.google.cloud.notebooks.v1.Upgr" + + "adeInstanceInternalRequest\032\035.google.long" + + "running.Operation\"h\202\323\344\223\002B\"=/v1/{name=pro" + + "jects/*/locations/*/instances/*}:upgrade" + + "Internal:\001*\312A\035\n\010Instance\022\021OperationMetad" + + "ata\022\276\001\n\020ListEnvironments\0222.google.cloud." + + "notebooks.v1.ListEnvironmentsRequest\0323.g" + + "oogle.cloud.notebooks.v1.ListEnvironment" + + "sResponse\"A\202\323\344\223\0022\0220/v1/{parent=projects/" + + "*/locations/*}/environments\332A\006parent\022\253\001\n" + + "\016GetEnvironment\0220.google.cloud.notebooks" + + ".v1.GetEnvironmentRequest\032&.google.cloud" + + ".notebooks.v1.Environment\"?\202\323\344\223\0022\0220/v1/{" + + "name=projects/*/locations/*/environments" + + "/*}\332A\004name\022\366\001\n\021CreateEnvironment\0223.googl" + + "e.cloud.notebooks.v1.CreateEnvironmentRe" + + "quest\032\035.google.longrunning.Operation\"\214\001\202" + + "\323\344\223\002?\"0/v1/{parent=projects/*/locations/" + + "*}/environments:\013environment\332A!parent,en" + + "vironment,environment_id\312A \n\013Environment" + + "\022\021OperationMetadata\022\325\001\n\021DeleteEnvironmen" + + "t\0223.google.cloud.notebooks.v1.DeleteEnvi" + + "ronmentRequest\032\035.google.longrunning.Oper" + + "ation\"l\202\323\344\223\0022*0/v1/{name=projects/*/loca" + + "tions/*/environments/*}\332A\004name\312A*\n\025googl" + + "e.protobuf.Empty\022\021OperationMetadata\022\262\001\n\r" + + "ListSchedules\022/.google.cloud.notebooks.v" + + "1.ListSchedulesRequest\0320.google.cloud.no" + + "tebooks.v1.ListSchedulesResponse\">\202\323\344\223\002/" + + "\022-/v1/{parent=projects/*/locations/*}/sc" + + "hedules\332A\006parent\022\237\001\n\013GetSchedule\022-.googl" + + "e.cloud.notebooks.v1.GetScheduleRequest\032" + + "#.google.cloud.notebooks.v1.Schedule\"<\202\323" + + "\344\223\002/\022-/v1/{name=projects/*/locations/*/s" + + "chedules/*}\332A\004name\022\314\001\n\016DeleteSchedule\0220." + + "google.cloud.notebooks.v1.DeleteSchedule" + + "Request\032\035.google.longrunning.Operation\"i" + + "\202\323\344\223\002/*-/v1/{name=projects/*/locations/*" + + "/schedules/*}\332A\004name\312A*\n\025google.protobuf" + + ".Empty\022\021OperationMetadata\022\340\001\n\016CreateSche" + + "dule\0220.google.cloud.notebooks.v1.CreateS" + + "cheduleRequest\032\035.google.longrunning.Oper" + + "ation\"}\202\323\344\223\0029\"-/v1/{parent=projects/*/lo" + + "cations/*}/schedules:\010schedule\332A\033parent," + + "schedule,schedule_id\312A\035\n\010Schedule\022\021Opera" + + "tionMetadata\022\305\001\n\017TriggerSchedule\0221.googl" + + "e.cloud.notebooks.v1.TriggerScheduleRequ" + + "est\032\035.google.longrunning.Operation\"`\202\323\344\223" + + "\002:\"5/v1/{name=projects/*/locations/*/sch" + + "edules/*}:trigger:\001*\312A\035\n\010Schedule\022\021Opera" + + "tionMetadata\022\266\001\n\016ListExecutions\0220.google" + + ".cloud.notebooks.v1.ListExecutionsReques" + + "t\0321.google.cloud.notebooks.v1.ListExecut" + + "ionsResponse\"?\202\323\344\223\0020\022./v1/{parent=projec" + + "ts/*/locations/*}/executions\332A\006parent\022\243\001" + + "\n\014GetExecution\022..google.cloud.notebooks." + + "v1.GetExecutionRequest\032$.google.cloud.no" + + "tebooks.v1.Execution\"=\202\323\344\223\0020\022./v1/{name=" + + "projects/*/locations/*/executions/*}\332A\004n" + + "ame\022\317\001\n\017DeleteExecution\0221.google.cloud.n" + + "otebooks.v1.DeleteExecutionRequest\032\035.goo" + + "gle.longrunning.Operation\"j\202\323\344\223\0020*./v1/{" + + "name=projects/*/locations/*/executions/*" + + "}\332A\004name\312A*\n\025google.protobuf.Empty\022\021Oper" + + "ationMetadata\022\350\001\n\017CreateExecution\0221.goog" + + "le.cloud.notebooks.v1.CreateExecutionReq" + + "uest\032\035.google.longrunning.Operation\"\202\001\202\323" + + "\344\223\002;\"./v1/{parent=projects/*/locations/*" + + "}/executions:\texecution\332A\035parent,executi" + + "on,execution_id\312A\036\n\tExecution\022\021Operation" + + "Metadata\032L\312A\030notebooks.googleapis.com\322A." + + "https://www.googleapis.com/auth/cloud-pl" + + "atformB\314\001\n\035com.google.cloud.notebooks.v1" + + "B\016NotebooksProtoP\001ZBgoogle.golang.org/ge" + + "nproto/googleapis/cloud/notebooks/v1;not" + + "ebooks\252\002\031Google.Cloud.Notebooks.V1\312\002\031Goo" + + "gle\\Cloud\\Notebooks\\V1\352\002\034Google::Cloud::" + + "Notebooks::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -545,6 +560,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.notebooks.v1.DiagnosticConfigProto.getDescriptor(), com.google.cloud.notebooks.v1.EnvironmentProto.getDescriptor(), com.google.cloud.notebooks.v1.ExecutionProto.getDescriptor(), com.google.cloud.notebooks.v1.InstanceProto.getDescriptor(), @@ -818,8 +834,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Parent", "PageSize", "PageToken", }); - internal_static_google_cloud_notebooks_v1_ListEnvironmentsResponse_descriptor = + internal_static_google_cloud_notebooks_v1_DiagnoseInstanceRequest_descriptor = getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_notebooks_v1_DiagnoseInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_notebooks_v1_DiagnoseInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "DiagnosticConfig", + }); + internal_static_google_cloud_notebooks_v1_ListEnvironmentsResponse_descriptor = + getDescriptor().getMessageTypes().get(27); internal_static_google_cloud_notebooks_v1_ListEnvironmentsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_ListEnvironmentsResponse_descriptor, @@ -827,7 +851,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Environments", "NextPageToken", "Unreachable", }); internal_static_google_cloud_notebooks_v1_GetEnvironmentRequest_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(28); internal_static_google_cloud_notebooks_v1_GetEnvironmentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_GetEnvironmentRequest_descriptor, @@ -835,7 +859,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_notebooks_v1_CreateEnvironmentRequest_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(29); internal_static_google_cloud_notebooks_v1_CreateEnvironmentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_CreateEnvironmentRequest_descriptor, @@ -843,7 +867,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "EnvironmentId", "Environment", }); internal_static_google_cloud_notebooks_v1_DeleteEnvironmentRequest_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(30); internal_static_google_cloud_notebooks_v1_DeleteEnvironmentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_DeleteEnvironmentRequest_descriptor, @@ -851,7 +875,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_notebooks_v1_ListSchedulesRequest_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(31); internal_static_google_cloud_notebooks_v1_ListSchedulesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_ListSchedulesRequest_descriptor, @@ -859,7 +883,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", "Filter", "OrderBy", }); internal_static_google_cloud_notebooks_v1_ListSchedulesResponse_descriptor = - getDescriptor().getMessageTypes().get(31); + getDescriptor().getMessageTypes().get(32); internal_static_google_cloud_notebooks_v1_ListSchedulesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_ListSchedulesResponse_descriptor, @@ -867,7 +891,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Schedules", "NextPageToken", "Unreachable", }); internal_static_google_cloud_notebooks_v1_GetScheduleRequest_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(33); internal_static_google_cloud_notebooks_v1_GetScheduleRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_GetScheduleRequest_descriptor, @@ -875,7 +899,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_notebooks_v1_DeleteScheduleRequest_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(34); internal_static_google_cloud_notebooks_v1_DeleteScheduleRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_DeleteScheduleRequest_descriptor, @@ -883,7 +907,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_notebooks_v1_CreateScheduleRequest_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(35); internal_static_google_cloud_notebooks_v1_CreateScheduleRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_CreateScheduleRequest_descriptor, @@ -891,7 +915,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "ScheduleId", "Schedule", }); internal_static_google_cloud_notebooks_v1_TriggerScheduleRequest_descriptor = - getDescriptor().getMessageTypes().get(35); + getDescriptor().getMessageTypes().get(36); internal_static_google_cloud_notebooks_v1_TriggerScheduleRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_TriggerScheduleRequest_descriptor, @@ -899,7 +923,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_notebooks_v1_ListExecutionsRequest_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(37); internal_static_google_cloud_notebooks_v1_ListExecutionsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_ListExecutionsRequest_descriptor, @@ -907,7 +931,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", "Filter", "OrderBy", }); internal_static_google_cloud_notebooks_v1_ListExecutionsResponse_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(38); internal_static_google_cloud_notebooks_v1_ListExecutionsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_ListExecutionsResponse_descriptor, @@ -915,7 +939,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Executions", "NextPageToken", "Unreachable", }); internal_static_google_cloud_notebooks_v1_GetExecutionRequest_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(39); internal_static_google_cloud_notebooks_v1_GetExecutionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_GetExecutionRequest_descriptor, @@ -923,7 +947,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_notebooks_v1_DeleteExecutionRequest_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(40); internal_static_google_cloud_notebooks_v1_DeleteExecutionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_DeleteExecutionRequest_descriptor, @@ -931,7 +955,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_notebooks_v1_CreateExecutionRequest_descriptor = - getDescriptor().getMessageTypes().get(40); + getDescriptor().getMessageTypes().get(41); internal_static_google_cloud_notebooks_v1_CreateExecutionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1_CreateExecutionRequest_descriptor, @@ -953,6 +977,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.notebooks.v1.DiagnosticConfigProto.getDescriptor(); com.google.cloud.notebooks.v1.EnvironmentProto.getDescriptor(); com.google.cloud.notebooks.v1.ExecutionProto.getDescriptor(); com.google.cloud.notebooks.v1.InstanceProto.getDescriptor(); diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeAcceleratorConfig.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeAcceleratorConfig.java index 1bc62d9f3c3e..336a00753077 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeAcceleratorConfig.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeAcceleratorConfig.java @@ -104,8 +104,9 @@ public enum AcceleratorType implements com.google.protobuf.ProtocolMessageEnum { * Accelerator type is Nvidia Tesla K80. * * - * NVIDIA_TESLA_K80 = 1; + * NVIDIA_TESLA_K80 = 1 [deprecated = true]; */ + @java.lang.Deprecated NVIDIA_TESLA_K80(1), /** * @@ -227,9 +228,9 @@ public enum AcceleratorType implements com.google.protobuf.ProtocolMessageEnum { * Accelerator type is Nvidia Tesla K80. * * - * NVIDIA_TESLA_K80 = 1; + * NVIDIA_TESLA_K80 = 1 [deprecated = true]; */ - public static final int NVIDIA_TESLA_K80_VALUE = 1; + @java.lang.Deprecated public static final int NVIDIA_TESLA_K80_VALUE = 1; /** * * diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeProto.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeProto.java index 53f50b87ea22..454face71309 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeProto.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeProto.java @@ -136,104 +136,113 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "_INSTALLED\020\003\022\025\n\021AGENT_NOT_RUNNING\020\004:a\352A^" + "\n notebooks.googleapis.com/Runtime\022:proj" + "ects/{project}/locations/{location}/runt" - + "imes/{runtime}B\016\n\014runtime_type\"\241\003\n\030Runti" + + "imes/{runtime}B\016\n\014runtime_type\"\245\003\n\030Runti" + "meAcceleratorConfig\022Q\n\004type\030\001 \001(\0162C.goog" + "le.cloud.notebooks.v1.RuntimeAccelerator" + "Config.AcceleratorType\022\022\n\ncore_count\030\002 \001" - + "(\003\"\235\002\n\017AcceleratorType\022 \n\034ACCELERATOR_TY" - + "PE_UNSPECIFIED\020\000\022\024\n\020NVIDIA_TESLA_K80\020\001\022\025" - + "\n\021NVIDIA_TESLA_P100\020\002\022\025\n\021NVIDIA_TESLA_V1" - + "00\020\003\022\023\n\017NVIDIA_TESLA_P4\020\004\022\023\n\017NVIDIA_TESL" - + "A_T4\020\005\022\025\n\021NVIDIA_TESLA_A100\020\006\022\n\n\006TPU_V2\020" - + "\007\022\n\n\006TPU_V3\020\010\022\027\n\023NVIDIA_TESLA_T4_VWS\020\t\022\031" - + "\n\025NVIDIA_TESLA_P100_VWS\020\n\022\027\n\023NVIDIA_TESL" - + "A_P4_VWS\020\013\"#\n\020EncryptionConfig\022\017\n\007kms_ke" - + "y\030\001 \001(\t\"\250\003\n\tLocalDisk\022\030\n\013auto_delete\030\001 \001" - + "(\010B\003\340A\003\022\021\n\004boot\030\002 \001(\010B\003\340A\003\022\030\n\013device_nam" - + "e\030\003 \001(\tB\003\340A\003\022Z\n\021guest_os_features\030\004 \003(\0132" - + ":.google.cloud.notebooks.v1.LocalDisk.Ru" - + "ntimeGuestOsFeatureB\003\340A\003\022\022\n\005index\030\005 \001(\005B" - + "\003\340A\003\022T\n\021initialize_params\030\006 \001(\01324.google" - + ".cloud.notebooks.v1.LocalDiskInitializeP" - + "aramsB\003\340A\004\022\021\n\tinterface\030\007 \001(\t\022\021\n\004kind\030\010 " - + "\001(\tB\003\340A\003\022\025\n\010licenses\030\t \003(\tB\003\340A\003\022\014\n\004mode\030" - + "\n \001(\t\022\016\n\006source\030\013 \001(\t\022\014\n\004type\030\014 \001(\t\032%\n\025R" - + "untimeGuestOsFeature\022\014\n\004type\030\001 \001(\t\"\252\003\n\031L" - + "ocalDiskInitializeParams\022\030\n\013description\030" - + "\001 \001(\tB\003\340A\001\022\026\n\tdisk_name\030\002 \001(\tB\003\340A\001\022\031\n\014di" - + "sk_size_gb\030\003 \001(\003B\003\340A\001\022U\n\tdisk_type\030\004 \001(\016" - + "2=.google.cloud.notebooks.v1.LocalDiskIn" - + "itializeParams.DiskTypeB\003\340A\004\022U\n\006labels\030\005" - + " \003(\0132@.google.cloud.notebooks.v1.LocalDi" - + "skInitializeParams.LabelsEntryB\003\340A\001\032-\n\013L" - + "abelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" - + "8\001\"c\n\010DiskType\022\031\n\025DISK_TYPE_UNSPECIFIED\020" - + "\000\022\017\n\013PD_STANDARD\020\001\022\n\n\006PD_SSD\020\002\022\017\n\013PD_BAL" - + "ANCED\020\003\022\016\n\nPD_EXTREME\020\004\"\373\001\n\023RuntimeAcces" - + "sConfig\022U\n\013access_type\030\001 \001(\0162@.google.cl" - + "oud.notebooks.v1.RuntimeAccessConfig.Run" - + "timeAccessType\022\025\n\rruntime_owner\030\002 \001(\t\022\026\n" - + "\tproxy_uri\030\003 \001(\tB\003\340A\003\"^\n\021RuntimeAccessTy" - + "pe\022#\n\037RUNTIME_ACCESS_TYPE_UNSPECIFIED\020\000\022" - + "\017\n\013SINGLE_USER\020\001\022\023\n\017SERVICE_ACCOUNT\020\002\"\224\003" - + "\n\025RuntimeSoftwareConfig\022!\n\031notebook_upgr" - + "ade_schedule\030\001 \001(\t\022%\n\030enable_health_moni" - + "toring\030\002 \001(\010H\000\210\001\001\022\032\n\ridle_shutdown\030\003 \001(\010" - + "H\001\210\001\001\022\035\n\025idle_shutdown_timeout\030\004 \001(\005\022\032\n\022" - + "install_gpu_driver\030\005 \001(\010\022\036\n\026custom_gpu_d" - + "river_path\030\006 \001(\t\022\033\n\023post_startup_script\030" - + "\007 \001(\t\022?\n\007kernels\030\010 \003(\0132).google.cloud.no" - + "tebooks.v1.ContainerImageB\003\340A\001\022\035\n\013upgrad" - + "eable\030\t \001(\010B\003\340A\003H\002\210\001\001B\033\n\031_enable_health_" - + "monitoringB\020\n\016_idle_shutdownB\016\n\014_upgrade" - + "able\"\241\001\n\016RuntimeMetrics\022Y\n\016system_metric" - + "s\030\001 \003(\0132<.google.cloud.notebooks.v1.Runt" - + "imeMetrics.SystemMetricsEntryB\003\340A\003\0324\n\022Sy" - + "stemMetricsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002" - + " \001(\t:\0028\001\"u\n\035RuntimeShieldedInstanceConfi" - + "g\022\032\n\022enable_secure_boot\030\001 \001(\010\022\023\n\013enable_" - + "vtpm\030\002 \001(\010\022#\n\033enable_integrity_monitorin" - + "g\030\003 \001(\010\"\227\001\n\016VirtualMachine\022\032\n\rinstance_n" - + "ame\030\001 \001(\tB\003\340A\003\022\030\n\013instance_id\030\002 \001(\tB\003\340A\003" - + "\022O\n\026virtual_machine_config\030\003 \001(\0132/.googl" - + "e.cloud.notebooks.v1.VirtualMachineConfi" - + "g\"\343\t\n\024VirtualMachineConfig\022\021\n\004zone\030\001 \001(\t" - + "B\003\340A\003\022\031\n\014machine_type\030\002 \001(\tB\003\340A\002\022H\n\020cont" - + "ainer_images\030\003 \003(\0132).google.cloud.notebo" - + "oks.v1.ContainerImageB\003\340A\001\022<\n\tdata_disk\030" - + "\004 \001(\0132$.google.cloud.notebooks.v1.LocalD" - + "iskB\003\340A\002\022K\n\021encryption_config\030\005 \001(\0132+.go" - + "ogle.cloud.notebooks.v1.EncryptionConfig" - + "B\003\340A\001\022_\n\030shielded_instance_config\030\006 \001(\0132" - + "8.google.cloud.notebooks.v1.RuntimeShiel" - + "dedInstanceConfigB\003\340A\001\022T\n\022accelerator_co" - + "nfig\030\007 \001(\01323.google.cloud.notebooks.v1.R" - + "untimeAcceleratorConfigB\003\340A\001\022\024\n\007network\030" - + "\010 \001(\tB\003\340A\001\022\023\n\006subnet\030\t \001(\tB\003\340A\001\022\035\n\020inter" - + "nal_ip_only\030\n \001(\010B\003\340A\001\022\021\n\004tags\030\r \003(\tB\003\340A" - + "\001\022c\n\020guest_attributes\030\016 \003(\0132D.google.clo" - + "ud.notebooks.v1.VirtualMachineConfig.Gue" - + "stAttributesEntryB\003\340A\003\022T\n\010metadata\030\017 \003(\013" - + "2=.google.cloud.notebooks.v1.VirtualMach" - + "ineConfig.MetadataEntryB\003\340A\001\022P\n\006labels\030\020" - + " \003(\0132;.google.cloud.notebooks.v1.Virtual" - + "MachineConfig.LabelsEntryB\003\340A\001\022N\n\010nic_ty" - + "pe\030\021 \001(\01627.google.cloud.notebooks.v1.Vir" - + "tualMachineConfig.NicTypeB\003\340A\001\022\036\n\021reserv" - + "ed_ip_range\030\022 \001(\tB\003\340A\001\022R\n\nboot_image\030\023 \001" - + "(\01329.google.cloud.notebooks.v1.VirtualMa" - + "chineConfig.BootImageB\003\340A\001\032\013\n\tBootImage\032" - + "6\n\024GuestAttributesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" - + "value\030\002 \001(\t:\0028\001\032/\n\rMetadataEntry\022\013\n\003key\030" - + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032-\n\013LabelsEntry\022" - + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\">\n\007NicTy" - + "pe\022\030\n\024UNSPECIFIED_NIC_TYPE\020\000\022\016\n\nVIRTIO_N" - + "ET\020\001\022\t\n\005GVNIC\020\002B\312\001\n\035com.google.cloud.not" - + "ebooks.v1B\014RuntimeProtoP\001ZBgoogle.golang" - + ".org/genproto/googleapis/cloud/notebooks" - + "/v1;notebooks\252\002\031Google.Cloud.Notebooks.V" - + "1\312\002\031Google\\Cloud\\Notebooks\\V1\352\002\034Google::" - + "Cloud::Notebooks::V1b\006proto3" + + "(\003\"\241\002\n\017AcceleratorType\022 \n\034ACCELERATOR_TY" + + "PE_UNSPECIFIED\020\000\022\030\n\020NVIDIA_TESLA_K80\020\001\032\002" + + "\010\001\022\025\n\021NVIDIA_TESLA_P100\020\002\022\025\n\021NVIDIA_TESL" + + "A_V100\020\003\022\023\n\017NVIDIA_TESLA_P4\020\004\022\023\n\017NVIDIA_" + + "TESLA_T4\020\005\022\025\n\021NVIDIA_TESLA_A100\020\006\022\n\n\006TPU" + + "_V2\020\007\022\n\n\006TPU_V3\020\010\022\027\n\023NVIDIA_TESLA_T4_VWS" + + "\020\t\022\031\n\025NVIDIA_TESLA_P100_VWS\020\n\022\027\n\023NVIDIA_" + + "TESLA_P4_VWS\020\013\"#\n\020EncryptionConfig\022\017\n\007km" + + "s_key\030\001 \001(\t\"\250\003\n\tLocalDisk\022\030\n\013auto_delete" + + "\030\001 \001(\010B\003\340A\003\022\021\n\004boot\030\002 \001(\010B\003\340A\003\022\030\n\013device" + + "_name\030\003 \001(\tB\003\340A\003\022Z\n\021guest_os_features\030\004 " + + "\003(\0132:.google.cloud.notebooks.v1.LocalDis" + + "k.RuntimeGuestOsFeatureB\003\340A\003\022\022\n\005index\030\005 " + + "\001(\005B\003\340A\003\022T\n\021initialize_params\030\006 \001(\01324.go" + + "ogle.cloud.notebooks.v1.LocalDiskInitial" + + "izeParamsB\003\340A\004\022\021\n\tinterface\030\007 \001(\t\022\021\n\004kin" + + "d\030\010 \001(\tB\003\340A\003\022\025\n\010licenses\030\t \003(\tB\003\340A\003\022\014\n\004m" + + "ode\030\n \001(\t\022\016\n\006source\030\013 \001(\t\022\014\n\004type\030\014 \001(\t\032" + + "%\n\025RuntimeGuestOsFeature\022\014\n\004type\030\001 \001(\t\"\252" + + "\003\n\031LocalDiskInitializeParams\022\030\n\013descript" + + "ion\030\001 \001(\tB\003\340A\001\022\026\n\tdisk_name\030\002 \001(\tB\003\340A\001\022\031" + + "\n\014disk_size_gb\030\003 \001(\003B\003\340A\001\022U\n\tdisk_type\030\004" + + " \001(\0162=.google.cloud.notebooks.v1.LocalDi" + + "skInitializeParams.DiskTypeB\003\340A\004\022U\n\006labe" + + "ls\030\005 \003(\0132@.google.cloud.notebooks.v1.Loc" + + "alDiskInitializeParams.LabelsEntryB\003\340A\001\032" + + "-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + + "(\t:\0028\001\"c\n\010DiskType\022\031\n\025DISK_TYPE_UNSPECIF" + + "IED\020\000\022\017\n\013PD_STANDARD\020\001\022\n\n\006PD_SSD\020\002\022\017\n\013PD" + + "_BALANCED\020\003\022\016\n\nPD_EXTREME\020\004\"\373\001\n\023RuntimeA" + + "ccessConfig\022U\n\013access_type\030\001 \001(\0162@.googl" + + "e.cloud.notebooks.v1.RuntimeAccessConfig" + + ".RuntimeAccessType\022\025\n\rruntime_owner\030\002 \001(" + + "\t\022\026\n\tproxy_uri\030\003 \001(\tB\003\340A\003\"^\n\021RuntimeAcce" + + "ssType\022#\n\037RUNTIME_ACCESS_TYPE_UNSPECIFIE" + + "D\020\000\022\017\n\013SINGLE_USER\020\001\022\023\n\017SERVICE_ACCOUNT\020" + + "\002\"\344\005\n\025RuntimeSoftwareConfig\022!\n\031notebook_" + + "upgrade_schedule\030\001 \001(\t\022%\n\030enable_health_" + + "monitoring\030\002 \001(\010H\000\210\001\001\022\032\n\ridle_shutdown\030\003" + + " \001(\010H\001\210\001\001\022\035\n\025idle_shutdown_timeout\030\004 \001(\005" + + "\022\032\n\022install_gpu_driver\030\005 \001(\010\022\036\n\026custom_g" + + "pu_driver_path\030\006 \001(\t\022\033\n\023post_startup_scr" + + "ipt\030\007 \001(\t\022?\n\007kernels\030\010 \003(\0132).google.clou" + + "d.notebooks.v1.ContainerImageB\003\340A\001\022\035\n\013up" + + "gradeable\030\t \001(\010B\003\340A\003H\002\210\001\001\022p\n\034post_startu" + + "p_script_behavior\030\n \001(\0162J.google.cloud.n" + + "otebooks.v1.RuntimeSoftwareConfig.PostSt" + + "artupScriptBehavior\022\035\n\020disable_terminal\030" + + "\013 \001(\010H\003\210\001\001\022\031\n\007version\030\014 \001(\tB\003\340A\003H\004\210\001\001\"\200\001" + + "\n\031PostStartupScriptBehavior\022,\n(POST_STAR" + + "TUP_SCRIPT_BEHAVIOR_UNSPECIFIED\020\000\022\023\n\017RUN" + + "_EVERY_START\020\001\022 \n\034DOWNLOAD_AND_RUN_EVERY" + + "_START\020\002B\033\n\031_enable_health_monitoringB\020\n" + + "\016_idle_shutdownB\016\n\014_upgradeableB\023\n\021_disa" + + "ble_terminalB\n\n\010_version\"\241\001\n\016RuntimeMetr" + + "ics\022Y\n\016system_metrics\030\001 \003(\0132<.google.clo" + + "ud.notebooks.v1.RuntimeMetrics.SystemMet" + + "ricsEntryB\003\340A\003\0324\n\022SystemMetricsEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"u\n\035RuntimeS" + + "hieldedInstanceConfig\022\032\n\022enable_secure_b" + + "oot\030\001 \001(\010\022\023\n\013enable_vtpm\030\002 \001(\010\022#\n\033enable" + + "_integrity_monitoring\030\003 \001(\010\"\227\001\n\016VirtualM" + + "achine\022\032\n\rinstance_name\030\001 \001(\tB\003\340A\003\022\030\n\013in" + + "stance_id\030\002 \001(\tB\003\340A\003\022O\n\026virtual_machine_" + + "config\030\003 \001(\0132/.google.cloud.notebooks.v1" + + ".VirtualMachineConfig\"\343\t\n\024VirtualMachine" + + "Config\022\021\n\004zone\030\001 \001(\tB\003\340A\003\022\031\n\014machine_typ" + + "e\030\002 \001(\tB\003\340A\002\022H\n\020container_images\030\003 \003(\0132)" + + ".google.cloud.notebooks.v1.ContainerImag" + + "eB\003\340A\001\022<\n\tdata_disk\030\004 \001(\0132$.google.cloud" + + ".notebooks.v1.LocalDiskB\003\340A\002\022K\n\021encrypti" + + "on_config\030\005 \001(\0132+.google.cloud.notebooks" + + ".v1.EncryptionConfigB\003\340A\001\022_\n\030shielded_in" + + "stance_config\030\006 \001(\01328.google.cloud.noteb" + + "ooks.v1.RuntimeShieldedInstanceConfigB\003\340" + + "A\001\022T\n\022accelerator_config\030\007 \001(\01323.google." + + "cloud.notebooks.v1.RuntimeAcceleratorCon" + + "figB\003\340A\001\022\024\n\007network\030\010 \001(\tB\003\340A\001\022\023\n\006subnet" + + "\030\t \001(\tB\003\340A\001\022\035\n\020internal_ip_only\030\n \001(\010B\003\340" + + "A\001\022\021\n\004tags\030\r \003(\tB\003\340A\001\022c\n\020guest_attribute" + + "s\030\016 \003(\0132D.google.cloud.notebooks.v1.Virt" + + "ualMachineConfig.GuestAttributesEntryB\003\340" + + "A\003\022T\n\010metadata\030\017 \003(\0132=.google.cloud.note" + + "books.v1.VirtualMachineConfig.MetadataEn" + + "tryB\003\340A\001\022P\n\006labels\030\020 \003(\0132;.google.cloud." + + "notebooks.v1.VirtualMachineConfig.Labels" + + "EntryB\003\340A\001\022N\n\010nic_type\030\021 \001(\01627.google.cl" + + "oud.notebooks.v1.VirtualMachineConfig.Ni" + + "cTypeB\003\340A\001\022\036\n\021reserved_ip_range\030\022 \001(\tB\003\340" + + "A\001\022R\n\nboot_image\030\023 \001(\01329.google.cloud.no" + + "tebooks.v1.VirtualMachineConfig.BootImag" + + "eB\003\340A\001\032\013\n\tBootImage\0326\n\024GuestAttributesEn" + + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032/\n\rM" + + "etadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + + ":\0028\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" + + "e\030\002 \001(\t:\0028\001\">\n\007NicType\022\030\n\024UNSPECIFIED_NI" + + "C_TYPE\020\000\022\016\n\nVIRTIO_NET\020\001\022\t\n\005GVNIC\020\002B\312\001\n\035" + + "com.google.cloud.notebooks.v1B\014RuntimePr" + + "otoP\001ZBgoogle.golang.org/genproto/google" + + "apis/cloud/notebooks/v1;notebooks\252\002\031Goog" + + "le.Cloud.Notebooks.V1\312\002\031Google\\Cloud\\Not" + + "ebooks\\V1\352\002\034Google::Cloud::Notebooks::V1" + + "b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -345,9 +354,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PostStartupScript", "Kernels", "Upgradeable", + "PostStartupScriptBehavior", + "DisableTerminal", + "Version", "EnableHealthMonitoring", "IdleShutdown", "Upgradeable", + "DisableTerminal", + "Version", }); internal_static_google_cloud_notebooks_v1_RuntimeMetrics_descriptor = getDescriptor().getMessageTypes().get(7); diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeSoftwareConfig.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeSoftwareConfig.java index 9c0ed0d7802b..39662812242e 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeSoftwareConfig.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeSoftwareConfig.java @@ -47,6 +47,8 @@ private RuntimeSoftwareConfig() { customGpuDriverPath_ = ""; postStartupScript_ = ""; kernels_ = java.util.Collections.emptyList(); + postStartupScriptBehavior_ = 0; + version_ = ""; } @java.lang.Override @@ -75,6 +77,168 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.Builder.class); } + /** + * + * + *
+   * Behavior for the post startup script.
+   * 
+ * + * Protobuf enum {@code google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior} + */ + public enum PostStartupScriptBehavior implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified post startup script behavior. Will run only once at creation.
+     * 
+ * + * POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED = 0; + */ + POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED(0), + /** + * + * + *
+     * Runs the post startup script provided during creation at every start.
+     * 
+ * + * RUN_EVERY_START = 1; + */ + RUN_EVERY_START(1), + /** + * + * + *
+     * Downloads and runs the provided post startup script at every start.
+     * 
+ * + * DOWNLOAD_AND_RUN_EVERY_START = 2; + */ + DOWNLOAD_AND_RUN_EVERY_START(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified post startup script behavior. Will run only once at creation.
+     * 
+ * + * POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED = 0; + */ + public static final int POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Runs the post startup script provided during creation at every start.
+     * 
+ * + * RUN_EVERY_START = 1; + */ + public static final int RUN_EVERY_START_VALUE = 1; + /** + * + * + *
+     * Downloads and runs the provided post startup script at every start.
+     * 
+ * + * DOWNLOAD_AND_RUN_EVERY_START = 2; + */ + public static final int DOWNLOAD_AND_RUN_EVERY_START_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PostStartupScriptBehavior valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static PostStartupScriptBehavior forNumber(int value) { + switch (value) { + case 0: + return POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED; + case 1: + return RUN_EVERY_START; + case 2: + return DOWNLOAD_AND_RUN_EVERY_START; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PostStartupScriptBehavior findValueByNumber(int number) { + return PostStartupScriptBehavior.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final PostStartupScriptBehavior[] VALUES = values(); + + public static PostStartupScriptBehavior valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private PostStartupScriptBehavior(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior) + } + private int bitField0_; public static final int NOTEBOOK_UPGRADE_SCHEDULE_FIELD_NUMBER = 1; private volatile java.lang.Object notebookUpgradeSchedule_; @@ -450,6 +614,149 @@ public boolean getUpgradeable() { return upgradeable_; } + public static final int POST_STARTUP_SCRIPT_BEHAVIOR_FIELD_NUMBER = 10; + private int postStartupScriptBehavior_; + /** + * + * + *
+   * Behavior for the post startup script.
+   * 
+ * + * + * .google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior post_startup_script_behavior = 10; + * + * + * @return The enum numeric value on the wire for postStartupScriptBehavior. + */ + @java.lang.Override + public int getPostStartupScriptBehaviorValue() { + return postStartupScriptBehavior_; + } + /** + * + * + *
+   * Behavior for the post startup script.
+   * 
+ * + * + * .google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior post_startup_script_behavior = 10; + * + * + * @return The postStartupScriptBehavior. + */ + @java.lang.Override + public com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior + getPostStartupScriptBehavior() { + @SuppressWarnings("deprecation") + com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior result = + com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior.valueOf( + postStartupScriptBehavior_); + return result == null + ? com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior.UNRECOGNIZED + : result; + } + + public static final int DISABLE_TERMINAL_FIELD_NUMBER = 11; + private boolean disableTerminal_; + /** + * + * + *
+   * Bool indicating whether JupyterLab terminal will be available or not.
+   * Default: False
+   * 
+ * + * optional bool disable_terminal = 11; + * + * @return Whether the disableTerminal field is set. + */ + @java.lang.Override + public boolean hasDisableTerminal() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Bool indicating whether JupyterLab terminal will be available or not.
+   * Default: False
+   * 
+ * + * optional bool disable_terminal = 11; + * + * @return The disableTerminal. + */ + @java.lang.Override + public boolean getDisableTerminal() { + return disableTerminal_; + } + + public static final int VERSION_FIELD_NUMBER = 12; + private volatile java.lang.Object version_; + /** + * + * + *
+   * Output only. version of boot image such as M100, from release label of the image.
+   * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Output only. version of boot image such as M100, from release label of the image.
+   * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. version of boot image such as M100, from release label of the image.
+   * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -491,6 +798,18 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000004) != 0)) { output.writeBool(9, upgradeable_); } + if (postStartupScriptBehavior_ + != com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior + .POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, postStartupScriptBehavior_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(11, disableTerminal_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, version_); + } getUnknownFields().writeTo(output); } @@ -527,6 +846,18 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, upgradeable_); } + if (postStartupScriptBehavior_ + != com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior + .POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, postStartupScriptBehavior_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, disableTerminal_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, version_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -561,6 +892,15 @@ public boolean equals(final java.lang.Object obj) { if (hasUpgradeable()) { if (getUpgradeable() != other.getUpgradeable()) return false; } + if (postStartupScriptBehavior_ != other.postStartupScriptBehavior_) return false; + if (hasDisableTerminal() != other.hasDisableTerminal()) return false; + if (hasDisableTerminal()) { + if (getDisableTerminal() != other.getDisableTerminal()) return false; + } + if (hasVersion() != other.hasVersion()) return false; + if (hasVersion()) { + if (!getVersion().equals(other.getVersion())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -598,6 +938,16 @@ public int hashCode() { hash = (37 * hash) + UPGRADEABLE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUpgradeable()); } + hash = (37 * hash) + POST_STARTUP_SCRIPT_BEHAVIOR_FIELD_NUMBER; + hash = (53 * hash) + postStartupScriptBehavior_; + if (hasDisableTerminal()) { + hash = (37 * hash) + DISABLE_TERMINAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisableTerminal()); + } + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -764,6 +1114,12 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000004); upgradeable_ = false; bitField0_ = (bitField0_ & ~0x00000008); + postStartupScriptBehavior_ = 0; + + disableTerminal_ = false; + bitField0_ = (bitField0_ & ~0x00000010); + version_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); return this; } @@ -819,6 +1175,15 @@ public com.google.cloud.notebooks.v1.RuntimeSoftwareConfig buildPartial() { result.upgradeable_ = upgradeable_; to_bitField0_ |= 0x00000004; } + result.postStartupScriptBehavior_ = postStartupScriptBehavior_; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.disableTerminal_ = disableTerminal_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + to_bitField0_ |= 0x00000010; + } + result.version_ = version_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -924,6 +1289,17 @@ public Builder mergeFrom(com.google.cloud.notebooks.v1.RuntimeSoftwareConfig oth if (other.hasUpgradeable()) { setUpgradeable(other.getUpgradeable()); } + if (other.postStartupScriptBehavior_ != 0) { + setPostStartupScriptBehaviorValue(other.getPostStartupScriptBehaviorValue()); + } + if (other.hasDisableTerminal()) { + setDisableTerminal(other.getDisableTerminal()); + } + if (other.hasVersion()) { + bitField0_ |= 0x00000020; + version_ = other.version_; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1011,6 +1387,24 @@ public Builder mergeFrom( bitField0_ |= 0x00000008; break; } // case 72 + case 80: + { + postStartupScriptBehavior_ = input.readEnum(); + + break; + } // case 80 + case 88: + { + disableTerminal_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 88 + case 98: + { + version_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 98 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2070,6 +2464,304 @@ public Builder clearUpgradeable() { return this; } + private int postStartupScriptBehavior_ = 0; + /** + * + * + *
+     * Behavior for the post startup script.
+     * 
+ * + * + * .google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior post_startup_script_behavior = 10; + * + * + * @return The enum numeric value on the wire for postStartupScriptBehavior. + */ + @java.lang.Override + public int getPostStartupScriptBehaviorValue() { + return postStartupScriptBehavior_; + } + /** + * + * + *
+     * Behavior for the post startup script.
+     * 
+ * + * + * .google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior post_startup_script_behavior = 10; + * + * + * @param value The enum numeric value on the wire for postStartupScriptBehavior to set. + * @return This builder for chaining. + */ + public Builder setPostStartupScriptBehaviorValue(int value) { + + postStartupScriptBehavior_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Behavior for the post startup script.
+     * 
+ * + * + * .google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior post_startup_script_behavior = 10; + * + * + * @return The postStartupScriptBehavior. + */ + @java.lang.Override + public com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior + getPostStartupScriptBehavior() { + @SuppressWarnings("deprecation") + com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior result = + com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior.valueOf( + postStartupScriptBehavior_); + return result == null + ? com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Behavior for the post startup script.
+     * 
+ * + * + * .google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior post_startup_script_behavior = 10; + * + * + * @param value The postStartupScriptBehavior to set. + * @return This builder for chaining. + */ + public Builder setPostStartupScriptBehavior( + com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior value) { + if (value == null) { + throw new NullPointerException(); + } + + postStartupScriptBehavior_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Behavior for the post startup script.
+     * 
+ * + * + * .google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior post_startup_script_behavior = 10; + * + * + * @return This builder for chaining. + */ + public Builder clearPostStartupScriptBehavior() { + + postStartupScriptBehavior_ = 0; + onChanged(); + return this; + } + + private boolean disableTerminal_; + /** + * + * + *
+     * Bool indicating whether JupyterLab terminal will be available or not.
+     * Default: False
+     * 
+ * + * optional bool disable_terminal = 11; + * + * @return Whether the disableTerminal field is set. + */ + @java.lang.Override + public boolean hasDisableTerminal() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Bool indicating whether JupyterLab terminal will be available or not.
+     * Default: False
+     * 
+ * + * optional bool disable_terminal = 11; + * + * @return The disableTerminal. + */ + @java.lang.Override + public boolean getDisableTerminal() { + return disableTerminal_; + } + /** + * + * + *
+     * Bool indicating whether JupyterLab terminal will be available or not.
+     * Default: False
+     * 
+ * + * optional bool disable_terminal = 11; + * + * @param value The disableTerminal to set. + * @return This builder for chaining. + */ + public Builder setDisableTerminal(boolean value) { + bitField0_ |= 0x00000010; + disableTerminal_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Bool indicating whether JupyterLab terminal will be available or not.
+     * Default: False
+     * 
+ * + * optional bool disable_terminal = 11; + * + * @return This builder for chaining. + */ + public Builder clearDisableTerminal() { + bitField0_ = (bitField0_ & ~0x00000010); + disableTerminal_ = false; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * Output only. version of boot image such as M100, from release label of the image.
+     * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the version field is set. + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. version of boot image such as M100, from release label of the image.
+     * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. version of boot image such as M100, from release label of the image.
+     * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. version of boot image such as M100, from release label of the image.
+     * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. version of boot image such as M100, from release label of the image.
+     * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000020); + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. version of boot image such as M100, from release label of the image.
+     * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000020; + version_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeSoftwareConfigOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeSoftwareConfigOrBuilder.java index 8e126b397c83..bfc850359d8d 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeSoftwareConfigOrBuilder.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/RuntimeSoftwareConfigOrBuilder.java @@ -273,4 +273,98 @@ public interface RuntimeSoftwareConfigOrBuilder * @return The upgradeable. */ boolean getUpgradeable(); + + /** + * + * + *
+   * Behavior for the post startup script.
+   * 
+ * + * + * .google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior post_startup_script_behavior = 10; + * + * + * @return The enum numeric value on the wire for postStartupScriptBehavior. + */ + int getPostStartupScriptBehaviorValue(); + /** + * + * + *
+   * Behavior for the post startup script.
+   * 
+ * + * + * .google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior post_startup_script_behavior = 10; + * + * + * @return The postStartupScriptBehavior. + */ + com.google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior + getPostStartupScriptBehavior(); + + /** + * + * + *
+   * Bool indicating whether JupyterLab terminal will be available or not.
+   * Default: False
+   * 
+ * + * optional bool disable_terminal = 11; + * + * @return Whether the disableTerminal field is set. + */ + boolean hasDisableTerminal(); + /** + * + * + *
+   * Bool indicating whether JupyterLab terminal will be available or not.
+   * Default: False
+   * 
+ * + * optional bool disable_terminal = 11; + * + * @return The disableTerminal. + */ + boolean getDisableTerminal(); + + /** + * + * + *
+   * Output only. version of boot image such as M100, from release label of the image.
+   * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + * + * + *
+   * Output only. version of boot image such as M100, from release label of the image.
+   * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * Output only. version of boot image such as M100, from release label of the image.
+   * 
+ * + * optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); } diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpdateRuntimeRequest.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpdateRuntimeRequest.java new file mode 100644 index 000000000000..43340d36731c --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpdateRuntimeRequest.java @@ -0,0 +1,1404 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1/managed_service.proto + +package com.google.cloud.notebooks.v1; + +/** + * + * + *
+ * Request for updating a Managed Notebook configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1.UpdateRuntimeRequest} + */ +public final class UpdateRuntimeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.notebooks.v1.UpdateRuntimeRequest) + UpdateRuntimeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateRuntimeRequest.newBuilder() to construct. + private UpdateRuntimeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateRuntimeRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateRuntimeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_UpdateRuntimeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_UpdateRuntimeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1.UpdateRuntimeRequest.class, + com.google.cloud.notebooks.v1.UpdateRuntimeRequest.Builder.class); + } + + public static final int RUNTIME_FIELD_NUMBER = 1; + private com.google.cloud.notebooks.v1.Runtime runtime_; + /** + * + * + *
+   * Required. The Runtime to be updated.
+   * 
+ * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the runtime field is set. + */ + @java.lang.Override + public boolean hasRuntime() { + return runtime_ != null; + } + /** + * + * + *
+   * Required. The Runtime to be updated.
+   * 
+ * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The runtime. + */ + @java.lang.Override + public com.google.cloud.notebooks.v1.Runtime getRuntime() { + return runtime_ == null ? com.google.cloud.notebooks.v1.Runtime.getDefaultInstance() : runtime_; + } + /** + * + * + *
+   * Required. The Runtime to be updated.
+   * 
+ * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.notebooks.v1.RuntimeOrBuilder getRuntimeOrBuilder() { + return getRuntime(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Specifies the path, relative to `Runtime`, of
+   * the field to update. For example, to change the software configuration
+   * kernels, the `update_mask` parameter would be
+   * specified as `software_config.kernels`,
+   * and the `PATCH` request body would specify the new value, as follows:
+   *     {
+   *       "software_config":{
+   *         "kernels": [{
+   *            'repository':
+   *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+   *            'latest' }],
+   *         }
+   *     }
+   * Currently, only the following fields can be updated:
+   * - software_config.kernels
+   * - software_config.post_startup_script
+   * - software_config.custom_gpu_driver_path
+   * - software_config.idle_shutdown
+   * - software_config.idle_shutdown_timeout
+   * - software_config.disable_terminal
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Specifies the path, relative to `Runtime`, of
+   * the field to update. For example, to change the software configuration
+   * kernels, the `update_mask` parameter would be
+   * specified as `software_config.kernels`,
+   * and the `PATCH` request body would specify the new value, as follows:
+   *     {
+   *       "software_config":{
+   *         "kernels": [{
+   *            'repository':
+   *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+   *            'latest' }],
+   *         }
+   *     }
+   * Currently, only the following fields can be updated:
+   * - software_config.kernels
+   * - software_config.post_startup_script
+   * - software_config.custom_gpu_driver_path
+   * - software_config.idle_shutdown
+   * - software_config.idle_shutdown_timeout
+   * - software_config.disable_terminal
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Specifies the path, relative to `Runtime`, of
+   * the field to update. For example, to change the software configuration
+   * kernels, the `update_mask` parameter would be
+   * specified as `software_config.kernels`,
+   * and the `PATCH` request body would specify the new value, as follows:
+   *     {
+   *       "software_config":{
+   *         "kernels": [{
+   *            'repository':
+   *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+   *            'latest' }],
+   *         }
+   *     }
+   * Currently, only the following fields can be updated:
+   * - software_config.kernels
+   * - software_config.post_startup_script
+   * - software_config.custom_gpu_driver_path
+   * - software_config.idle_shutdown
+   * - software_config.idle_shutdown_timeout
+   * - software_config.disable_terminal
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (runtime_ != null) { + output.writeMessage(1, getRuntime()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (runtime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRuntime()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.notebooks.v1.UpdateRuntimeRequest)) { + return super.equals(obj); + } + com.google.cloud.notebooks.v1.UpdateRuntimeRequest other = + (com.google.cloud.notebooks.v1.UpdateRuntimeRequest) obj; + + if (hasRuntime() != other.hasRuntime()) return false; + if (hasRuntime()) { + if (!getRuntime().equals(other.getRuntime())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRuntime()) { + hash = (37 * hash) + RUNTIME_FIELD_NUMBER; + hash = (53 * hash) + getRuntime().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.notebooks.v1.UpdateRuntimeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for updating a Managed Notebook configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1.UpdateRuntimeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.notebooks.v1.UpdateRuntimeRequest) + com.google.cloud.notebooks.v1.UpdateRuntimeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_UpdateRuntimeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_UpdateRuntimeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1.UpdateRuntimeRequest.class, + com.google.cloud.notebooks.v1.UpdateRuntimeRequest.Builder.class); + } + + // Construct using com.google.cloud.notebooks.v1.UpdateRuntimeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (runtimeBuilder_ == null) { + runtime_ = null; + } else { + runtime_ = null; + runtimeBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_UpdateRuntimeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.UpdateRuntimeRequest getDefaultInstanceForType() { + return com.google.cloud.notebooks.v1.UpdateRuntimeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.UpdateRuntimeRequest build() { + com.google.cloud.notebooks.v1.UpdateRuntimeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.UpdateRuntimeRequest buildPartial() { + com.google.cloud.notebooks.v1.UpdateRuntimeRequest result = + new com.google.cloud.notebooks.v1.UpdateRuntimeRequest(this); + if (runtimeBuilder_ == null) { + result.runtime_ = runtime_; + } else { + result.runtime_ = runtimeBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.notebooks.v1.UpdateRuntimeRequest) { + return mergeFrom((com.google.cloud.notebooks.v1.UpdateRuntimeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.notebooks.v1.UpdateRuntimeRequest other) { + if (other == com.google.cloud.notebooks.v1.UpdateRuntimeRequest.getDefaultInstance()) + return this; + if (other.hasRuntime()) { + mergeRuntime(other.getRuntime()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getRuntimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.cloud.notebooks.v1.Runtime runtime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1.Runtime, + com.google.cloud.notebooks.v1.Runtime.Builder, + com.google.cloud.notebooks.v1.RuntimeOrBuilder> + runtimeBuilder_; + /** + * + * + *
+     * Required. The Runtime to be updated.
+     * 
+ * + * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the runtime field is set. + */ + public boolean hasRuntime() { + return runtimeBuilder_ != null || runtime_ != null; + } + /** + * + * + *
+     * Required. The Runtime to be updated.
+     * 
+ * + * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The runtime. + */ + public com.google.cloud.notebooks.v1.Runtime getRuntime() { + if (runtimeBuilder_ == null) { + return runtime_ == null + ? com.google.cloud.notebooks.v1.Runtime.getDefaultInstance() + : runtime_; + } else { + return runtimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Runtime to be updated.
+     * 
+ * + * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRuntime(com.google.cloud.notebooks.v1.Runtime value) { + if (runtimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + runtime_ = value; + onChanged(); + } else { + runtimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Runtime to be updated.
+     * 
+ * + * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRuntime(com.google.cloud.notebooks.v1.Runtime.Builder builderForValue) { + if (runtimeBuilder_ == null) { + runtime_ = builderForValue.build(); + onChanged(); + } else { + runtimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The Runtime to be updated.
+     * 
+ * + * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeRuntime(com.google.cloud.notebooks.v1.Runtime value) { + if (runtimeBuilder_ == null) { + if (runtime_ != null) { + runtime_ = + com.google.cloud.notebooks.v1.Runtime.newBuilder(runtime_) + .mergeFrom(value) + .buildPartial(); + } else { + runtime_ = value; + } + onChanged(); + } else { + runtimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Runtime to be updated.
+     * 
+ * + * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRuntime() { + if (runtimeBuilder_ == null) { + runtime_ = null; + onChanged(); + } else { + runtime_ = null; + runtimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The Runtime to be updated.
+     * 
+ * + * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.notebooks.v1.Runtime.Builder getRuntimeBuilder() { + + onChanged(); + return getRuntimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Runtime to be updated.
+     * 
+ * + * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.notebooks.v1.RuntimeOrBuilder getRuntimeOrBuilder() { + if (runtimeBuilder_ != null) { + return runtimeBuilder_.getMessageOrBuilder(); + } else { + return runtime_ == null + ? com.google.cloud.notebooks.v1.Runtime.getDefaultInstance() + : runtime_; + } + } + /** + * + * + *
+     * Required. The Runtime to be updated.
+     * 
+ * + * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1.Runtime, + com.google.cloud.notebooks.v1.Runtime.Builder, + com.google.cloud.notebooks.v1.RuntimeOrBuilder> + getRuntimeFieldBuilder() { + if (runtimeBuilder_ == null) { + runtimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1.Runtime, + com.google.cloud.notebooks.v1.Runtime.Builder, + com.google.cloud.notebooks.v1.RuntimeOrBuilder>( + getRuntime(), getParentForChildren(), isClean()); + runtime_ = null; + } + return runtimeBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Specifies the path, relative to `Runtime`, of
+     * the field to update. For example, to change the software configuration
+     * kernels, the `update_mask` parameter would be
+     * specified as `software_config.kernels`,
+     * and the `PATCH` request body would specify the new value, as follows:
+     *     {
+     *       "software_config":{
+     *         "kernels": [{
+     *            'repository':
+     *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+     *            'latest' }],
+     *         }
+     *     }
+     * Currently, only the following fields can be updated:
+     * - software_config.kernels
+     * - software_config.post_startup_script
+     * - software_config.custom_gpu_driver_path
+     * - software_config.idle_shutdown
+     * - software_config.idle_shutdown_timeout
+     * - software_config.disable_terminal
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Specifies the path, relative to `Runtime`, of
+     * the field to update. For example, to change the software configuration
+     * kernels, the `update_mask` parameter would be
+     * specified as `software_config.kernels`,
+     * and the `PATCH` request body would specify the new value, as follows:
+     *     {
+     *       "software_config":{
+     *         "kernels": [{
+     *            'repository':
+     *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+     *            'latest' }],
+     *         }
+     *     }
+     * Currently, only the following fields can be updated:
+     * - software_config.kernels
+     * - software_config.post_startup_script
+     * - software_config.custom_gpu_driver_path
+     * - software_config.idle_shutdown
+     * - software_config.idle_shutdown_timeout
+     * - software_config.disable_terminal
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Specifies the path, relative to `Runtime`, of
+     * the field to update. For example, to change the software configuration
+     * kernels, the `update_mask` parameter would be
+     * specified as `software_config.kernels`,
+     * and the `PATCH` request body would specify the new value, as follows:
+     *     {
+     *       "software_config":{
+     *         "kernels": [{
+     *            'repository':
+     *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+     *            'latest' }],
+     *         }
+     *     }
+     * Currently, only the following fields can be updated:
+     * - software_config.kernels
+     * - software_config.post_startup_script
+     * - software_config.custom_gpu_driver_path
+     * - software_config.idle_shutdown
+     * - software_config.idle_shutdown_timeout
+     * - software_config.disable_terminal
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Specifies the path, relative to `Runtime`, of
+     * the field to update. For example, to change the software configuration
+     * kernels, the `update_mask` parameter would be
+     * specified as `software_config.kernels`,
+     * and the `PATCH` request body would specify the new value, as follows:
+     *     {
+     *       "software_config":{
+     *         "kernels": [{
+     *            'repository':
+     *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+     *            'latest' }],
+     *         }
+     *     }
+     * Currently, only the following fields can be updated:
+     * - software_config.kernels
+     * - software_config.post_startup_script
+     * - software_config.custom_gpu_driver_path
+     * - software_config.idle_shutdown
+     * - software_config.idle_shutdown_timeout
+     * - software_config.disable_terminal
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Specifies the path, relative to `Runtime`, of
+     * the field to update. For example, to change the software configuration
+     * kernels, the `update_mask` parameter would be
+     * specified as `software_config.kernels`,
+     * and the `PATCH` request body would specify the new value, as follows:
+     *     {
+     *       "software_config":{
+     *         "kernels": [{
+     *            'repository':
+     *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+     *            'latest' }],
+     *         }
+     *     }
+     * Currently, only the following fields can be updated:
+     * - software_config.kernels
+     * - software_config.post_startup_script
+     * - software_config.custom_gpu_driver_path
+     * - software_config.idle_shutdown
+     * - software_config.idle_shutdown_timeout
+     * - software_config.disable_terminal
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Specifies the path, relative to `Runtime`, of
+     * the field to update. For example, to change the software configuration
+     * kernels, the `update_mask` parameter would be
+     * specified as `software_config.kernels`,
+     * and the `PATCH` request body would specify the new value, as follows:
+     *     {
+     *       "software_config":{
+     *         "kernels": [{
+     *            'repository':
+     *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+     *            'latest' }],
+     *         }
+     *     }
+     * Currently, only the following fields can be updated:
+     * - software_config.kernels
+     * - software_config.post_startup_script
+     * - software_config.custom_gpu_driver_path
+     * - software_config.idle_shutdown
+     * - software_config.idle_shutdown_timeout
+     * - software_config.disable_terminal
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Specifies the path, relative to `Runtime`, of
+     * the field to update. For example, to change the software configuration
+     * kernels, the `update_mask` parameter would be
+     * specified as `software_config.kernels`,
+     * and the `PATCH` request body would specify the new value, as follows:
+     *     {
+     *       "software_config":{
+     *         "kernels": [{
+     *            'repository':
+     *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+     *            'latest' }],
+     *         }
+     *     }
+     * Currently, only the following fields can be updated:
+     * - software_config.kernels
+     * - software_config.post_startup_script
+     * - software_config.custom_gpu_driver_path
+     * - software_config.idle_shutdown
+     * - software_config.idle_shutdown_timeout
+     * - software_config.disable_terminal
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Specifies the path, relative to `Runtime`, of
+     * the field to update. For example, to change the software configuration
+     * kernels, the `update_mask` parameter would be
+     * specified as `software_config.kernels`,
+     * and the `PATCH` request body would specify the new value, as follows:
+     *     {
+     *       "software_config":{
+     *         "kernels": [{
+     *            'repository':
+     *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+     *            'latest' }],
+     *         }
+     *     }
+     * Currently, only the following fields can be updated:
+     * - software_config.kernels
+     * - software_config.post_startup_script
+     * - software_config.custom_gpu_driver_path
+     * - software_config.idle_shutdown
+     * - software_config.idle_shutdown_timeout
+     * - software_config.disable_terminal
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Specifies the path, relative to `Runtime`, of
+     * the field to update. For example, to change the software configuration
+     * kernels, the `update_mask` parameter would be
+     * specified as `software_config.kernels`,
+     * and the `PATCH` request body would specify the new value, as follows:
+     *     {
+     *       "software_config":{
+     *         "kernels": [{
+     *            'repository':
+     *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+     *            'latest' }],
+     *         }
+     *     }
+     * Currently, only the following fields can be updated:
+     * - software_config.kernels
+     * - software_config.post_startup_script
+     * - software_config.custom_gpu_driver_path
+     * - software_config.idle_shutdown
+     * - software_config.idle_shutdown_timeout
+     * - software_config.disable_terminal
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.notebooks.v1.UpdateRuntimeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.notebooks.v1.UpdateRuntimeRequest) + private static final com.google.cloud.notebooks.v1.UpdateRuntimeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.notebooks.v1.UpdateRuntimeRequest(); + } + + public static com.google.cloud.notebooks.v1.UpdateRuntimeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateRuntimeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.UpdateRuntimeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpdateRuntimeRequestOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpdateRuntimeRequestOrBuilder.java new file mode 100644 index 000000000000..3f44e9ea5db0 --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpdateRuntimeRequestOrBuilder.java @@ -0,0 +1,183 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1/managed_service.proto + +package com.google.cloud.notebooks.v1; + +public interface UpdateRuntimeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.notebooks.v1.UpdateRuntimeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Runtime to be updated.
+   * 
+ * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the runtime field is set. + */ + boolean hasRuntime(); + /** + * + * + *
+   * Required. The Runtime to be updated.
+   * 
+ * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The runtime. + */ + com.google.cloud.notebooks.v1.Runtime getRuntime(); + /** + * + * + *
+   * Required. The Runtime to be updated.
+   * 
+ * + * .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.notebooks.v1.RuntimeOrBuilder getRuntimeOrBuilder(); + + /** + * + * + *
+   * Required. Specifies the path, relative to `Runtime`, of
+   * the field to update. For example, to change the software configuration
+   * kernels, the `update_mask` parameter would be
+   * specified as `software_config.kernels`,
+   * and the `PATCH` request body would specify the new value, as follows:
+   *     {
+   *       "software_config":{
+   *         "kernels": [{
+   *            'repository':
+   *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+   *            'latest' }],
+   *         }
+   *     }
+   * Currently, only the following fields can be updated:
+   * - software_config.kernels
+   * - software_config.post_startup_script
+   * - software_config.custom_gpu_driver_path
+   * - software_config.idle_shutdown
+   * - software_config.idle_shutdown_timeout
+   * - software_config.disable_terminal
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Specifies the path, relative to `Runtime`, of
+   * the field to update. For example, to change the software configuration
+   * kernels, the `update_mask` parameter would be
+   * specified as `software_config.kernels`,
+   * and the `PATCH` request body would specify the new value, as follows:
+   *     {
+   *       "software_config":{
+   *         "kernels": [{
+   *            'repository':
+   *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+   *            'latest' }],
+   *         }
+   *     }
+   * Currently, only the following fields can be updated:
+   * - software_config.kernels
+   * - software_config.post_startup_script
+   * - software_config.custom_gpu_driver_path
+   * - software_config.idle_shutdown
+   * - software_config.idle_shutdown_timeout
+   * - software_config.disable_terminal
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Specifies the path, relative to `Runtime`, of
+   * the field to update. For example, to change the software configuration
+   * kernels, the `update_mask` parameter would be
+   * specified as `software_config.kernels`,
+   * and the `PATCH` request body would specify the new value, as follows:
+   *     {
+   *       "software_config":{
+   *         "kernels": [{
+   *            'repository':
+   *            'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
+   *            'latest' }],
+   *         }
+   *     }
+   * Currently, only the following fields can be updated:
+   * - software_config.kernels
+   * - software_config.post_startup_script
+   * - software_config.custom_gpu_driver_path
+   * - software_config.idle_shutdown
+   * - software_config.idle_shutdown_timeout
+   * - software_config.disable_terminal
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpgradeRuntimeRequest.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpgradeRuntimeRequest.java new file mode 100644 index 000000000000..73418778dfb1 --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpgradeRuntimeRequest.java @@ -0,0 +1,804 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1/managed_service.proto + +package com.google.cloud.notebooks.v1; + +/** + * + * + *
+ * Request for upgrading a Managed Notebook Runtime to the latest version.
+ * option (google.api.message_visibility).restriction =
+ *     "TRUSTED_TESTER,SPECIAL_TESTER";
+ * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1.UpgradeRuntimeRequest} + */ +public final class UpgradeRuntimeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.notebooks.v1.UpgradeRuntimeRequest) + UpgradeRuntimeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpgradeRuntimeRequest.newBuilder() to construct. + private UpgradeRuntimeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpgradeRuntimeRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpgradeRuntimeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_UpgradeRuntimeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_UpgradeRuntimeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest.class, + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.notebooks.v1.UpgradeRuntimeRequest)) { + return super.equals(obj); + } + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest other = + (com.google.cloud.notebooks.v1.UpgradeRuntimeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.notebooks.v1.UpgradeRuntimeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for upgrading a Managed Notebook Runtime to the latest version.
+   * option (google.api.message_visibility).restriction =
+   *     "TRUSTED_TESTER,SPECIAL_TESTER";
+   * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1.UpgradeRuntimeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.notebooks.v1.UpgradeRuntimeRequest) + com.google.cloud.notebooks.v1.UpgradeRuntimeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_UpgradeRuntimeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_UpgradeRuntimeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest.class, + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest.Builder.class); + } + + // Construct using com.google.cloud.notebooks.v1.UpgradeRuntimeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.notebooks.v1.ManagedNotebooksProto + .internal_static_google_cloud_notebooks_v1_UpgradeRuntimeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.UpgradeRuntimeRequest getDefaultInstanceForType() { + return com.google.cloud.notebooks.v1.UpgradeRuntimeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.UpgradeRuntimeRequest build() { + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.UpgradeRuntimeRequest buildPartial() { + com.google.cloud.notebooks.v1.UpgradeRuntimeRequest result = + new com.google.cloud.notebooks.v1.UpgradeRuntimeRequest(this); + result.name_ = name_; + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.notebooks.v1.UpgradeRuntimeRequest) { + return mergeFrom((com.google.cloud.notebooks.v1.UpgradeRuntimeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.notebooks.v1.UpgradeRuntimeRequest other) { + if (other == com.google.cloud.notebooks.v1.UpgradeRuntimeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Format:
+     * `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.notebooks.v1.UpgradeRuntimeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.notebooks.v1.UpgradeRuntimeRequest) + private static final com.google.cloud.notebooks.v1.UpgradeRuntimeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.notebooks.v1.UpgradeRuntimeRequest(); + } + + public static com.google.cloud.notebooks.v1.UpgradeRuntimeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpgradeRuntimeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1.UpgradeRuntimeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpgradeRuntimeRequestOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpgradeRuntimeRequestOrBuilder.java new file mode 100644 index 000000000000..cdafa6c85c03 --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/UpgradeRuntimeRequestOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1/managed_service.proto + +package com.google.cloud.notebooks.v1; + +public interface UpgradeRuntimeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.notebooks.v1.UpgradeRuntimeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/VirtualMachineConfig.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/VirtualMachineConfig.java index c26914773329..eba5a1ebe379 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/VirtualMachineConfig.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/VirtualMachineConfig.java @@ -1105,8 +1105,8 @@ public com.google.cloud.notebooks.v1.RuntimeAcceleratorConfig getAcceleratorConf * `network` nor `subnet` is specified, the "default" network of * the project is used, if it exists. * A full URL or partial URI. Examples: - * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default` - * * `projects/[project_id]/regions/global/default` + * * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + * * `projects/[project_id]/global/networks/default` * Runtimes are managed resources inside Google Infrastructure. * Runtimes support the following network configurations: * * Google Managed Network (Network & subnet are empty) @@ -1141,8 +1141,8 @@ public java.lang.String getNetwork() { * `network` nor `subnet` is specified, the "default" network of * the project is used, if it exists. * A full URL or partial URI. Examples: - * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default` - * * `projects/[project_id]/regions/global/default` + * * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + * * `projects/[project_id]/global/networks/default` * Runtimes are managed resources inside Google Infrastructure. * Runtimes support the following network configurations: * * Google Managed Network (Network & subnet are empty) @@ -4182,8 +4182,8 @@ public Builder clearAcceleratorConfig() { * `network` nor `subnet` is specified, the "default" network of * the project is used, if it exists. * A full URL or partial URI. Examples: - * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default` - * * `projects/[project_id]/regions/global/default` + * * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + * * `projects/[project_id]/global/networks/default` * Runtimes are managed resources inside Google Infrastructure. * Runtimes support the following network configurations: * * Google Managed Network (Network & subnet are empty) @@ -4217,8 +4217,8 @@ public java.lang.String getNetwork() { * `network` nor `subnet` is specified, the "default" network of * the project is used, if it exists. * A full URL or partial URI. Examples: - * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default` - * * `projects/[project_id]/regions/global/default` + * * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + * * `projects/[project_id]/global/networks/default` * Runtimes are managed resources inside Google Infrastructure. * Runtimes support the following network configurations: * * Google Managed Network (Network & subnet are empty) @@ -4252,8 +4252,8 @@ public com.google.protobuf.ByteString getNetworkBytes() { * `network` nor `subnet` is specified, the "default" network of * the project is used, if it exists. * A full URL or partial URI. Examples: - * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default` - * * `projects/[project_id]/regions/global/default` + * * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + * * `projects/[project_id]/global/networks/default` * Runtimes are managed resources inside Google Infrastructure. * Runtimes support the following network configurations: * * Google Managed Network (Network & subnet are empty) @@ -4286,8 +4286,8 @@ public Builder setNetwork(java.lang.String value) { * `network` nor `subnet` is specified, the "default" network of * the project is used, if it exists. * A full URL or partial URI. Examples: - * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default` - * * `projects/[project_id]/regions/global/default` + * * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + * * `projects/[project_id]/global/networks/default` * Runtimes are managed resources inside Google Infrastructure. * Runtimes support the following network configurations: * * Google Managed Network (Network & subnet are empty) @@ -4316,8 +4316,8 @@ public Builder clearNetwork() { * `network` nor `subnet` is specified, the "default" network of * the project is used, if it exists. * A full URL or partial URI. Examples: - * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default` - * * `projects/[project_id]/regions/global/default` + * * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + * * `projects/[project_id]/global/networks/default` * Runtimes are managed resources inside Google Infrastructure. * Runtimes support the following network configurations: * * Google Managed Network (Network & subnet are empty) diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/VirtualMachineConfigOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/VirtualMachineConfigOrBuilder.java index f648fd959954..46106f54883f 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/VirtualMachineConfigOrBuilder.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/java/com/google/cloud/notebooks/v1/VirtualMachineConfigOrBuilder.java @@ -323,8 +323,8 @@ public interface VirtualMachineConfigOrBuilder * `network` nor `subnet` is specified, the "default" network of * the project is used, if it exists. * A full URL or partial URI. Examples: - * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default` - * * `projects/[project_id]/regions/global/default` + * * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + * * `projects/[project_id]/global/networks/default` * Runtimes are managed resources inside Google Infrastructure. * Runtimes support the following network configurations: * * Google Managed Network (Network & subnet are empty) @@ -348,8 +348,8 @@ public interface VirtualMachineConfigOrBuilder * `network` nor `subnet` is specified, the "default" network of * the project is used, if it exists. * A full URL or partial URI. Examples: - * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default` - * * `projects/[project_id]/regions/global/default` + * * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + * * `projects/[project_id]/global/networks/default` * Runtimes are managed resources inside Google Infrastructure. * Runtimes support the following network configurations: * * Google Managed Network (Network & subnet are empty) diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/diagnostic_config.proto b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/diagnostic_config.proto new file mode 100644 index 000000000000..5dad7ae18438 --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/diagnostic_config.proto @@ -0,0 +1,57 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.notebooks.v1; + +import "google/api/field_behavior.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/notebooks/v1;notebooks"; +option java_multiple_files = true; +option java_outer_classname = "DiagnosticConfigProto"; +option java_package = "com.google.cloud.notebooks.v1"; + +// Defines flags that are used to run the diagnostic tool +message DiagnosticConfig { + // Required. User Cloud Storage bucket location (REQUIRED) + // ## Must be formatted with path prefix (gs://$GCS_BUCKET) + // + // Permissions: + // User Managed Notebooks: + // - storage.buckets.writer: Must be given to the project's service account + // attached to VM. + // Google Managed Notebooks: + // - storage.buckets.writer: Must be given to the project's service account or + // ## user credentials attached to VM depending on authentication mode. + // + // Cloud Storage bucket Log file will be written to + // gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz + string gcs_bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Defines the relative storage path in the Cloud Storage bucket where the + // diagnostic logs will be written: Default path will be the root directory of + // the Cloud Storage bucket (gs://$GCS_BUCKET/$DATE_$TIME.tar.gz) Example of + // full path where Log file will be written: gs://$GCS_BUCKET/$RELATIVE_PATH/ + string relative_path = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables flag to repair service for instance + bool repair_flag_enabled = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables flag to capture packets from the instance for 30 seconds + bool packet_capture_flag_enabled = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables flag to copy all `/home/jupyter` folder contents + bool copy_home_files_flag_enabled = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/managed_service.proto b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/managed_service.proto index 170ae98d2a2e..e61cedb7a1eb 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/managed_service.proto +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/managed_service.proto @@ -20,9 +20,11 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/notebooks/v1/diagnostic_config.proto"; import "google/cloud/notebooks/v1/event.proto"; import "google/cloud/notebooks/v1/runtime.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Notebooks.V1"; @@ -68,6 +70,19 @@ service ManagedNotebookService { }; } + // Update Notebook Runtime configuration. + rpc UpdateRuntime(UpdateRuntimeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{runtime.name=projects/*/locations/*/runtimes/*}" + body: "runtime" + }; + option (google.api.method_signature) = "runtime,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Runtime" + metadata_type: "OperationMetadata" + }; + } + // Deletes a single Runtime. rpc DeleteRuntime(DeleteRuntimeRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -140,6 +155,19 @@ service ManagedNotebookService { }; } + // Upgrades a Managed Notebook Runtime to the latest version. + rpc UpgradeRuntime(UpgradeRuntimeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/runtimes/*}:upgrade" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Runtime" + metadata_type: "OperationMetadata" + }; + } + // Report and process a runtime event. rpc ReportRuntimeEvent(ReportRuntimeEventRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -162,6 +190,19 @@ service ManagedNotebookService { }; option (google.api.method_signature) = "name,vm_id"; } + + // Creates a Diagnostic File and runs Diagnostic Tool given a Runtime. + rpc DiagnoseRuntime(DiagnoseRuntimeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/runtimes/*}:diagnose" + body: "*" + }; + option (google.api.method_signature) = "name,diagnostic_config"; + option (google.longrunning.operation_info) = { + response_type: "Runtime" + metadata_type: "OperationMetadata" + }; + } } // Request for listing Managed Notebook Runtimes. @@ -292,6 +333,18 @@ message ResetRuntimeRequest { string request_id = 2; } +// Request for upgrading a Managed Notebook Runtime to the latest version. +// option (google.api.message_visibility).restriction = +// "TRUSTED_TESTER,SPECIAL_TESTER"; +message UpgradeRuntimeRequest { + // Required. Format: + // `projects/{project_id}/locations/{location}/runtimes/{runtime_id}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Idempotent request UUID. + string request_id = 2; +} + // Request for reporting a Managed Notebook Event. message ReportRuntimeEventRequest { // Required. Format: @@ -311,6 +364,40 @@ message ReportRuntimeEventRequest { Event event = 3 [(google.api.field_behavior) = REQUIRED]; } +// Request for updating a Managed Notebook configuration. +message UpdateRuntimeRequest { + // Required. The Runtime to be updated. + Runtime runtime = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specifies the path, relative to `Runtime`, of + // the field to update. For example, to change the software configuration + // kernels, the `update_mask` parameter would be + // specified as `software_config.kernels`, + // and the `PATCH` request body would specify the new value, as follows: + // + // { + // "software_config":{ + // "kernels": [{ + // 'repository': + // 'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag': + // 'latest' }], + // } + // } + // + // + // Currently, only the following fields can be updated: + // - software_config.kernels + // - software_config.post_startup_script + // - software_config.custom_gpu_driver_path + // - software_config.idle_shutdown + // - software_config.idle_shutdown_timeout + // - software_config.disable_terminal + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // Idempotent request UUID. + string request_id = 3; +} + // Request for getting a new access token. message RefreshRuntimeTokenInternalRequest { // Required. Format: @@ -335,3 +422,18 @@ message RefreshRuntimeTokenInternalResponse { // Output only. Token expiration time. google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Request for creating a notebook instance diagnostic file. +message DiagnoseRuntimeRequest { + // Required. Format: + // `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "notebooks.googleapis.com/Runtime" + } + ]; + + // Required. Defines flags that are used to run the diagnostic tool + DiagnosticConfig diagnostic_config = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/runtime.proto b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/runtime.proto index fa4d3769abba..9dd33fb91a94 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/runtime.proto +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/runtime.proto @@ -144,7 +144,7 @@ message RuntimeAcceleratorConfig { ACCELERATOR_TYPE_UNSPECIFIED = 0; // Accelerator type is Nvidia Tesla K80. - NVIDIA_TESLA_K80 = 1; + NVIDIA_TESLA_K80 = 1 [deprecated = true]; // Accelerator type is Nvidia Tesla P100. NVIDIA_TESLA_P100 = 2; @@ -376,6 +376,18 @@ message RuntimeAccessConfig { // * `idle_shutdown_timeout: 180` // * `enable_health_monitoring: true` message RuntimeSoftwareConfig { + // Behavior for the post startup script. + enum PostStartupScriptBehavior { + // Unspecified post startup script behavior. Will run only once at creation. + POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED = 0; + + // Runs the post startup script provided during creation at every start. + RUN_EVERY_START = 1; + + // Downloads and runs the provided post startup script at every start. + DOWNLOAD_AND_RUN_EVERY_START = 2; + } + // Cron expression in UTC timezone, used to schedule instance auto upgrade. // Please follow the [cron format](https://en.wikipedia.org/wiki/Cron). string notebook_upgrade_schedule = 1; @@ -409,6 +421,16 @@ message RuntimeSoftwareConfig { // Output only. Bool indicating whether an newer image is available in an image family. optional bool upgradeable = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Behavior for the post startup script. + PostStartupScriptBehavior post_startup_script_behavior = 10; + + // Bool indicating whether JupyterLab terminal will be available or not. + // Default: False + optional bool disable_terminal = 11; + + // Output only. version of boot image such as M100, from release label of the image. + optional string version = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Contains runtime daemon metrics, such as OS and kernels and sessions stats. @@ -509,8 +531,8 @@ message VirtualMachineConfig { // // A full URL or partial URI. Examples: // - // * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default` - // * `projects/[project_id]/regions/global/default` + // * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + // * `projects/[project_id]/global/networks/default` // // Runtimes are managed resources inside Google Infrastructure. // Runtimes support the following network configurations: diff --git a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/service.proto b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/service.proto index 61ac76ce051c..b997d5b2ca66 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/service.proto +++ b/java-notebooks/proto-google-cloud-notebooks-v1/src/main/proto/google/cloud/notebooks/v1/service.proto @@ -20,6 +20,7 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/notebooks/v1/diagnostic_config.proto"; import "google/cloud/notebooks/v1/environment.proto"; import "google/cloud/notebooks/v1/execution.proto"; import "google/cloud/notebooks/v1/instance.proto"; @@ -255,6 +256,19 @@ service NotebookService { }; } + // Creates a Diagnostic File and runs Diagnostic Tool given an Instance. + rpc DiagnoseInstance(DiagnoseInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/instances/*}:diagnose" + body: "*" + }; + option (google.api.method_signature) = "name,diagnostic_config"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + // Allows notebook instances to // call this endpoint to upgrade themselves. Do not use this method directly. rpc UpgradeInstanceInternal(UpgradeInstanceInternalRequest) returns (google.longrunning.Operation) { @@ -746,6 +760,21 @@ message ListEnvironmentsRequest { string page_token = 3; } +// Request for creating a notebook instance diagnostic file. +message DiagnoseInstanceRequest { + // Required. Format: + // `projects/{project_id}/locations/{location}/instances/{instance_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "notebooks.googleapis.com/Instance" + } + ]; + + // Required. Defines flags that are used to run the diagnostic tool + DiagnosticConfig diagnostic_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + // Response for listing environments. message ListEnvironmentsResponse { // A list of returned environments. diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/CreateEnvironmentRequest.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/CreateEnvironmentRequest.java index 8017ce206a2e..25401fbda93e 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/CreateEnvironmentRequest.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/CreateEnvironmentRequest.java @@ -123,10 +123,10 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-   * Required. User-defined unique ID of this environment. The `environment_id`
-   * must be 1 to 63 characters long and contain only lowercase letters, numeric
-   * characters, and dashes. The first character must be a lowercase letter and
-   * the last character cannot be a dash.
+   * Required. User-defined unique ID of this environment. The `environment_id` must
+   * be 1 to 63 characters long and contain only lowercase letters,
+   * numeric characters, and dashes. The first character must be a lowercase
+   * letter and the last character cannot be a dash.
    * 
* * string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -149,10 +149,10 @@ public java.lang.String getEnvironmentId() { * * *
-   * Required. User-defined unique ID of this environment. The `environment_id`
-   * must be 1 to 63 characters long and contain only lowercase letters, numeric
-   * characters, and dashes. The first character must be a lowercase letter and
-   * the last character cannot be a dash.
+   * Required. User-defined unique ID of this environment. The `environment_id` must
+   * be 1 to 63 characters long and contain only lowercase letters,
+   * numeric characters, and dashes. The first character must be a lowercase
+   * letter and the last character cannot be a dash.
    * 
* * string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -724,10 +724,10 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. User-defined unique ID of this environment. The `environment_id`
-     * must be 1 to 63 characters long and contain only lowercase letters, numeric
-     * characters, and dashes. The first character must be a lowercase letter and
-     * the last character cannot be a dash.
+     * Required. User-defined unique ID of this environment. The `environment_id` must
+     * be 1 to 63 characters long and contain only lowercase letters,
+     * numeric characters, and dashes. The first character must be a lowercase
+     * letter and the last character cannot be a dash.
      * 
* * string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -749,10 +749,10 @@ public java.lang.String getEnvironmentId() { * * *
-     * Required. User-defined unique ID of this environment. The `environment_id`
-     * must be 1 to 63 characters long and contain only lowercase letters, numeric
-     * characters, and dashes. The first character must be a lowercase letter and
-     * the last character cannot be a dash.
+     * Required. User-defined unique ID of this environment. The `environment_id` must
+     * be 1 to 63 characters long and contain only lowercase letters,
+     * numeric characters, and dashes. The first character must be a lowercase
+     * letter and the last character cannot be a dash.
      * 
* * string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -774,10 +774,10 @@ public com.google.protobuf.ByteString getEnvironmentIdBytes() { * * *
-     * Required. User-defined unique ID of this environment. The `environment_id`
-     * must be 1 to 63 characters long and contain only lowercase letters, numeric
-     * characters, and dashes. The first character must be a lowercase letter and
-     * the last character cannot be a dash.
+     * Required. User-defined unique ID of this environment. The `environment_id` must
+     * be 1 to 63 characters long and contain only lowercase letters,
+     * numeric characters, and dashes. The first character must be a lowercase
+     * letter and the last character cannot be a dash.
      * 
* * string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -798,10 +798,10 @@ public Builder setEnvironmentId(java.lang.String value) { * * *
-     * Required. User-defined unique ID of this environment. The `environment_id`
-     * must be 1 to 63 characters long and contain only lowercase letters, numeric
-     * characters, and dashes. The first character must be a lowercase letter and
-     * the last character cannot be a dash.
+     * Required. User-defined unique ID of this environment. The `environment_id` must
+     * be 1 to 63 characters long and contain only lowercase letters,
+     * numeric characters, and dashes. The first character must be a lowercase
+     * letter and the last character cannot be a dash.
      * 
* * string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -818,10 +818,10 @@ public Builder clearEnvironmentId() { * * *
-     * Required. User-defined unique ID of this environment. The `environment_id`
-     * must be 1 to 63 characters long and contain only lowercase letters, numeric
-     * characters, and dashes. The first character must be a lowercase letter and
-     * the last character cannot be a dash.
+     * Required. User-defined unique ID of this environment. The `environment_id` must
+     * be 1 to 63 characters long and contain only lowercase letters,
+     * numeric characters, and dashes. The first character must be a lowercase
+     * letter and the last character cannot be a dash.
      * 
* * string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/CreateEnvironmentRequestOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/CreateEnvironmentRequestOrBuilder.java index 0c6825bb27d9..4b476a19c814 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/CreateEnvironmentRequestOrBuilder.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/CreateEnvironmentRequestOrBuilder.java @@ -52,10 +52,10 @@ public interface CreateEnvironmentRequestOrBuilder * * *
-   * Required. User-defined unique ID of this environment. The `environment_id`
-   * must be 1 to 63 characters long and contain only lowercase letters, numeric
-   * characters, and dashes. The first character must be a lowercase letter and
-   * the last character cannot be a dash.
+   * Required. User-defined unique ID of this environment. The `environment_id` must
+   * be 1 to 63 characters long and contain only lowercase letters,
+   * numeric characters, and dashes. The first character must be a lowercase
+   * letter and the last character cannot be a dash.
    * 
* * string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -67,10 +67,10 @@ public interface CreateEnvironmentRequestOrBuilder * * *
-   * Required. User-defined unique ID of this environment. The `environment_id`
-   * must be 1 to 63 characters long and contain only lowercase letters, numeric
-   * characters, and dashes. The first character must be a lowercase letter and
-   * the last character cannot be a dash.
+   * Required. User-defined unique ID of this environment. The `environment_id` must
+   * be 1 to 63 characters long and contain only lowercase letters,
+   * numeric characters, and dashes. The first character must be a lowercase
+   * letter and the last character cannot be a dash.
    * 
* * string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/Instance.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/Instance.java index 83d505462932..681b359a4a8f 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/Instance.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/Instance.java @@ -52,6 +52,7 @@ private Instance() { kmsKey_ = ""; network_ = ""; subnet_ = ""; + nicType_ = 0; } @java.lang.Override @@ -148,7 +149,7 @@ public enum AcceleratorType implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Accelerator type is Nvidia Tesla P_4.
+     * Accelerator type is Nvidia Tesla P4.
      * 
* * NVIDIA_TESLA_P4 = 4; @@ -188,7 +189,7 @@ public enum AcceleratorType implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Accelerator type is NVIDIA Tesla P_4 Virtual Workstations.
+     * Accelerator type is NVIDIA Tesla P4 Virtual Workstations.
      * 
* * NVIDIA_TESLA_P4_VWS = 10; @@ -261,7 +262,7 @@ public enum AcceleratorType implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Accelerator type is Nvidia Tesla P_4.
+     * Accelerator type is Nvidia Tesla P4.
      * 
* * NVIDIA_TESLA_P4 = 4; @@ -301,7 +302,7 @@ public enum AcceleratorType implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Accelerator type is NVIDIA Tesla P_4 Virtual Workstations.
+     * Accelerator type is NVIDIA Tesla P4 Virtual Workstations.
      * 
* * NVIDIA_TESLA_P4_VWS = 10; @@ -540,6 +541,26 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * REGISTERING = 9; */ REGISTERING(9), + /** + * + * + *
+     * The instance is suspending.
+     * 
+ * + * SUSPENDING = 10; + */ + SUSPENDING(10), + /** + * + * + *
+     * The instance is suspended.
+     * 
+ * + * SUSPENDED = 11; + */ + SUSPENDED(11), UNRECOGNIZED(-1), ; @@ -644,6 +665,26 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * REGISTERING = 9; */ public static final int REGISTERING_VALUE = 9; + /** + * + * + *
+     * The instance is suspending.
+     * 
+ * + * SUSPENDING = 10; + */ + public static final int SUSPENDING_VALUE = 10; + /** + * + * + *
+     * The instance is suspended.
+     * 
+ * + * SUSPENDED = 11; + */ + public static final int SUSPENDED_VALUE = 11; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -689,6 +730,10 @@ public static State forNumber(int value) { return INITIALIZING; case 9: return REGISTERING; + case 10: + return SUSPENDING; + case 11: + return SUSPENDED; default: return null; } @@ -1078,6 +1123,165 @@ private DiskEncryption(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.notebooks.v1beta1.Instance.DiskEncryption) } + /** + * + * + *
+   * The type of vNIC driver.
+   * 
+ * + * Protobuf enum {@code google.cloud.notebooks.v1beta1.Instance.NicType} + */ + public enum NicType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * No type specified. Default should be UNSPECIFIED_NIC_TYPE.
+     * 
+ * + * UNSPECIFIED_NIC_TYPE = 0; + */ + UNSPECIFIED_NIC_TYPE(0), + /** + * + * + *
+     * VIRTIO. Default in Notebooks DLVM.
+     * 
+ * + * VIRTIO_NET = 1; + */ + VIRTIO_NET(1), + /** + * + * + *
+     * GVNIC. Alternative to VIRTIO.
+     * https://github.com/GoogleCloudPlatform/compute-virtual-ethernet-linux
+     * 
+ * + * GVNIC = 2; + */ + GVNIC(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * No type specified. Default should be UNSPECIFIED_NIC_TYPE.
+     * 
+ * + * UNSPECIFIED_NIC_TYPE = 0; + */ + public static final int UNSPECIFIED_NIC_TYPE_VALUE = 0; + /** + * + * + *
+     * VIRTIO. Default in Notebooks DLVM.
+     * 
+ * + * VIRTIO_NET = 1; + */ + public static final int VIRTIO_NET_VALUE = 1; + /** + * + * + *
+     * GVNIC. Alternative to VIRTIO.
+     * https://github.com/GoogleCloudPlatform/compute-virtual-ethernet-linux
+     * 
+ * + * GVNIC = 2; + */ + public static final int GVNIC_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static NicType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static NicType forNumber(int value) { + switch (value) { + case 0: + return UNSPECIFIED_NIC_TYPE; + case 1: + return VIRTIO_NET; + case 2: + return GVNIC; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public NicType findValueByNumber(int number) { + return NicType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.notebooks.v1beta1.Instance.getDescriptor().getEnumTypes().get(4); + } + + private static final NicType[] VALUES = values(); + + public static NicType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private NicType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.notebooks.v1beta1.Instance.NicType) + } + public interface AcceleratorConfigOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig) @@ -2016,7 +2220,7 @@ public com.google.cloud.notebooks.v1beta1.ContainerImageOrBuilder getContainerIm *
    * Path to a Bash script that automatically runs after a notebook instance
    * fully boots up. The path must be a URL or
-   * Cloud Storage path (`gs://path-to-file/file-name`).
+   * Cloud Storage path (gs://path-to-file/file-name).
    * 
* * string post_startup_script = 4; @@ -2041,7 +2245,7 @@ public java.lang.String getPostStartupScript() { *
    * Path to a Bash script that automatically runs after a notebook instance
    * fully boots up. The path must be a URL or
-   * Cloud Storage path (`gs://path-to-file/file-name`).
+   * Cloud Storage path (gs://path-to-file/file-name).
    * 
* * string post_startup_script = 4; @@ -2067,8 +2271,7 @@ public com.google.protobuf.ByteString getPostStartupScriptBytes() { * * *
-   * Output only. The proxy endpoint that is used to access the Jupyter
-   * notebook.
+   * Output only. The proxy endpoint that is used to access the Jupyter notebook.
    * 
* * string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -2091,8 +2294,7 @@ public java.lang.String getProxyUri() { * * *
-   * Output only. The proxy endpoint that is used to access the Jupyter
-   * notebook.
+   * Output only. The proxy endpoint that is used to access the Jupyter notebook.
    * 
* * string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -2118,8 +2320,7 @@ public com.google.protobuf.ByteString getProxyUriBytes() { * * *
-   * Input only. The owner of this instance after creation. Format:
-   * `alias@example.com`
+   * Input only. The owner of this instance after creation. Format: `alias@example.com`
    * Currently supports one owner only. If not specified, all of the service
    * account users of your VM instance's service account can use
    * the instance.
@@ -2136,8 +2337,7 @@ public com.google.protobuf.ProtocolStringList getInstanceOwnersList() {
    *
    *
    * 
-   * Input only. The owner of this instance after creation. Format:
-   * `alias@example.com`
+   * Input only. The owner of this instance after creation. Format: `alias@example.com`
    * Currently supports one owner only. If not specified, all of the service
    * account users of your VM instance's service account can use
    * the instance.
@@ -2154,8 +2354,7 @@ public int getInstanceOwnersCount() {
    *
    *
    * 
-   * Input only. The owner of this instance after creation. Format:
-   * `alias@example.com`
+   * Input only. The owner of this instance after creation. Format: `alias@example.com`
    * Currently supports one owner only. If not specified, all of the service
    * account users of your VM instance's service account can use
    * the instance.
@@ -2173,8 +2372,7 @@ public java.lang.String getInstanceOwners(int index) {
    *
    *
    * 
-   * Input only. The owner of this instance after creation. Format:
-   * `alias@example.com`
+   * Input only. The owner of this instance after creation. Format: `alias@example.com`
    * Currently supports one owner only. If not specified, all of the service
    * account users of your VM instance's service account can use
    * the instance.
@@ -2256,8 +2454,7 @@ public com.google.protobuf.ByteString getServiceAccountBytes() {
    *
    *
    * 
-   * Required. The [Compute Engine machine
-   * type](https://cloud.google.com/compute/docs/machine-types) of this
+   * Required. The [Compute Engine machine type](/compute/docs/machine-types) of this
    * instance.
    * 
* @@ -2281,8 +2478,7 @@ public java.lang.String getMachineType() { * * *
-   * Required. The [Compute Engine machine
-   * type](https://cloud.google.com/compute/docs/machine-types) of this
+   * Required. The [Compute Engine machine type](/compute/docs/machine-types) of this
    * instance.
    * 
* @@ -2312,7 +2508,7 @@ public com.google.protobuf.ByteString getMachineTypeBytes() { * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -2330,7 +2526,7 @@ public boolean hasAcceleratorConfig() { * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -2350,7 +2546,7 @@ public com.google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig getAccelera * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -2479,8 +2675,8 @@ public com.google.protobuf.ByteString getCustomGpuDriverPathBytes() { * * *
-   * Input only. The type of the boot disk attached to this instance, defaults
-   * to standard persistent disk (`PD_STANDARD`).
+   * Input only. The type of the boot disk attached to this instance, defaults to
+   * standard persistent disk (`PD_STANDARD`).
    * 
* * @@ -2497,8 +2693,8 @@ public int getBootDiskTypeValue() { * * *
-   * Input only. The type of the boot disk attached to this instance, defaults
-   * to standard persistent disk (`PD_STANDARD`).
+   * Input only. The type of the boot disk attached to this instance, defaults to
+   * standard persistent disk (`PD_STANDARD`).
    * 
* * @@ -2523,9 +2719,9 @@ public com.google.cloud.notebooks.v1beta1.Instance.DiskType getBootDiskType() { * * *
-   * Input only. The size of the boot disk in GB attached to this instance, up
-   * to a maximum of 64000&nbsp;GB (64&nbsp;TB). The minimum recommended value
-   * is 100&nbsp;GB. If not specified, this defaults to 100.
+   * Input only. The size of the boot disk in GB attached to this instance, up to a maximum
+   * of 64000&nbsp;GB (64&nbsp;TB). The minimum recommended value is
+   * 100&nbsp;GB. If not specified, this defaults to 100.
    * 
* * int64 boot_disk_size_gb = 14 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -2543,8 +2739,8 @@ public long getBootDiskSizeGb() { * * *
-   * Input only. The type of the data disk attached to this instance, defaults
-   * to standard persistent disk (`PD_STANDARD`).
+   * Input only. The type of the data disk attached to this instance, defaults to
+   * standard persistent disk (`PD_STANDARD`).
    * 
* * @@ -2561,8 +2757,8 @@ public int getDataDiskTypeValue() { * * *
-   * Input only. The type of the data disk attached to this instance, defaults
-   * to standard persistent disk (`PD_STANDARD`).
+   * Input only. The type of the data disk attached to this instance, defaults to
+   * standard persistent disk (`PD_STANDARD`).
    * 
* * @@ -2587,10 +2783,10 @@ public com.google.cloud.notebooks.v1beta1.Instance.DiskType getDataDiskType() { * * *
-   * Input only. The size of the data disk in GB attached to this instance, up
-   * to a maximum of 64000&nbsp;GB (64&nbsp;TB). You can choose the size of the
-   * data disk based on how big your notebooks and data are. If not specified,
-   * this defaults to 100.
+   * Input only. The size of the data disk in GB attached to this instance, up to a maximum
+   * of 64000&nbsp;GB (64&nbsp;TB). You can choose the size of the data disk
+   * based on how big your notebooks and data are. If not specified, this
+   * defaults to 100.
    * 
* * int64 data_disk_size_gb = 26 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -2608,8 +2804,7 @@ public long getDataDiskSizeGb() { * * *
-   * Input only. If true, the data disk will not be auto deleted when deleting
-   * the instance.
+   * Input only. If true, the data disk will not be auto deleted when deleting the instance.
    * 
* * bool no_remove_data_disk = 27 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -2627,8 +2822,7 @@ public boolean getNoRemoveDataDisk() { * * *
-   * Input only. Disk encryption method used on the boot and data disks,
-   * defaults to GMEK.
+   * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
    * 
* * @@ -2645,8 +2839,7 @@ public int getDiskEncryptionValue() { * * *
-   * Input only. Disk encryption method used on the boot and data disks,
-   * defaults to GMEK.
+   * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
    * 
* * @@ -2671,11 +2864,11 @@ public com.google.cloud.notebooks.v1beta1.Instance.DiskEncryption getDiskEncrypt * * *
-   * Input only. The KMS key used to encrypt the disks, only applicable if
-   * disk_encryption is CMEK. Format:
+   * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
+   * is CMEK.
+   * Format:
    * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
-   * Learn more about [using your own encryption keys](
-   * https://cloud.google.com/kms/docs/quickstart).
+   * Learn more about [using your own encryption keys](/kms/docs/quickstart).
    * 
* * string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -2698,11 +2891,11 @@ public java.lang.String getKmsKey() { * * *
-   * Input only. The KMS key used to encrypt the disks, only applicable if
-   * disk_encryption is CMEK. Format:
+   * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
+   * is CMEK.
+   * Format:
    * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
-   * Learn more about [using your own encryption keys](
-   * https://cloud.google.com/kms/docs/quickstart).
+   * Learn more about [using your own encryption keys](/kms/docs/quickstart).
    * 
* * string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -3065,6 +3258,133 @@ public java.lang.String getMetadataOrThrow(java.lang.String key) { return map.get(key); } + public static final int NIC_TYPE_FIELD_NUMBER = 28; + private int nicType_; + /** + * + * + *
+   * Optional. The type of vNIC to be used on this interface. This may be gVNIC or
+   * VirtioNet.
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for nicType. + */ + @java.lang.Override + public int getNicTypeValue() { + return nicType_; + } + /** + * + * + *
+   * Optional. The type of vNIC to be used on this interface. This may be gVNIC or
+   * VirtioNet.
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The nicType. + */ + @java.lang.Override + public com.google.cloud.notebooks.v1beta1.Instance.NicType getNicType() { + @SuppressWarnings("deprecation") + com.google.cloud.notebooks.v1beta1.Instance.NicType result = + com.google.cloud.notebooks.v1beta1.Instance.NicType.valueOf(nicType_); + return result == null + ? com.google.cloud.notebooks.v1beta1.Instance.NicType.UNRECOGNIZED + : result; + } + + public static final int RESERVATION_AFFINITY_FIELD_NUMBER = 29; + private com.google.cloud.notebooks.v1beta1.ReservationAffinity reservationAffinity_; + /** + * + * + *
+   * Optional. The optional reservation affinity. Setting this field will apply
+   * the specified [Zonal Compute
+   * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+   * to this notebook instance.
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reservationAffinity field is set. + */ + @java.lang.Override + public boolean hasReservationAffinity() { + return reservationAffinity_ != null; + } + /** + * + * + *
+   * Optional. The optional reservation affinity. Setting this field will apply
+   * the specified [Zonal Compute
+   * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+   * to this notebook instance.
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reservationAffinity. + */ + @java.lang.Override + public com.google.cloud.notebooks.v1beta1.ReservationAffinity getReservationAffinity() { + return reservationAffinity_ == null + ? com.google.cloud.notebooks.v1beta1.ReservationAffinity.getDefaultInstance() + : reservationAffinity_; + } + /** + * + * + *
+   * Optional. The optional reservation affinity. Setting this field will apply
+   * the specified [Zonal Compute
+   * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+   * to this notebook instance.
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.notebooks.v1beta1.ReservationAffinityOrBuilder + getReservationAffinityOrBuilder() { + return getReservationAffinity(); + } + + public static final int CAN_IP_FORWARD_FIELD_NUMBER = 31; + private boolean canIpForward_; + /** + * + * + *
+   * Optional. Flag to enable ip forwarding or not, default false/off.
+   * https://cloud.google.com/vpc/docs/using-routes#canipforward
+   * 
+ * + * bool can_ip_forward = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The canIpForward. + */ + @java.lang.Override + public boolean getCanIpForward() { + return canIpForward_; + } + public static final int CREATE_TIME_FIELD_NUMBER = 23; private com.google.protobuf.Timestamp createTime_; /** @@ -3260,6 +3580,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (noRemoveDataDisk_ != false) { output.writeBool(27, noRemoveDataDisk_); } + if (nicType_ + != com.google.cloud.notebooks.v1beta1.Instance.NicType.UNSPECIFIED_NIC_TYPE.getNumber()) { + output.writeEnum(28, nicType_); + } + if (reservationAffinity_ != null) { + output.writeMessage(29, getReservationAffinity()); + } + if (canIpForward_ != false) { + output.writeBool(31, canIpForward_); + } getUnknownFields().writeTo(output); } @@ -3377,6 +3707,17 @@ public int getSerializedSize() { if (noRemoveDataDisk_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(27, noRemoveDataDisk_); } + if (nicType_ + != com.google.cloud.notebooks.v1beta1.Instance.NicType.UNSPECIFIED_NIC_TYPE.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(28, nicType_); + } + if (reservationAffinity_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(29, getReservationAffinity()); + } + if (canIpForward_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(31, canIpForward_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -3419,6 +3760,12 @@ public boolean equals(final java.lang.Object obj) { if (!getSubnet().equals(other.getSubnet())) return false; if (!internalGetLabels().equals(other.internalGetLabels())) return false; if (!internalGetMetadata().equals(other.internalGetMetadata())) return false; + if (nicType_ != other.nicType_) return false; + if (hasReservationAffinity() != other.hasReservationAffinity()) return false; + if (hasReservationAffinity()) { + if (!getReservationAffinity().equals(other.getReservationAffinity())) return false; + } + if (getCanIpForward() != other.getCanIpForward()) return false; if (hasCreateTime() != other.hasCreateTime()) return false; if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; @@ -3503,6 +3850,14 @@ public int hashCode() { hash = (37 * hash) + METADATA_FIELD_NUMBER; hash = (53 * hash) + internalGetMetadata().hashCode(); } + hash = (37 * hash) + NIC_TYPE_FIELD_NUMBER; + hash = (53 * hash) + nicType_; + if (hasReservationAffinity()) { + hash = (37 * hash) + RESERVATION_AFFINITY_FIELD_NUMBER; + hash = (53 * hash) + getReservationAffinity().hashCode(); + } + hash = (37 * hash) + CAN_IP_FORWARD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCanIpForward()); if (hasCreateTime()) { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); @@ -3739,6 +4094,16 @@ public Builder clear() { internalGetMutableLabels().clear(); internalGetMutableMetadata().clear(); + nicType_ = 0; + + if (reservationAffinityBuilder_ == null) { + reservationAffinity_ = null; + } else { + reservationAffinity_ = null; + reservationAffinityBuilder_ = null; + } + canIpForward_ = false; + if (createTimeBuilder_ == null) { createTime_ = null; } else { @@ -3828,6 +4193,13 @@ public com.google.cloud.notebooks.v1beta1.Instance buildPartial() { result.labels_.makeImmutable(); result.metadata_ = internalGetMetadata(); result.metadata_.makeImmutable(); + result.nicType_ = nicType_; + if (reservationAffinityBuilder_ == null) { + result.reservationAffinity_ = reservationAffinity_; + } else { + result.reservationAffinity_ = reservationAffinityBuilder_.build(); + } + result.canIpForward_ = canIpForward_; if (createTimeBuilder_ == null) { result.createTime_ = createTime_; } else { @@ -3969,6 +4341,15 @@ public Builder mergeFrom(com.google.cloud.notebooks.v1beta1.Instance other) { } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); + if (other.nicType_ != 0) { + setNicTypeValue(other.getNicTypeValue()); + } + if (other.hasReservationAffinity()) { + mergeReservationAffinity(other.getReservationAffinity()); + } + if (other.getCanIpForward() != false) { + setCanIpForward(other.getCanIpForward()); + } if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } @@ -4191,6 +4572,25 @@ public Builder mergeFrom( break; } // case 216 + case 224: + { + nicType_ = input.readEnum(); + + break; + } // case 224 + case 234: + { + input.readMessage( + getReservationAffinityFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 234 + case 248: + { + canIpForward_ = input.readBool(); + + break; + } // case 248 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -4762,7 +5162,7 @@ public com.google.cloud.notebooks.v1beta1.ContainerImageOrBuilder getContainerIm *
      * Path to a Bash script that automatically runs after a notebook instance
      * fully boots up. The path must be a URL or
-     * Cloud Storage path (`gs://path-to-file/file-name`).
+     * Cloud Storage path (gs://path-to-file/file-name).
      * 
* * string post_startup_script = 4; @@ -4786,7 +5186,7 @@ public java.lang.String getPostStartupScript() { *
      * Path to a Bash script that automatically runs after a notebook instance
      * fully boots up. The path must be a URL or
-     * Cloud Storage path (`gs://path-to-file/file-name`).
+     * Cloud Storage path (gs://path-to-file/file-name).
      * 
* * string post_startup_script = 4; @@ -4810,7 +5210,7 @@ public com.google.protobuf.ByteString getPostStartupScriptBytes() { *
      * Path to a Bash script that automatically runs after a notebook instance
      * fully boots up. The path must be a URL or
-     * Cloud Storage path (`gs://path-to-file/file-name`).
+     * Cloud Storage path (gs://path-to-file/file-name).
      * 
* * string post_startup_script = 4; @@ -4833,7 +5233,7 @@ public Builder setPostStartupScript(java.lang.String value) { *
      * Path to a Bash script that automatically runs after a notebook instance
      * fully boots up. The path must be a URL or
-     * Cloud Storage path (`gs://path-to-file/file-name`).
+     * Cloud Storage path (gs://path-to-file/file-name).
      * 
* * string post_startup_script = 4; @@ -4852,7 +5252,7 @@ public Builder clearPostStartupScript() { *
      * Path to a Bash script that automatically runs after a notebook instance
      * fully boots up. The path must be a URL or
-     * Cloud Storage path (`gs://path-to-file/file-name`).
+     * Cloud Storage path (gs://path-to-file/file-name).
      * 
* * string post_startup_script = 4; @@ -4876,8 +5276,7 @@ public Builder setPostStartupScriptBytes(com.google.protobuf.ByteString value) { * * *
-     * Output only. The proxy endpoint that is used to access the Jupyter
-     * notebook.
+     * Output only. The proxy endpoint that is used to access the Jupyter notebook.
      * 
* * string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -4899,8 +5298,7 @@ public java.lang.String getProxyUri() { * * *
-     * Output only. The proxy endpoint that is used to access the Jupyter
-     * notebook.
+     * Output only. The proxy endpoint that is used to access the Jupyter notebook.
      * 
* * string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -4922,8 +5320,7 @@ public com.google.protobuf.ByteString getProxyUriBytes() { * * *
-     * Output only. The proxy endpoint that is used to access the Jupyter
-     * notebook.
+     * Output only. The proxy endpoint that is used to access the Jupyter notebook.
      * 
* * string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -4944,8 +5341,7 @@ public Builder setProxyUri(java.lang.String value) { * * *
-     * Output only. The proxy endpoint that is used to access the Jupyter
-     * notebook.
+     * Output only. The proxy endpoint that is used to access the Jupyter notebook.
      * 
* * string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -4962,8 +5358,7 @@ public Builder clearProxyUri() { * * *
-     * Output only. The proxy endpoint that is used to access the Jupyter
-     * notebook.
+     * Output only. The proxy endpoint that is used to access the Jupyter notebook.
      * 
* * string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -4995,8 +5390,7 @@ private void ensureInstanceOwnersIsMutable() { * * *
-     * Input only. The owner of this instance after creation. Format:
-     * `alias@example.com`
+     * Input only. The owner of this instance after creation. Format: `alias@example.com`
      * Currently supports one owner only. If not specified, all of the service
      * account users of your VM instance's service account can use
      * the instance.
@@ -5013,8 +5407,7 @@ public com.google.protobuf.ProtocolStringList getInstanceOwnersList() {
      *
      *
      * 
-     * Input only. The owner of this instance after creation. Format:
-     * `alias@example.com`
+     * Input only. The owner of this instance after creation. Format: `alias@example.com`
      * Currently supports one owner only. If not specified, all of the service
      * account users of your VM instance's service account can use
      * the instance.
@@ -5031,8 +5424,7 @@ public int getInstanceOwnersCount() {
      *
      *
      * 
-     * Input only. The owner of this instance after creation. Format:
-     * `alias@example.com`
+     * Input only. The owner of this instance after creation. Format: `alias@example.com`
      * Currently supports one owner only. If not specified, all of the service
      * account users of your VM instance's service account can use
      * the instance.
@@ -5050,8 +5442,7 @@ public java.lang.String getInstanceOwners(int index) {
      *
      *
      * 
-     * Input only. The owner of this instance after creation. Format:
-     * `alias@example.com`
+     * Input only. The owner of this instance after creation. Format: `alias@example.com`
      * Currently supports one owner only. If not specified, all of the service
      * account users of your VM instance's service account can use
      * the instance.
@@ -5069,8 +5460,7 @@ public com.google.protobuf.ByteString getInstanceOwnersBytes(int index) {
      *
      *
      * 
-     * Input only. The owner of this instance after creation. Format:
-     * `alias@example.com`
+     * Input only. The owner of this instance after creation. Format: `alias@example.com`
      * Currently supports one owner only. If not specified, all of the service
      * account users of your VM instance's service account can use
      * the instance.
@@ -5095,8 +5485,7 @@ public Builder setInstanceOwners(int index, java.lang.String value) {
      *
      *
      * 
-     * Input only. The owner of this instance after creation. Format:
-     * `alias@example.com`
+     * Input only. The owner of this instance after creation. Format: `alias@example.com`
      * Currently supports one owner only. If not specified, all of the service
      * account users of your VM instance's service account can use
      * the instance.
@@ -5120,8 +5509,7 @@ public Builder addInstanceOwners(java.lang.String value) {
      *
      *
      * 
-     * Input only. The owner of this instance after creation. Format:
-     * `alias@example.com`
+     * Input only. The owner of this instance after creation. Format: `alias@example.com`
      * Currently supports one owner only. If not specified, all of the service
      * account users of your VM instance's service account can use
      * the instance.
@@ -5142,8 +5530,7 @@ public Builder addAllInstanceOwners(java.lang.Iterable values)
      *
      *
      * 
-     * Input only. The owner of this instance after creation. Format:
-     * `alias@example.com`
+     * Input only. The owner of this instance after creation. Format: `alias@example.com`
      * Currently supports one owner only. If not specified, all of the service
      * account users of your VM instance's service account can use
      * the instance.
@@ -5163,8 +5550,7 @@ public Builder clearInstanceOwners() {
      *
      *
      * 
-     * Input only. The owner of this instance after creation. Format:
-     * `alias@example.com`
+     * Input only. The owner of this instance after creation. Format: `alias@example.com`
      * Currently supports one owner only. If not specified, all of the service
      * account users of your VM instance's service account can use
      * the instance.
@@ -5327,8 +5713,7 @@ public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) {
      *
      *
      * 
-     * Required. The [Compute Engine machine
-     * type](https://cloud.google.com/compute/docs/machine-types) of this
+     * Required. The [Compute Engine machine type](/compute/docs/machine-types) of this
      * instance.
      * 
* @@ -5351,8 +5736,7 @@ public java.lang.String getMachineType() { * * *
-     * Required. The [Compute Engine machine
-     * type](https://cloud.google.com/compute/docs/machine-types) of this
+     * Required. The [Compute Engine machine type](/compute/docs/machine-types) of this
      * instance.
      * 
* @@ -5375,8 +5759,7 @@ public com.google.protobuf.ByteString getMachineTypeBytes() { * * *
-     * Required. The [Compute Engine machine
-     * type](https://cloud.google.com/compute/docs/machine-types) of this
+     * Required. The [Compute Engine machine type](/compute/docs/machine-types) of this
      * instance.
      * 
* @@ -5398,8 +5781,7 @@ public Builder setMachineType(java.lang.String value) { * * *
-     * Required. The [Compute Engine machine
-     * type](https://cloud.google.com/compute/docs/machine-types) of this
+     * Required. The [Compute Engine machine type](/compute/docs/machine-types) of this
      * instance.
      * 
* @@ -5417,8 +5799,7 @@ public Builder clearMachineType() { * * *
-     * Required. The [Compute Engine machine
-     * type](https://cloud.google.com/compute/docs/machine-types) of this
+     * Required. The [Compute Engine machine type](/compute/docs/machine-types) of this
      * instance.
      * 
* @@ -5451,7 +5832,7 @@ public Builder setMachineTypeBytes(com.google.protobuf.ByteString value) { * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -5469,7 +5850,7 @@ public boolean hasAcceleratorConfig() { * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -5493,7 +5874,7 @@ public com.google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig getAccelera * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -5520,7 +5901,7 @@ public Builder setAcceleratorConfig( * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -5544,7 +5925,7 @@ public Builder setAcceleratorConfig( * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -5576,7 +5957,7 @@ public Builder mergeAcceleratorConfig( * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -5600,7 +5981,7 @@ public Builder clearAcceleratorConfig() { * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -5619,7 +6000,7 @@ public Builder clearAcceleratorConfig() { * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -5642,7 +6023,7 @@ public Builder clearAcceleratorConfig() { * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -5945,8 +6326,8 @@ public Builder setCustomGpuDriverPathBytes(com.google.protobuf.ByteString value) * * *
-     * Input only. The type of the boot disk attached to this instance, defaults
-     * to standard persistent disk (`PD_STANDARD`).
+     * Input only. The type of the boot disk attached to this instance, defaults to
+     * standard persistent disk (`PD_STANDARD`).
      * 
* * @@ -5963,8 +6344,8 @@ public int getBootDiskTypeValue() { * * *
-     * Input only. The type of the boot disk attached to this instance, defaults
-     * to standard persistent disk (`PD_STANDARD`).
+     * Input only. The type of the boot disk attached to this instance, defaults to
+     * standard persistent disk (`PD_STANDARD`).
      * 
* * @@ -5984,8 +6365,8 @@ public Builder setBootDiskTypeValue(int value) { * * *
-     * Input only. The type of the boot disk attached to this instance, defaults
-     * to standard persistent disk (`PD_STANDARD`).
+     * Input only. The type of the boot disk attached to this instance, defaults to
+     * standard persistent disk (`PD_STANDARD`).
      * 
* * @@ -6007,8 +6388,8 @@ public com.google.cloud.notebooks.v1beta1.Instance.DiskType getBootDiskType() { * * *
-     * Input only. The type of the boot disk attached to this instance, defaults
-     * to standard persistent disk (`PD_STANDARD`).
+     * Input only. The type of the boot disk attached to this instance, defaults to
+     * standard persistent disk (`PD_STANDARD`).
      * 
* * @@ -6031,8 +6412,8 @@ public Builder setBootDiskType(com.google.cloud.notebooks.v1beta1.Instance.DiskT * * *
-     * Input only. The type of the boot disk attached to this instance, defaults
-     * to standard persistent disk (`PD_STANDARD`).
+     * Input only. The type of the boot disk attached to this instance, defaults to
+     * standard persistent disk (`PD_STANDARD`).
      * 
* * @@ -6053,9 +6434,9 @@ public Builder clearBootDiskType() { * * *
-     * Input only. The size of the boot disk in GB attached to this instance, up
-     * to a maximum of 64000&nbsp;GB (64&nbsp;TB). The minimum recommended value
-     * is 100&nbsp;GB. If not specified, this defaults to 100.
+     * Input only. The size of the boot disk in GB attached to this instance, up to a maximum
+     * of 64000&nbsp;GB (64&nbsp;TB). The minimum recommended value is
+     * 100&nbsp;GB. If not specified, this defaults to 100.
      * 
* * int64 boot_disk_size_gb = 14 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6070,9 +6451,9 @@ public long getBootDiskSizeGb() { * * *
-     * Input only. The size of the boot disk in GB attached to this instance, up
-     * to a maximum of 64000&nbsp;GB (64&nbsp;TB). The minimum recommended value
-     * is 100&nbsp;GB. If not specified, this defaults to 100.
+     * Input only. The size of the boot disk in GB attached to this instance, up to a maximum
+     * of 64000&nbsp;GB (64&nbsp;TB). The minimum recommended value is
+     * 100&nbsp;GB. If not specified, this defaults to 100.
      * 
* * int64 boot_disk_size_gb = 14 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6090,9 +6471,9 @@ public Builder setBootDiskSizeGb(long value) { * * *
-     * Input only. The size of the boot disk in GB attached to this instance, up
-     * to a maximum of 64000&nbsp;GB (64&nbsp;TB). The minimum recommended value
-     * is 100&nbsp;GB. If not specified, this defaults to 100.
+     * Input only. The size of the boot disk in GB attached to this instance, up to a maximum
+     * of 64000&nbsp;GB (64&nbsp;TB). The minimum recommended value is
+     * 100&nbsp;GB. If not specified, this defaults to 100.
      * 
* * int64 boot_disk_size_gb = 14 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6111,8 +6492,8 @@ public Builder clearBootDiskSizeGb() { * * *
-     * Input only. The type of the data disk attached to this instance, defaults
-     * to standard persistent disk (`PD_STANDARD`).
+     * Input only. The type of the data disk attached to this instance, defaults to
+     * standard persistent disk (`PD_STANDARD`).
      * 
* * @@ -6129,8 +6510,8 @@ public int getDataDiskTypeValue() { * * *
-     * Input only. The type of the data disk attached to this instance, defaults
-     * to standard persistent disk (`PD_STANDARD`).
+     * Input only. The type of the data disk attached to this instance, defaults to
+     * standard persistent disk (`PD_STANDARD`).
      * 
* * @@ -6150,8 +6531,8 @@ public Builder setDataDiskTypeValue(int value) { * * *
-     * Input only. The type of the data disk attached to this instance, defaults
-     * to standard persistent disk (`PD_STANDARD`).
+     * Input only. The type of the data disk attached to this instance, defaults to
+     * standard persistent disk (`PD_STANDARD`).
      * 
* * @@ -6173,8 +6554,8 @@ public com.google.cloud.notebooks.v1beta1.Instance.DiskType getDataDiskType() { * * *
-     * Input only. The type of the data disk attached to this instance, defaults
-     * to standard persistent disk (`PD_STANDARD`).
+     * Input only. The type of the data disk attached to this instance, defaults to
+     * standard persistent disk (`PD_STANDARD`).
      * 
* * @@ -6197,8 +6578,8 @@ public Builder setDataDiskType(com.google.cloud.notebooks.v1beta1.Instance.DiskT * * *
-     * Input only. The type of the data disk attached to this instance, defaults
-     * to standard persistent disk (`PD_STANDARD`).
+     * Input only. The type of the data disk attached to this instance, defaults to
+     * standard persistent disk (`PD_STANDARD`).
      * 
* * @@ -6219,10 +6600,10 @@ public Builder clearDataDiskType() { * * *
-     * Input only. The size of the data disk in GB attached to this instance, up
-     * to a maximum of 64000&nbsp;GB (64&nbsp;TB). You can choose the size of the
-     * data disk based on how big your notebooks and data are. If not specified,
-     * this defaults to 100.
+     * Input only. The size of the data disk in GB attached to this instance, up to a maximum
+     * of 64000&nbsp;GB (64&nbsp;TB). You can choose the size of the data disk
+     * based on how big your notebooks and data are. If not specified, this
+     * defaults to 100.
      * 
* * int64 data_disk_size_gb = 26 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6237,10 +6618,10 @@ public long getDataDiskSizeGb() { * * *
-     * Input only. The size of the data disk in GB attached to this instance, up
-     * to a maximum of 64000&nbsp;GB (64&nbsp;TB). You can choose the size of the
-     * data disk based on how big your notebooks and data are. If not specified,
-     * this defaults to 100.
+     * Input only. The size of the data disk in GB attached to this instance, up to a maximum
+     * of 64000&nbsp;GB (64&nbsp;TB). You can choose the size of the data disk
+     * based on how big your notebooks and data are. If not specified, this
+     * defaults to 100.
      * 
* * int64 data_disk_size_gb = 26 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6258,10 +6639,10 @@ public Builder setDataDiskSizeGb(long value) { * * *
-     * Input only. The size of the data disk in GB attached to this instance, up
-     * to a maximum of 64000&nbsp;GB (64&nbsp;TB). You can choose the size of the
-     * data disk based on how big your notebooks and data are. If not specified,
-     * this defaults to 100.
+     * Input only. The size of the data disk in GB attached to this instance, up to a maximum
+     * of 64000&nbsp;GB (64&nbsp;TB). You can choose the size of the data disk
+     * based on how big your notebooks and data are. If not specified, this
+     * defaults to 100.
      * 
* * int64 data_disk_size_gb = 26 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6280,8 +6661,7 @@ public Builder clearDataDiskSizeGb() { * * *
-     * Input only. If true, the data disk will not be auto deleted when deleting
-     * the instance.
+     * Input only. If true, the data disk will not be auto deleted when deleting the instance.
      * 
* * bool no_remove_data_disk = 27 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6296,8 +6676,7 @@ public boolean getNoRemoveDataDisk() { * * *
-     * Input only. If true, the data disk will not be auto deleted when deleting
-     * the instance.
+     * Input only. If true, the data disk will not be auto deleted when deleting the instance.
      * 
* * bool no_remove_data_disk = 27 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6315,8 +6694,7 @@ public Builder setNoRemoveDataDisk(boolean value) { * * *
-     * Input only. If true, the data disk will not be auto deleted when deleting
-     * the instance.
+     * Input only. If true, the data disk will not be auto deleted when deleting the instance.
      * 
* * bool no_remove_data_disk = 27 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6335,8 +6713,7 @@ public Builder clearNoRemoveDataDisk() { * * *
-     * Input only. Disk encryption method used on the boot and data disks,
-     * defaults to GMEK.
+     * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
      * 
* * @@ -6353,8 +6730,7 @@ public int getDiskEncryptionValue() { * * *
-     * Input only. Disk encryption method used on the boot and data disks,
-     * defaults to GMEK.
+     * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
      * 
* * @@ -6374,8 +6750,7 @@ public Builder setDiskEncryptionValue(int value) { * * *
-     * Input only. Disk encryption method used on the boot and data disks,
-     * defaults to GMEK.
+     * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
      * 
* * @@ -6397,8 +6772,7 @@ public com.google.cloud.notebooks.v1beta1.Instance.DiskEncryption getDiskEncrypt * * *
-     * Input only. Disk encryption method used on the boot and data disks,
-     * defaults to GMEK.
+     * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
      * 
* * @@ -6422,8 +6796,7 @@ public Builder setDiskEncryption( * * *
-     * Input only. Disk encryption method used on the boot and data disks,
-     * defaults to GMEK.
+     * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
      * 
* * @@ -6444,11 +6817,11 @@ public Builder clearDiskEncryption() { * * *
-     * Input only. The KMS key used to encrypt the disks, only applicable if
-     * disk_encryption is CMEK. Format:
+     * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
+     * is CMEK.
+     * Format:
      * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
-     * Learn more about [using your own encryption keys](
-     * https://cloud.google.com/kms/docs/quickstart).
+     * Learn more about [using your own encryption keys](/kms/docs/quickstart).
      * 
* * string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6470,11 +6843,11 @@ public java.lang.String getKmsKey() { * * *
-     * Input only. The KMS key used to encrypt the disks, only applicable if
-     * disk_encryption is CMEK. Format:
+     * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
+     * is CMEK.
+     * Format:
      * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
-     * Learn more about [using your own encryption keys](
-     * https://cloud.google.com/kms/docs/quickstart).
+     * Learn more about [using your own encryption keys](/kms/docs/quickstart).
      * 
* * string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6496,11 +6869,11 @@ public com.google.protobuf.ByteString getKmsKeyBytes() { * * *
-     * Input only. The KMS key used to encrypt the disks, only applicable if
-     * disk_encryption is CMEK. Format:
+     * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
+     * is CMEK.
+     * Format:
      * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
-     * Learn more about [using your own encryption keys](
-     * https://cloud.google.com/kms/docs/quickstart).
+     * Learn more about [using your own encryption keys](/kms/docs/quickstart).
      * 
* * string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6521,11 +6894,11 @@ public Builder setKmsKey(java.lang.String value) { * * *
-     * Input only. The KMS key used to encrypt the disks, only applicable if
-     * disk_encryption is CMEK. Format:
+     * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
+     * is CMEK.
+     * Format:
      * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
-     * Learn more about [using your own encryption keys](
-     * https://cloud.google.com/kms/docs/quickstart).
+     * Learn more about [using your own encryption keys](/kms/docs/quickstart).
      * 
* * string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -6542,11 +6915,11 @@ public Builder clearKmsKey() { * * *
-     * Input only. The KMS key used to encrypt the disks, only applicable if
-     * disk_encryption is CMEK. Format:
+     * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
+     * is CMEK.
+     * Format:
      * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
-     * Learn more about [using your own encryption keys](
-     * https://cloud.google.com/kms/docs/quickstart).
+     * Learn more about [using your own encryption keys](/kms/docs/quickstart).
      * 
* * string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -7225,6 +7598,405 @@ public Builder putAllMetadata(java.util.Map return this; } + private int nicType_ = 0; + /** + * + * + *
+     * Optional. The type of vNIC to be used on this interface. This may be gVNIC or
+     * VirtioNet.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for nicType. + */ + @java.lang.Override + public int getNicTypeValue() { + return nicType_; + } + /** + * + * + *
+     * Optional. The type of vNIC to be used on this interface. This may be gVNIC or
+     * VirtioNet.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for nicType to set. + * @return This builder for chaining. + */ + public Builder setNicTypeValue(int value) { + + nicType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The type of vNIC to be used on this interface. This may be gVNIC or
+     * VirtioNet.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The nicType. + */ + @java.lang.Override + public com.google.cloud.notebooks.v1beta1.Instance.NicType getNicType() { + @SuppressWarnings("deprecation") + com.google.cloud.notebooks.v1beta1.Instance.NicType result = + com.google.cloud.notebooks.v1beta1.Instance.NicType.valueOf(nicType_); + return result == null + ? com.google.cloud.notebooks.v1beta1.Instance.NicType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. The type of vNIC to be used on this interface. This may be gVNIC or
+     * VirtioNet.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The nicType to set. + * @return This builder for chaining. + */ + public Builder setNicType(com.google.cloud.notebooks.v1beta1.Instance.NicType value) { + if (value == null) { + throw new NullPointerException(); + } + + nicType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The type of vNIC to be used on this interface. This may be gVNIC or
+     * VirtioNet.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearNicType() { + + nicType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.notebooks.v1beta1.ReservationAffinity reservationAffinity_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1beta1.ReservationAffinity, + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Builder, + com.google.cloud.notebooks.v1beta1.ReservationAffinityOrBuilder> + reservationAffinityBuilder_; + /** + * + * + *
+     * Optional. The optional reservation affinity. Setting this field will apply
+     * the specified [Zonal Compute
+     * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+     * to this notebook instance.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reservationAffinity field is set. + */ + public boolean hasReservationAffinity() { + return reservationAffinityBuilder_ != null || reservationAffinity_ != null; + } + /** + * + * + *
+     * Optional. The optional reservation affinity. Setting this field will apply
+     * the specified [Zonal Compute
+     * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+     * to this notebook instance.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reservationAffinity. + */ + public com.google.cloud.notebooks.v1beta1.ReservationAffinity getReservationAffinity() { + if (reservationAffinityBuilder_ == null) { + return reservationAffinity_ == null + ? com.google.cloud.notebooks.v1beta1.ReservationAffinity.getDefaultInstance() + : reservationAffinity_; + } else { + return reservationAffinityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The optional reservation affinity. Setting this field will apply
+     * the specified [Zonal Compute
+     * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+     * to this notebook instance.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReservationAffinity( + com.google.cloud.notebooks.v1beta1.ReservationAffinity value) { + if (reservationAffinityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reservationAffinity_ = value; + onChanged(); + } else { + reservationAffinityBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The optional reservation affinity. Setting this field will apply
+     * the specified [Zonal Compute
+     * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+     * to this notebook instance.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReservationAffinity( + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Builder builderForValue) { + if (reservationAffinityBuilder_ == null) { + reservationAffinity_ = builderForValue.build(); + onChanged(); + } else { + reservationAffinityBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. The optional reservation affinity. Setting this field will apply
+     * the specified [Zonal Compute
+     * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+     * to this notebook instance.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReservationAffinity( + com.google.cloud.notebooks.v1beta1.ReservationAffinity value) { + if (reservationAffinityBuilder_ == null) { + if (reservationAffinity_ != null) { + reservationAffinity_ = + com.google.cloud.notebooks.v1beta1.ReservationAffinity.newBuilder( + reservationAffinity_) + .mergeFrom(value) + .buildPartial(); + } else { + reservationAffinity_ = value; + } + onChanged(); + } else { + reservationAffinityBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The optional reservation affinity. Setting this field will apply
+     * the specified [Zonal Compute
+     * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+     * to this notebook instance.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReservationAffinity() { + if (reservationAffinityBuilder_ == null) { + reservationAffinity_ = null; + onChanged(); + } else { + reservationAffinity_ = null; + reservationAffinityBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. The optional reservation affinity. Setting this field will apply
+     * the specified [Zonal Compute
+     * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+     * to this notebook instance.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.notebooks.v1beta1.ReservationAffinity.Builder + getReservationAffinityBuilder() { + + onChanged(); + return getReservationAffinityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The optional reservation affinity. Setting this field will apply
+     * the specified [Zonal Compute
+     * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+     * to this notebook instance.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.notebooks.v1beta1.ReservationAffinityOrBuilder + getReservationAffinityOrBuilder() { + if (reservationAffinityBuilder_ != null) { + return reservationAffinityBuilder_.getMessageOrBuilder(); + } else { + return reservationAffinity_ == null + ? com.google.cloud.notebooks.v1beta1.ReservationAffinity.getDefaultInstance() + : reservationAffinity_; + } + } + /** + * + * + *
+     * Optional. The optional reservation affinity. Setting this field will apply
+     * the specified [Zonal Compute
+     * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+     * to this notebook instance.
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1beta1.ReservationAffinity, + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Builder, + com.google.cloud.notebooks.v1beta1.ReservationAffinityOrBuilder> + getReservationAffinityFieldBuilder() { + if (reservationAffinityBuilder_ == null) { + reservationAffinityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.notebooks.v1beta1.ReservationAffinity, + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Builder, + com.google.cloud.notebooks.v1beta1.ReservationAffinityOrBuilder>( + getReservationAffinity(), getParentForChildren(), isClean()); + reservationAffinity_ = null; + } + return reservationAffinityBuilder_; + } + + private boolean canIpForward_; + /** + * + * + *
+     * Optional. Flag to enable ip forwarding or not, default false/off.
+     * https://cloud.google.com/vpc/docs/using-routes#canipforward
+     * 
+ * + * bool can_ip_forward = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The canIpForward. + */ + @java.lang.Override + public boolean getCanIpForward() { + return canIpForward_; + } + /** + * + * + *
+     * Optional. Flag to enable ip forwarding or not, default false/off.
+     * https://cloud.google.com/vpc/docs/using-routes#canipforward
+     * 
+ * + * bool can_ip_forward = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The canIpForward to set. + * @return This builder for chaining. + */ + public Builder setCanIpForward(boolean value) { + + canIpForward_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Flag to enable ip forwarding or not, default false/off.
+     * https://cloud.google.com/vpc/docs/using-routes#canipforward
+     * 
+ * + * bool can_ip_forward = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCanIpForward() { + + canIpForward_ = false; + onChanged(); + return this; + } + private com.google.protobuf.Timestamp createTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/InstanceOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/InstanceOrBuilder.java index a330e71c33cd..bb9e610d342d 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/InstanceOrBuilder.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/InstanceOrBuilder.java @@ -126,7 +126,7 @@ public interface InstanceOrBuilder *
    * Path to a Bash script that automatically runs after a notebook instance
    * fully boots up. The path must be a URL or
-   * Cloud Storage path (`gs://path-to-file/file-name`).
+   * Cloud Storage path (gs://path-to-file/file-name).
    * 
* * string post_startup_script = 4; @@ -140,7 +140,7 @@ public interface InstanceOrBuilder *
    * Path to a Bash script that automatically runs after a notebook instance
    * fully boots up. The path must be a URL or
-   * Cloud Storage path (`gs://path-to-file/file-name`).
+   * Cloud Storage path (gs://path-to-file/file-name).
    * 
* * string post_startup_script = 4; @@ -153,8 +153,7 @@ public interface InstanceOrBuilder * * *
-   * Output only. The proxy endpoint that is used to access the Jupyter
-   * notebook.
+   * Output only. The proxy endpoint that is used to access the Jupyter notebook.
    * 
* * string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -166,8 +165,7 @@ public interface InstanceOrBuilder * * *
-   * Output only. The proxy endpoint that is used to access the Jupyter
-   * notebook.
+   * Output only. The proxy endpoint that is used to access the Jupyter notebook.
    * 
* * string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -180,8 +178,7 @@ public interface InstanceOrBuilder * * *
-   * Input only. The owner of this instance after creation. Format:
-   * `alias@example.com`
+   * Input only. The owner of this instance after creation. Format: `alias@example.com`
    * Currently supports one owner only. If not specified, all of the service
    * account users of your VM instance's service account can use
    * the instance.
@@ -196,8 +193,7 @@ public interface InstanceOrBuilder
    *
    *
    * 
-   * Input only. The owner of this instance after creation. Format:
-   * `alias@example.com`
+   * Input only. The owner of this instance after creation. Format: `alias@example.com`
    * Currently supports one owner only. If not specified, all of the service
    * account users of your VM instance's service account can use
    * the instance.
@@ -212,8 +208,7 @@ public interface InstanceOrBuilder
    *
    *
    * 
-   * Input only. The owner of this instance after creation. Format:
-   * `alias@example.com`
+   * Input only. The owner of this instance after creation. Format: `alias@example.com`
    * Currently supports one owner only. If not specified, all of the service
    * account users of your VM instance's service account can use
    * the instance.
@@ -229,8 +224,7 @@ public interface InstanceOrBuilder
    *
    *
    * 
-   * Input only. The owner of this instance after creation. Format:
-   * `alias@example.com`
+   * Input only. The owner of this instance after creation. Format: `alias@example.com`
    * Currently supports one owner only. If not specified, all of the service
    * account users of your VM instance's service account can use
    * the instance.
@@ -284,8 +278,7 @@ public interface InstanceOrBuilder
    *
    *
    * 
-   * Required. The [Compute Engine machine
-   * type](https://cloud.google.com/compute/docs/machine-types) of this
+   * Required. The [Compute Engine machine type](/compute/docs/machine-types) of this
    * instance.
    * 
* @@ -298,8 +291,7 @@ public interface InstanceOrBuilder * * *
-   * Required. The [Compute Engine machine
-   * type](https://cloud.google.com/compute/docs/machine-types) of this
+   * Required. The [Compute Engine machine type](/compute/docs/machine-types) of this
    * instance.
    * 
* @@ -316,7 +308,7 @@ public interface InstanceOrBuilder * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -331,7 +323,7 @@ public interface InstanceOrBuilder * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -346,7 +338,7 @@ public interface InstanceOrBuilder * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has * [enough vCPUs and memory to support the `machine_type` you - * have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + * have selected](/compute/docs/gpus/#gpus-list). *
* * .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; @@ -430,8 +422,8 @@ public interface InstanceOrBuilder * * *
-   * Input only. The type of the boot disk attached to this instance, defaults
-   * to standard persistent disk (`PD_STANDARD`).
+   * Input only. The type of the boot disk attached to this instance, defaults to
+   * standard persistent disk (`PD_STANDARD`).
    * 
* * @@ -445,8 +437,8 @@ public interface InstanceOrBuilder * * *
-   * Input only. The type of the boot disk attached to this instance, defaults
-   * to standard persistent disk (`PD_STANDARD`).
+   * Input only. The type of the boot disk attached to this instance, defaults to
+   * standard persistent disk (`PD_STANDARD`).
    * 
* * @@ -461,9 +453,9 @@ public interface InstanceOrBuilder * * *
-   * Input only. The size of the boot disk in GB attached to this instance, up
-   * to a maximum of 64000&nbsp;GB (64&nbsp;TB). The minimum recommended value
-   * is 100&nbsp;GB. If not specified, this defaults to 100.
+   * Input only. The size of the boot disk in GB attached to this instance, up to a maximum
+   * of 64000&nbsp;GB (64&nbsp;TB). The minimum recommended value is
+   * 100&nbsp;GB. If not specified, this defaults to 100.
    * 
* * int64 boot_disk_size_gb = 14 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -476,8 +468,8 @@ public interface InstanceOrBuilder * * *
-   * Input only. The type of the data disk attached to this instance, defaults
-   * to standard persistent disk (`PD_STANDARD`).
+   * Input only. The type of the data disk attached to this instance, defaults to
+   * standard persistent disk (`PD_STANDARD`).
    * 
* * @@ -491,8 +483,8 @@ public interface InstanceOrBuilder * * *
-   * Input only. The type of the data disk attached to this instance, defaults
-   * to standard persistent disk (`PD_STANDARD`).
+   * Input only. The type of the data disk attached to this instance, defaults to
+   * standard persistent disk (`PD_STANDARD`).
    * 
* * @@ -507,10 +499,10 @@ public interface InstanceOrBuilder * * *
-   * Input only. The size of the data disk in GB attached to this instance, up
-   * to a maximum of 64000&nbsp;GB (64&nbsp;TB). You can choose the size of the
-   * data disk based on how big your notebooks and data are. If not specified,
-   * this defaults to 100.
+   * Input only. The size of the data disk in GB attached to this instance, up to a maximum
+   * of 64000&nbsp;GB (64&nbsp;TB). You can choose the size of the data disk
+   * based on how big your notebooks and data are. If not specified, this
+   * defaults to 100.
    * 
* * int64 data_disk_size_gb = 26 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -523,8 +515,7 @@ public interface InstanceOrBuilder * * *
-   * Input only. If true, the data disk will not be auto deleted when deleting
-   * the instance.
+   * Input only. If true, the data disk will not be auto deleted when deleting the instance.
    * 
* * bool no_remove_data_disk = 27 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -537,8 +528,7 @@ public interface InstanceOrBuilder * * *
-   * Input only. Disk encryption method used on the boot and data disks,
-   * defaults to GMEK.
+   * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
    * 
* * @@ -552,8 +542,7 @@ public interface InstanceOrBuilder * * *
-   * Input only. Disk encryption method used on the boot and data disks,
-   * defaults to GMEK.
+   * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
    * 
* * @@ -568,11 +557,11 @@ public interface InstanceOrBuilder * * *
-   * Input only. The KMS key used to encrypt the disks, only applicable if
-   * disk_encryption is CMEK. Format:
+   * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
+   * is CMEK.
+   * Format:
    * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
-   * Learn more about [using your own encryption keys](
-   * https://cloud.google.com/kms/docs/quickstart).
+   * Learn more about [using your own encryption keys](/kms/docs/quickstart).
    * 
* * string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -584,11 +573,11 @@ public interface InstanceOrBuilder * * *
-   * Input only. The KMS key used to encrypt the disks, only applicable if
-   * disk_encryption is CMEK. Format:
+   * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
+   * is CMEK.
+   * Format:
    * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
-   * Learn more about [using your own encryption keys](
-   * https://cloud.google.com/kms/docs/quickstart).
+   * Learn more about [using your own encryption keys](/kms/docs/quickstart).
    * 
* * string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -804,6 +793,101 @@ java.lang.String getMetadataOrDefault( */ java.lang.String getMetadataOrThrow(java.lang.String key); + /** + * + * + *
+   * Optional. The type of vNIC to be used on this interface. This may be gVNIC or
+   * VirtioNet.
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for nicType. + */ + int getNicTypeValue(); + /** + * + * + *
+   * Optional. The type of vNIC to be used on this interface. This may be gVNIC or
+   * VirtioNet.
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The nicType. + */ + com.google.cloud.notebooks.v1beta1.Instance.NicType getNicType(); + + /** + * + * + *
+   * Optional. The optional reservation affinity. Setting this field will apply
+   * the specified [Zonal Compute
+   * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+   * to this notebook instance.
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reservationAffinity field is set. + */ + boolean hasReservationAffinity(); + /** + * + * + *
+   * Optional. The optional reservation affinity. Setting this field will apply
+   * the specified [Zonal Compute
+   * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+   * to this notebook instance.
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reservationAffinity. + */ + com.google.cloud.notebooks.v1beta1.ReservationAffinity getReservationAffinity(); + /** + * + * + *
+   * Optional. The optional reservation affinity. Setting this field will apply
+   * the specified [Zonal Compute
+   * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
+   * to this notebook instance.
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.notebooks.v1beta1.ReservationAffinityOrBuilder getReservationAffinityOrBuilder(); + + /** + * + * + *
+   * Optional. Flag to enable ip forwarding or not, default false/off.
+   * https://cloud.google.com/vpc/docs/using-routes#canipforward
+   * 
+ * + * bool can_ip_forward = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The canIpForward. + */ + boolean getCanIpForward(); + /** * * diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/InstanceProto.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/InstanceProto.java index ded0c5cdef7f..694168574021 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/InstanceProto.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/InstanceProto.java @@ -27,6 +27,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_notebooks_v1beta1_ReservationAffinity_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_notebooks_v1beta1_ReservationAffinity_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_notebooks_v1beta1_Instance_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -57,66 +61,79 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\037google/api/field_behavior.proto\032\031google" + "/api/resource.proto\0320google/cloud/notebo" + "oks/v1beta1/environment.proto\032\037google/pr" - + "otobuf/timestamp.proto\"\274\020\n\010Instance\022\021\n\004n" - + "ame\030\001 \001(\tB\003\340A\003\022;\n\010vm_image\030\002 \001(\0132\'.googl" - + "e.cloud.notebooks.v1beta1.VmImageH\000\022I\n\017c" - + "ontainer_image\030\003 \001(\0132..google.cloud.note" - + "books.v1beta1.ContainerImageH\000\022\033\n\023post_s" - + "tartup_script\030\004 \001(\t\022\026\n\tproxy_uri\030\005 \001(\tB\003" - + "\340A\003\022\034\n\017instance_owners\030\006 \003(\tB\003\340A\004\022\027\n\017ser" - + "vice_account\030\007 \001(\t\022\031\n\014machine_type\030\010 \001(\t" - + "B\003\340A\002\022V\n\022accelerator_config\030\t \001(\0132:.goog" - + "le.cloud.notebooks.v1beta1.Instance.Acce" - + "leratorConfig\022B\n\005state\030\n \001(\0162..google.cl" - + "oud.notebooks.v1beta1.Instance.StateB\003\340A" - + "\003\022\032\n\022install_gpu_driver\030\013 \001(\010\022\036\n\026custom_" - + "gpu_driver_path\030\014 \001(\t\022N\n\016boot_disk_type\030" - + "\r \001(\01621.google.cloud.notebooks.v1beta1.I" - + "nstance.DiskTypeB\003\340A\004\022\036\n\021boot_disk_size_" - + "gb\030\016 \001(\003B\003\340A\004\022N\n\016data_disk_type\030\031 \001(\01621." - + "google.cloud.notebooks.v1beta1.Instance." - + "DiskTypeB\003\340A\004\022\036\n\021data_disk_size_gb\030\032 \001(\003" - + "B\003\340A\004\022 \n\023no_remove_data_disk\030\033 \001(\010B\003\340A\004\022" - + "U\n\017disk_encryption\030\017 \001(\01627.google.cloud." - + "notebooks.v1beta1.Instance.DiskEncryptio" - + "nB\003\340A\004\022\024\n\007kms_key\030\020 \001(\tB\003\340A\004\022\024\n\014no_publi" - + "c_ip\030\021 \001(\010\022\027\n\017no_proxy_access\030\022 \001(\010\022\017\n\007n" - + "etwork\030\023 \001(\t\022\016\n\006subnet\030\024 \001(\t\022D\n\006labels\030\025" - + " \003(\01324.google.cloud.notebooks.v1beta1.In" - + "stance.LabelsEntry\022H\n\010metadata\030\026 \003(\01326.g" - + "oogle.cloud.notebooks.v1beta1.Instance.M" - + "etadataEntry\0224\n\013create_time\030\027 \001(\0132\032.goog" - + "le.protobuf.TimestampB\003\340A\003\0224\n\013update_tim" - + "e\030\030 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" - + "\032o\n\021AcceleratorConfig\022F\n\004type\030\001 \001(\01628.go" - + "ogle.cloud.notebooks.v1beta1.Instance.Ac" - + "celeratorType\022\022\n\ncore_count\030\002 \001(\003\032-\n\013Lab" - + "elsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" - + "\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" - + "\002 \001(\t:\0028\001\"\206\002\n\017AcceleratorType\022 \n\034ACCELER" - + "ATOR_TYPE_UNSPECIFIED\020\000\022\024\n\020NVIDIA_TESLA_" - + "K80\020\001\022\025\n\021NVIDIA_TESLA_P100\020\002\022\025\n\021NVIDIA_T" - + "ESLA_V100\020\003\022\023\n\017NVIDIA_TESLA_P4\020\004\022\023\n\017NVID" - + "IA_TESLA_T4\020\005\022\027\n\023NVIDIA_TESLA_T4_VWS\020\010\022\031" - + "\n\025NVIDIA_TESLA_P100_VWS\020\t\022\027\n\023NVIDIA_TESL" - + "A_P4_VWS\020\n\022\n\n\006TPU_V2\020\006\022\n\n\006TPU_V3\020\007\"\244\001\n\005S" - + "tate\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010STARTING\020" - + "\001\022\020\n\014PROVISIONING\020\002\022\n\n\006ACTIVE\020\003\022\014\n\010STOPP" - + "ING\020\004\022\013\n\007STOPPED\020\005\022\013\n\007DELETED\020\006\022\r\n\tUPGRA" - + "DING\020\007\022\020\n\014INITIALIZING\020\010\022\017\n\013REGISTERING\020" - + "\t\"S\n\010DiskType\022\031\n\025DISK_TYPE_UNSPECIFIED\020\000" - + "\022\017\n\013PD_STANDARD\020\001\022\n\n\006PD_SSD\020\002\022\017\n\013PD_BALA" - + "NCED\020\003\"E\n\016DiskEncryption\022\037\n\033DISK_ENCRYPT" - + "ION_UNSPECIFIED\020\000\022\010\n\004GMEK\020\001\022\010\n\004CMEK\020\002:O\352" - + "AL\n!notebooks.googleapis.com/Instance\022\'p" - + "rojects/{project}/instances/{instance}B\r" - + "\n\013environmentB\344\001\n\"com.google.cloud.noteb" - + "ooks.v1beta1B\rInstanceProtoP\001ZGgoogle.go" - + "lang.org/genproto/googleapis/cloud/noteb" - + "ooks/v1beta1;notebooks\252\002\036Google.Cloud.No" - + "tebooks.V1Beta1\312\002\036Google\\Cloud\\Notebooks" - + "\\V1beta1\352\002!Google::Cloud::Notebooks::V1b" - + "eta1b\006proto3" + + "otobuf/timestamp.proto\"\376\001\n\023ReservationAf" + + "finity\022_\n\030consume_reservation_type\030\001 \001(\016" + + "28.google.cloud.notebooks.v1beta1.Reserv" + + "ationAffinity.TypeB\003\340A\001\022\020\n\003key\030\002 \001(\tB\003\340A" + + "\001\022\023\n\006values\030\003 \003(\tB\003\340A\001\"_\n\004Type\022\024\n\020TYPE_U" + + "NSPECIFIED\020\000\022\022\n\016NO_RESERVATION\020\001\022\023\n\017ANY_" + + "RESERVATION\020\002\022\030\n\024SPECIFIC_RESERVATION\020\003\"" + + "\331\022\n\010Instance\022\021\n\004name\030\001 \001(\tB\003\340A\003\022;\n\010vm_im" + + "age\030\002 \001(\0132\'.google.cloud.notebooks.v1bet" + + "a1.VmImageH\000\022I\n\017container_image\030\003 \001(\0132.." + + "google.cloud.notebooks.v1beta1.Container" + + "ImageH\000\022\033\n\023post_startup_script\030\004 \001(\t\022\026\n\t" + + "proxy_uri\030\005 \001(\tB\003\340A\003\022\034\n\017instance_owners\030" + + "\006 \003(\tB\003\340A\004\022\027\n\017service_account\030\007 \001(\t\022\031\n\014m" + + "achine_type\030\010 \001(\tB\003\340A\002\022V\n\022accelerator_co" + + "nfig\030\t \001(\0132:.google.cloud.notebooks.v1be" + + "ta1.Instance.AcceleratorConfig\022B\n\005state\030" + + "\n \001(\0162..google.cloud.notebooks.v1beta1.I" + + "nstance.StateB\003\340A\003\022\032\n\022install_gpu_driver" + + "\030\013 \001(\010\022\036\n\026custom_gpu_driver_path\030\014 \001(\t\022N" + + "\n\016boot_disk_type\030\r \001(\01621.google.cloud.no" + + "tebooks.v1beta1.Instance.DiskTypeB\003\340A\004\022\036" + + "\n\021boot_disk_size_gb\030\016 \001(\003B\003\340A\004\022N\n\016data_d" + + "isk_type\030\031 \001(\01621.google.cloud.notebooks." + + "v1beta1.Instance.DiskTypeB\003\340A\004\022\036\n\021data_d" + + "isk_size_gb\030\032 \001(\003B\003\340A\004\022 \n\023no_remove_data" + + "_disk\030\033 \001(\010B\003\340A\004\022U\n\017disk_encryption\030\017 \001(" + + "\01627.google.cloud.notebooks.v1beta1.Insta" + + "nce.DiskEncryptionB\003\340A\004\022\024\n\007kms_key\030\020 \001(\t" + + "B\003\340A\004\022\024\n\014no_public_ip\030\021 \001(\010\022\027\n\017no_proxy_" + + "access\030\022 \001(\010\022\017\n\007network\030\023 \001(\t\022\016\n\006subnet\030" + + "\024 \001(\t\022D\n\006labels\030\025 \003(\01324.google.cloud.not" + + "ebooks.v1beta1.Instance.LabelsEntry\022H\n\010m" + + "etadata\030\026 \003(\01326.google.cloud.notebooks.v" + + "1beta1.Instance.MetadataEntry\022G\n\010nic_typ" + + "e\030\034 \001(\01620.google.cloud.notebooks.v1beta1" + + ".Instance.NicTypeB\003\340A\001\022V\n\024reservation_af" + + "finity\030\035 \001(\01323.google.cloud.notebooks.v1" + + "beta1.ReservationAffinityB\003\340A\001\022\033\n\016can_ip" + + "_forward\030\037 \001(\010B\003\340A\001\0224\n\013create_time\030\027 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\0224\n\013upd" + + "ate_time\030\030 \001(\0132\032.google.protobuf.Timesta" + + "mpB\003\340A\003\032o\n\021AcceleratorConfig\022F\n\004type\030\001 \001" + + "(\01628.google.cloud.notebooks.v1beta1.Inst" + + "ance.AcceleratorType\022\022\n\ncore_count\030\002 \001(\003" + + "\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"\206\002\n\017AcceleratorType\022 \n\034" + + "ACCELERATOR_TYPE_UNSPECIFIED\020\000\022\024\n\020NVIDIA" + + "_TESLA_K80\020\001\022\025\n\021NVIDIA_TESLA_P100\020\002\022\025\n\021N" + + "VIDIA_TESLA_V100\020\003\022\023\n\017NVIDIA_TESLA_P4\020\004\022" + + "\023\n\017NVIDIA_TESLA_T4\020\005\022\027\n\023NVIDIA_TESLA_T4_" + + "VWS\020\010\022\031\n\025NVIDIA_TESLA_P100_VWS\020\t\022\027\n\023NVID" + + "IA_TESLA_P4_VWS\020\n\022\n\n\006TPU_V2\020\006\022\n\n\006TPU_V3\020" + + "\007\"\303\001\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010ST" + + "ARTING\020\001\022\020\n\014PROVISIONING\020\002\022\n\n\006ACTIVE\020\003\022\014" + + "\n\010STOPPING\020\004\022\013\n\007STOPPED\020\005\022\013\n\007DELETED\020\006\022\r" + + "\n\tUPGRADING\020\007\022\020\n\014INITIALIZING\020\010\022\017\n\013REGIS" + + "TERING\020\t\022\016\n\nSUSPENDING\020\n\022\r\n\tSUSPENDED\020\013\"" + + "S\n\010DiskType\022\031\n\025DISK_TYPE_UNSPECIFIED\020\000\022\017" + + "\n\013PD_STANDARD\020\001\022\n\n\006PD_SSD\020\002\022\017\n\013PD_BALANC" + + "ED\020\003\"E\n\016DiskEncryption\022\037\n\033DISK_ENCRYPTIO" + + "N_UNSPECIFIED\020\000\022\010\n\004GMEK\020\001\022\010\n\004CMEK\020\002\">\n\007N" + + "icType\022\030\n\024UNSPECIFIED_NIC_TYPE\020\000\022\016\n\nVIRT" + + "IO_NET\020\001\022\t\n\005GVNIC\020\002:O\352AL\n!notebooks.goog" + + "leapis.com/Instance\022\'projects/{project}/" + + "instances/{instance}B\r\n\013environmentB\344\001\n\"" + + "com.google.cloud.notebooks.v1beta1B\rInst" + + "anceProtoP\001ZGgoogle.golang.org/genproto/" + + "googleapis/cloud/notebooks/v1beta1;noteb" + + "ooks\252\002\036Google.Cloud.Notebooks.V1Beta1\312\002\036" + + "Google\\Cloud\\Notebooks\\V1beta1\352\002!Google:" + + ":Cloud::Notebooks::V1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -127,8 +144,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.notebooks.v1beta1.EnvironmentProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); - internal_static_google_cloud_notebooks_v1beta1_Instance_descriptor = + internal_static_google_cloud_notebooks_v1beta1_ReservationAffinity_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_notebooks_v1beta1_ReservationAffinity_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_notebooks_v1beta1_ReservationAffinity_descriptor, + new java.lang.String[] { + "ConsumeReservationType", "Key", "Values", + }); + internal_static_google_cloud_notebooks_v1beta1_Instance_descriptor = + getDescriptor().getMessageTypes().get(1); internal_static_google_cloud_notebooks_v1beta1_Instance_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1beta1_Instance_descriptor, @@ -158,6 +183,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subnet", "Labels", "Metadata", + "NicType", + "ReservationAffinity", + "CanIpForward", "CreateTime", "UpdateTime", "Environment", diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/IsInstanceUpgradeableResponse.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/IsInstanceUpgradeableResponse.java index e3b6c02269ec..924323d3be99 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/IsInstanceUpgradeableResponse.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/IsInstanceUpgradeableResponse.java @@ -40,6 +40,7 @@ private IsInstanceUpgradeableResponse(com.google.protobuf.GeneratedMessageV3.Bui private IsInstanceUpgradeableResponse() { upgradeVersion_ = ""; upgradeInfo_ = ""; + upgradeImage_ = ""; } @java.lang.Override @@ -186,6 +187,59 @@ public com.google.protobuf.ByteString getUpgradeInfoBytes() { } } + public static final int UPGRADE_IMAGE_FIELD_NUMBER = 4; + private volatile java.lang.Object upgradeImage_; + /** + * + * + *
+   * The new image self link this instance will be upgraded to if calling the
+   * upgrade endpoint. This field will only be populated if field upgradeable
+   * is true.
+   * 
+ * + * string upgrade_image = 4; + * + * @return The upgradeImage. + */ + @java.lang.Override + public java.lang.String getUpgradeImage() { + java.lang.Object ref = upgradeImage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + upgradeImage_ = s; + return s; + } + } + /** + * + * + *
+   * The new image self link this instance will be upgraded to if calling the
+   * upgrade endpoint. This field will only be populated if field upgradeable
+   * is true.
+   * 
+ * + * string upgrade_image = 4; + * + * @return The bytes for upgradeImage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUpgradeImageBytes() { + java.lang.Object ref = upgradeImage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + upgradeImage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -209,6 +263,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(upgradeInfo_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, upgradeInfo_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(upgradeImage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, upgradeImage_); + } getUnknownFields().writeTo(output); } @@ -227,6 +284,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(upgradeInfo_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, upgradeInfo_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(upgradeImage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, upgradeImage_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -246,6 +306,7 @@ public boolean equals(final java.lang.Object obj) { if (getUpgradeable() != other.getUpgradeable()) return false; if (!getUpgradeVersion().equals(other.getUpgradeVersion())) return false; if (!getUpgradeInfo().equals(other.getUpgradeInfo())) return false; + if (!getUpgradeImage().equals(other.getUpgradeImage())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -263,6 +324,8 @@ public int hashCode() { hash = (53 * hash) + getUpgradeVersion().hashCode(); hash = (37 * hash) + UPGRADE_INFO_FIELD_NUMBER; hash = (53 * hash) + getUpgradeInfo().hashCode(); + hash = (37 * hash) + UPGRADE_IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getUpgradeImage().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -408,6 +471,8 @@ public Builder clear() { upgradeInfo_ = ""; + upgradeImage_ = ""; + return this; } @@ -439,6 +504,7 @@ public com.google.cloud.notebooks.v1beta1.IsInstanceUpgradeableResponse buildPar result.upgradeable_ = upgradeable_; result.upgradeVersion_ = upgradeVersion_; result.upgradeInfo_ = upgradeInfo_; + result.upgradeImage_ = upgradeImage_; onBuilt(); return result; } @@ -502,6 +568,10 @@ public Builder mergeFrom( upgradeInfo_ = other.upgradeInfo_; onChanged(); } + if (!other.getUpgradeImage().isEmpty()) { + upgradeImage_ = other.upgradeImage_; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -546,6 +616,12 @@ public Builder mergeFrom( break; } // case 26 + case 34: + { + upgradeImage_ = input.readStringRequireUtf8(); + + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -832,6 +908,122 @@ public Builder setUpgradeInfoBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object upgradeImage_ = ""; + /** + * + * + *
+     * The new image self link this instance will be upgraded to if calling the
+     * upgrade endpoint. This field will only be populated if field upgradeable
+     * is true.
+     * 
+ * + * string upgrade_image = 4; + * + * @return The upgradeImage. + */ + public java.lang.String getUpgradeImage() { + java.lang.Object ref = upgradeImage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + upgradeImage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The new image self link this instance will be upgraded to if calling the
+     * upgrade endpoint. This field will only be populated if field upgradeable
+     * is true.
+     * 
+ * + * string upgrade_image = 4; + * + * @return The bytes for upgradeImage. + */ + public com.google.protobuf.ByteString getUpgradeImageBytes() { + java.lang.Object ref = upgradeImage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + upgradeImage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The new image self link this instance will be upgraded to if calling the
+     * upgrade endpoint. This field will only be populated if field upgradeable
+     * is true.
+     * 
+ * + * string upgrade_image = 4; + * + * @param value The upgradeImage to set. + * @return This builder for chaining. + */ + public Builder setUpgradeImage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + upgradeImage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The new image self link this instance will be upgraded to if calling the
+     * upgrade endpoint. This field will only be populated if field upgradeable
+     * is true.
+     * 
+ * + * string upgrade_image = 4; + * + * @return This builder for chaining. + */ + public Builder clearUpgradeImage() { + + upgradeImage_ = getDefaultInstance().getUpgradeImage(); + onChanged(); + return this; + } + /** + * + * + *
+     * The new image self link this instance will be upgraded to if calling the
+     * upgrade endpoint. This field will only be populated if field upgradeable
+     * is true.
+     * 
+ * + * string upgrade_image = 4; + * + * @param value The bytes for upgradeImage to set. + * @return This builder for chaining. + */ + public Builder setUpgradeImageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + upgradeImage_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/IsInstanceUpgradeableResponseOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/IsInstanceUpgradeableResponseOrBuilder.java index 97fa89b22284..56f315912388 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/IsInstanceUpgradeableResponseOrBuilder.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/IsInstanceUpgradeableResponseOrBuilder.java @@ -87,4 +87,33 @@ public interface IsInstanceUpgradeableResponseOrBuilder * @return The bytes for upgradeInfo. */ com.google.protobuf.ByteString getUpgradeInfoBytes(); + + /** + * + * + *
+   * The new image self link this instance will be upgraded to if calling the
+   * upgrade endpoint. This field will only be populated if field upgradeable
+   * is true.
+   * 
+ * + * string upgrade_image = 4; + * + * @return The upgradeImage. + */ + java.lang.String getUpgradeImage(); + /** + * + * + *
+   * The new image self link this instance will be upgraded to if calling the
+   * upgrade endpoint. This field will only be populated if field upgradeable
+   * is true.
+   * 
+ * + * string upgrade_image = 4; + * + * @return The bytes for upgradeImage. + */ + com.google.protobuf.ByteString getUpgradeImageBytes(); } diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/NotebooksProto.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/NotebooksProto.java index 994a83f9e199..817408b72456 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/NotebooksProto.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/NotebooksProto.java @@ -138,13 +138,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n,google/cloud/notebooks/v1beta1/service" + ".proto\022\036google.cloud.notebooks.v1beta1\032\034" - + "google/api/annotations.proto\032\037google/api" - + "/field_behavior.proto\0320google/cloud/note" - + "books/v1beta1/environment.proto\032-google/" - + "cloud/notebooks/v1beta1/instance.proto\032#" - + "google/longrunning/operations.proto\032\037goo" - + "gle/protobuf/timestamp.proto\032\027google/api" - + "/client.proto\"\357\001\n\021OperationMetadata\022/\n\013c" + + "google/api/annotations.proto\032\027google/api" + + "/client.proto\032\037google/api/field_behavior" + + ".proto\0320google/cloud/notebooks/v1beta1/e" + + "nvironment.proto\032-google/cloud/notebooks" + + "/v1beta1/instance.proto\032#google/longrunn" + + "ing/operations.proto\032\037google/protobuf/ti" + + "mestamp.proto\"\357\001\n\021OperationMetadata\022/\n\013c" + "reate_time\030\001 \001(\0132\032.google.protobuf.Times" + "tamp\022,\n\010end_time\030\002 \001(\0132\032.google.protobuf" + ".Timestamp\022\016\n\006target\030\003 \001(\t\022\014\n\004verb\030\004 \001(\t" @@ -183,145 +183,145 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "nstanceInfoRequest.MetadataEntry\032/\n\rMeta" + "dataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" + "\001\">\n\034IsInstanceUpgradeableRequest\022\036\n\021not" - + "ebook_instance\030\001 \001(\tB\003\340A\002\"c\n\035IsInstanceU" + + "ebook_instance\030\001 \001(\tB\003\340A\002\"z\n\035IsInstanceU" + "pgradeableResponse\022\023\n\013upgradeable\030\001 \001(\010\022" + "\027\n\017upgrade_version\030\002 \001(\t\022\024\n\014upgrade_info" - + "\030\003 \001(\t\"+\n\026UpgradeInstanceRequest\022\021\n\004name" - + "\030\001 \001(\tB\003\340A\002\"G\n\036UpgradeInstanceInternalRe" - + "quest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\022\n\005vm_id\030\002 \001(\tB" - + "\003\340A\002\"U\n\027ListEnvironmentsRequest\022\023\n\006paren" - + "t\030\001 \001(\tB\003\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_" - + "token\030\003 \001(\t\"\213\001\n\030ListEnvironmentsResponse" - + "\022A\n\014environments\030\001 \003(\0132+.google.cloud.no" - + "tebooks.v1beta1.Environment\022\027\n\017next_page" - + "_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"*\n\025Get" - + "EnvironmentRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\"\223\001" - + "\n\030CreateEnvironmentRequest\022\023\n\006parent\030\001 \001" - + "(\tB\003\340A\002\022\033\n\016environment_id\030\002 \001(\tB\003\340A\002\022E\n\013" - + "environment\030\003 \001(\0132+.google.cloud.noteboo" - + "ks.v1beta1.EnvironmentB\003\340A\002\"-\n\030DeleteEnv" - + "ironmentRequest\022\021\n\004name\030\001 \001(\tB\003\340A\0022\370\037\n\017N" - + "otebookService\022\270\001\n\rListInstances\0224.googl" - + "e.cloud.notebooks.v1beta1.ListInstancesR" - + "equest\0325.google.cloud.notebooks.v1beta1." - + "ListInstancesResponse\":\202\323\344\223\0024\0222/v1beta1/" - + "{parent=projects/*/locations/*}/instance" - + "s\022\247\001\n\013GetInstance\0222.google.cloud.noteboo" - + "ks.v1beta1.GetInstanceRequest\032(.google.c" - + "loud.notebooks.v1beta1.Instance\":\202\323\344\223\0024\022" - + "2/v1beta1/{name=projects/*/locations/*/i" - + "nstances/*}\022\314\001\n\016CreateInstance\0225.google." - + "cloud.notebooks.v1beta1.CreateInstanceRe" - + "quest\032\035.google.longrunning.Operation\"d\202\323" - + "\344\223\002>\"2/v1beta1/{parent=projects/*/locati" - + "ons/*}/instances:\010instance\312A\035\n\010Instance\022" - + "\021OperationMetadata\022\322\001\n\020RegisterInstance\022" - + "7.google.cloud.notebooks.v1beta1.Registe" - + "rInstanceRequest\032\035.google.longrunning.Op" - + "eration\"f\202\323\344\223\002@\";/v1beta1/{parent=projec" - + "ts/*/locations/*}/instances:register:\001*\312" - + "A\035\n\010Instance\022\021OperationMetadata\022\344\001\n\026SetI" - + "nstanceAccelerator\022=.google.cloud.notebo" - + "oks.v1beta1.SetInstanceAcceleratorReques" - + "t\032\035.google.longrunning.Operation\"l\202\323\344\223\002F" - + "2A/v1beta1/{name=projects/*/locations/*/" - + "instances/*}:setAccelerator:\001*\312A\035\n\010Insta" - + "nce\022\021OperationMetadata\022\344\001\n\026SetInstanceMa" - + "chineType\022=.google.cloud.notebooks.v1bet" - + "a1.SetInstanceMachineTypeRequest\032\035.googl" - + "e.longrunning.Operation\"l\202\323\344\223\002F2A/v1beta" - + "1/{name=projects/*/locations/*/instances" - + "/*}:setMachineType:\001*\312A\035\n\010Instance\022\021Oper" - + "ationMetadata\022\325\001\n\021SetInstanceLabels\0228.go" - + "ogle.cloud.notebooks.v1beta1.SetInstance" - + "LabelsRequest\032\035.google.longrunning.Opera" - + "tion\"g\202\323\344\223\002A2\"2/v1beta1/{p" + + "arent=projects/*/locations/*}/instances:" + + "\010instance\312A\035\n\010Instance\022\021OperationMetadat" + + "a\022\322\001\n\020RegisterInstance\0227.google.cloud.no" + + "tebooks.v1beta1.RegisterInstanceRequest\032" + + "\035.google.longrunning.Operation\"f\202\323\344\223\002@\";" + + "/v1beta1/{parent=projects/*/locations/*}" + + "/instances:register:\001*\312A\035\n\010Instance\022\021Ope" + + "rationMetadata\022\344\001\n\026SetInstanceAccelerato" + + "r\022=.google.cloud.notebooks.v1beta1.SetIn" + + "stanceAcceleratorRequest\032\035.google.longru" + + "nning.Operation\"l\202\323\344\223\002F2A/v1beta1/{name=" + + "projects/*/locations/*/instances/*}:setA" + + "ccelerator:\001*\312A\035\n\010Instance\022\021OperationMet" + + "adata\022\344\001\n\026SetInstanceMachineType\022=.googl" + + "e.cloud.notebooks.v1beta1.SetInstanceMac" + + "hineTypeRequest\032\035.google.longrunning.Ope" + + "ration\"l\202\323\344\223\002F2A/v1beta1/{name=projects/" + + "*/locations/*/instances/*}:setMachineTyp" + + "e:\001*\312A\035\n\010Instance\022\021OperationMetadata\022\325\001\n" + + "\021SetInstanceLabels\0228.google.cloud.notebo" + + "oks.v1beta1.SetInstanceLabelsRequest\032\035.g" + + "oogle.longrunning.Operation\"g\202\323\344\223\002A2\"9/v1beta1/{name=projects/*/loc" - + "ations/*/instances/*}:report:\001*\312A\035\n\010Inst" - + "ance\022\021OperationMetadata\022\353\001\n\025IsInstanceUp" - + "gradeable\022<.google.cloud.notebooks.v1bet" - + "a1.IsInstanceUpgradeableRequest\032=.google" - + ".cloud.notebooks.v1beta1.IsInstanceUpgra" - + "deableResponse\"U\202\323\344\223\002O\022M/v1beta1/{notebo" - + "ok_instance=projects/*/locations/*/insta" - + "nces/*}:isUpgradeable\022\317\001\n\017UpgradeInstanc" - + "e\0226.google.cloud.notebooks.v1beta1.Upgra" - + "deInstanceRequest\032\035.google.longrunning.O" - + "peration\"e\202\323\344\223\002?\":/v1beta1/{name=project" - + "s/*/locations/*/instances/*}:upgrade:\001*\312" - + "A\035\n\010Instance\022\021OperationMetadata\022\347\001\n\027Upgr" - + "adeInstanceInternal\022>.google.cloud.noteb" - + "ooks.v1beta1.UpgradeInstanceInternalRequ" - + "est\032\035.google.longrunning.Operation\"m\202\323\344\223" - + "\002G\"B/v1beta1/{name=projects/*/locations/" - + "*/instances/*}:upgradeInternal:\001*\312A\035\n\010In" - + "stance\022\021OperationMetadata\022\304\001\n\020ListEnviro" - + "nments\0227.google.cloud.notebooks.v1beta1." - + "ListEnvironmentsRequest\0328.google.cloud.n" - + "otebooks.v1beta1.ListEnvironmentsRespons" - + "e\"=\202\323\344\223\0027\0225/v1beta1/{parent=projects/*/l" - + "ocations/*}/environments\022\263\001\n\016GetEnvironm" - + "ent\0225.google.cloud.notebooks.v1beta1.Get" - + "EnvironmentRequest\032+.google.cloud.notebo" - + "oks.v1beta1.Environment\"=\202\323\344\223\0027\0225/v1beta" - + "1/{name=projects/*/locations/*/environme" - + "nts/*}\022\333\001\n\021CreateEnvironment\0228.google.cl" - + "oud.notebooks.v1beta1.CreateEnvironmentR" - + "equest\032\035.google.longrunning.Operation\"m\202" - + "\323\344\223\002D\"5/v1beta1/{parent=projects/*/locat" - + "ions/*}/environments:\013environment\312A \n\013En" - + "vironment\022\021OperationMetadata\022\330\001\n\021DeleteE" - + "nvironment\0228.google.cloud.notebooks.v1be" - + "ta1.DeleteEnvironmentRequest\032\035.google.lo" - + "ngrunning.Operation\"j\202\323\344\223\0027*5/v1beta1/{n" - + "ame=projects/*/locations/*/environments/" - + "*}\312A*\n\025google.protobuf.Empty\022\021OperationM" - + "etadata\032L\312A\030notebooks.googleapis.com\322A.h" - + "ttps://www.googleapis.com/auth/cloud-pla" - + "tformB\345\001\n\"com.google.cloud.notebooks.v1b" - + "eta1B\016NotebooksProtoP\001ZGgoogle.golang.or" - + "g/genproto/googleapis/cloud/notebooks/v1" - + "beta1;notebooks\252\002\036Google.Cloud.Notebooks" - + ".V1Beta1\312\002\036Google\\Cloud\\Notebooks\\V1beta" - + "1\352\002!Google::Cloud::Notebooks::V1beta1b\006p" - + "roto3" + + "nces/*}:setLabels:\001*\312A\035\n\010Instance\022\021Opera" + + "tionMetadata\022\317\001\n\016DeleteInstance\0225.google" + + ".cloud.notebooks.v1beta1.DeleteInstanceR" + + "equest\032\035.google.longrunning.Operation\"g\202" + + "\323\344\223\0024*2/v1beta1/{name=projects/*/locatio" + + "ns/*/instances/*}\312A*\n\025google.protobuf.Em" + + "pty\022\021OperationMetadata\022\311\001\n\rStartInstance" + + "\0224.google.cloud.notebooks.v1beta1.StartI" + + "nstanceRequest\032\035.google.longrunning.Oper" + + "ation\"c\202\323\344\223\002=\"8/v1beta1/{name=projects/*" + + "/locations/*/instances/*}:start:\001*\312A\035\n\010I" + + "nstance\022\021OperationMetadata\022\306\001\n\014StopInsta" + + "nce\0223.google.cloud.notebooks.v1beta1.Sto" + + "pInstanceRequest\032\035.google.longrunning.Op" + + "eration\"b\202\323\344\223\002<\"7/v1beta1/{name=projects" + + "/*/locations/*/instances/*}:stop:\001*\312A\035\n\010" + + "Instance\022\021OperationMetadata\022\311\001\n\rResetIns" + + "tance\0224.google.cloud.notebooks.v1beta1.R" + + "esetInstanceRequest\032\035.google.longrunning" + + ".Operation\"c\202\323\344\223\002=\"8/v1beta1/{name=proje" + + "cts/*/locations/*/instances/*}:reset:\001*\312" + + "A\035\n\010Instance\022\021OperationMetadata\022\324\001\n\022Repo" + + "rtInstanceInfo\0229.google.cloud.notebooks." + + "v1beta1.ReportInstanceInfoRequest\032\035.goog" + + "le.longrunning.Operation\"d\202\323\344\223\002>\"9/v1bet" + + "a1/{name=projects/*/locations/*/instance" + + "s/*}:report:\001*\312A\035\n\010Instance\022\021OperationMe" + + "tadata\022\356\001\n\025IsInstanceUpgradeable\022<.googl" + + "e.cloud.notebooks.v1beta1.IsInstanceUpgr" + + "adeableRequest\032=.google.cloud.notebooks." + + "v1beta1.IsInstanceUpgradeableResponse\"X\210" + + "\002\001\202\323\344\223\002O\022M/v1beta1/{notebook_instance=pr" + + "ojects/*/locations/*/instances/*}:isUpgr" + + "adeable\022\322\001\n\017UpgradeInstance\0226.google.clo" + + "ud.notebooks.v1beta1.UpgradeInstanceRequ" + + "est\032\035.google.longrunning.Operation\"h\210\002\001\202" + + "\323\344\223\002?\":/v1beta1/{name=projects/*/locatio" + + "ns/*/instances/*}:upgrade:\001*\312A\035\n\010Instanc" + + "e\022\021OperationMetadata\022\352\001\n\027UpgradeInstance" + + "Internal\022>.google.cloud.notebooks.v1beta" + + "1.UpgradeInstanceInternalRequest\032\035.googl" + + "e.longrunning.Operation\"p\210\002\001\202\323\344\223\002G\"B/v1b" + + "eta1/{name=projects/*/locations/*/instan" + + "ces/*}:upgradeInternal:\001*\312A\035\n\010Instance\022\021" + + "OperationMetadata\022\304\001\n\020ListEnvironments\0227" + + ".google.cloud.notebooks.v1beta1.ListEnvi" + + "ronmentsRequest\0328.google.cloud.notebooks" + + ".v1beta1.ListEnvironmentsResponse\"=\202\323\344\223\002" + + "7\0225/v1beta1/{parent=projects/*/locations" + + "/*}/environments\022\263\001\n\016GetEnvironment\0225.go" + + "ogle.cloud.notebooks.v1beta1.GetEnvironm" + + "entRequest\032+.google.cloud.notebooks.v1be" + + "ta1.Environment\"=\202\323\344\223\0027\0225/v1beta1/{name=" + + "projects/*/locations/*/environments/*}\022\333" + + "\001\n\021CreateEnvironment\0228.google.cloud.note" + + "books.v1beta1.CreateEnvironmentRequest\032\035" + + ".google.longrunning.Operation\"m\202\323\344\223\002D\"5/" + + "v1beta1/{parent=projects/*/locations/*}/" + + "environments:\013environment\312A \n\013Environmen" + + "t\022\021OperationMetadata\022\330\001\n\021DeleteEnvironme" + + "nt\0228.google.cloud.notebooks.v1beta1.Dele" + + "teEnvironmentRequest\032\035.google.longrunnin" + + "g.Operation\"j\202\323\344\223\0027*5/v1beta1/{name=proj" + + "ects/*/locations/*/environments/*}\312A*\n\025g" + + "oogle.protobuf.Empty\022\021OperationMetadata\032" + + "L\312A\030notebooks.googleapis.com\322A.https://w" + + "ww.googleapis.com/auth/cloud-platformB\345\001" + + "\n\"com.google.cloud.notebooks.v1beta1B\016No" + + "tebooksProtoP\001ZGgoogle.golang.org/genpro" + + "to/googleapis/cloud/notebooks/v1beta1;no" + + "tebooks\252\002\036Google.Cloud.Notebooks.V1Beta1" + + "\312\002\036Google\\Cloud\\Notebooks\\V1beta1\352\002!Goog" + + "le::Cloud::Notebooks::V1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.cloud.notebooks.v1beta1.EnvironmentProto.getDescriptor(), com.google.cloud.notebooks.v1beta1.InstanceProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), - com.google.api.ClientProto.getDescriptor(), }); internal_static_google_cloud_notebooks_v1beta1_OperationMetadata_descriptor = getDescriptor().getMessageTypes().get(0); @@ -476,7 +476,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_notebooks_v1beta1_IsInstanceUpgradeableResponse_descriptor, new java.lang.String[] { - "Upgradeable", "UpgradeVersion", "UpgradeInfo", + "Upgradeable", "UpgradeVersion", "UpgradeInfo", "UpgradeImage", }); internal_static_google_cloud_notebooks_v1beta1_UpgradeInstanceRequest_descriptor = getDescriptor().getMessageTypes().get(16); @@ -544,12 +544,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.cloud.notebooks.v1beta1.EnvironmentProto.getDescriptor(); com.google.cloud.notebooks.v1beta1.InstanceProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/OperationMetadata.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/OperationMetadata.java index 4a5efc98bc43..01d82f79537a 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/OperationMetadata.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/OperationMetadata.java @@ -319,8 +319,7 @@ public com.google.protobuf.ByteString getStatusMessageBytes() { * Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. *
* * bool requested_cancellation = 6; @@ -1625,8 +1624,7 @@ public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { * Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. *
* * bool requested_cancellation = 6; @@ -1644,8 +1642,7 @@ public boolean getRequestedCancellation() { * Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. * * * bool requested_cancellation = 6; @@ -1666,8 +1663,7 @@ public Builder setRequestedCancellation(boolean value) { * Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. * * * bool requested_cancellation = 6; diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/OperationMetadataOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/OperationMetadataOrBuilder.java index e7447fa78ca8..a7607817fa6f 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/OperationMetadataOrBuilder.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/OperationMetadataOrBuilder.java @@ -175,8 +175,7 @@ public interface OperationMetadataOrBuilder * Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. * * * bool requested_cancellation = 6; diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/ReservationAffinity.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/ReservationAffinity.java new file mode 100644 index 000000000000..12c1e8a36c54 --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/ReservationAffinity.java @@ -0,0 +1,1246 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1beta1/instance.proto + +package com.google.cloud.notebooks.v1beta1; + +/** + * + * + *
+ * Reservation Affinity for consuming Zonal reservation.
+ * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1beta1.ReservationAffinity} + */ +public final class ReservationAffinity extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.notebooks.v1beta1.ReservationAffinity) + ReservationAffinityOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReservationAffinity.newBuilder() to construct. + private ReservationAffinity(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReservationAffinity() { + consumeReservationType_ = 0; + key_ = ""; + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReservationAffinity(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1beta1.InstanceProto + .internal_static_google_cloud_notebooks_v1beta1_ReservationAffinity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1beta1.InstanceProto + .internal_static_google_cloud_notebooks_v1beta1_ReservationAffinity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1beta1.ReservationAffinity.class, + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Builder.class); + } + + /** + * + * + *
+   * Indicates whether to consume capacity from an reservation or not.
+   * 
+ * + * Protobuf enum {@code google.cloud.notebooks.v1beta1.ReservationAffinity.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default type.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Do not consume from any allocated capacity.
+     * 
+ * + * NO_RESERVATION = 1; + */ + NO_RESERVATION(1), + /** + * + * + *
+     * Consume any reservation available.
+     * 
+ * + * ANY_RESERVATION = 2; + */ + ANY_RESERVATION(2), + /** + * + * + *
+     * Must consume from a specific reservation. Must specify key value fields
+     * for specifying the reservations.
+     * 
+ * + * SPECIFIC_RESERVATION = 3; + */ + SPECIFIC_RESERVATION(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default type.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Do not consume from any allocated capacity.
+     * 
+ * + * NO_RESERVATION = 1; + */ + public static final int NO_RESERVATION_VALUE = 1; + /** + * + * + *
+     * Consume any reservation available.
+     * 
+ * + * ANY_RESERVATION = 2; + */ + public static final int ANY_RESERVATION_VALUE = 2; + /** + * + * + *
+     * Must consume from a specific reservation. Must specify key value fields
+     * for specifying the reservations.
+     * 
+ * + * SPECIFIC_RESERVATION = 3; + */ + public static final int SPECIFIC_RESERVATION_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return NO_RESERVATION; + case 2: + return ANY_RESERVATION; + case 3: + return SPECIFIC_RESERVATION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.notebooks.v1beta1.ReservationAffinity.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.notebooks.v1beta1.ReservationAffinity.Type) + } + + public static final int CONSUME_RESERVATION_TYPE_FIELD_NUMBER = 1; + private int consumeReservationType_; + /** + * + * + *
+   * Optional. Type of reservation to consume
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for consumeReservationType. + */ + @java.lang.Override + public int getConsumeReservationTypeValue() { + return consumeReservationType_; + } + /** + * + * + *
+   * Optional. Type of reservation to consume
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The consumeReservationType. + */ + @java.lang.Override + public com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type getConsumeReservationType() { + @SuppressWarnings("deprecation") + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type result = + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type.valueOf( + consumeReservationType_); + return result == null + ? com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type.UNRECOGNIZED + : result; + } + + public static final int KEY_FIELD_NUMBER = 2; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Optional. Corresponds to the label key of reservation resource.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Corresponds to the label key of reservation resource.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList values_; + /** + * + * + *
+   * Optional. Corresponds to the label values of reservation resource.
+   * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_; + } + /** + * + * + *
+   * Optional. Corresponds to the label values of reservation resource.
+   * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * Optional. Corresponds to the label values of reservation resource.
+   * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+   * Optional. Corresponds to the label values of reservation resource.
+   * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (consumeReservationType_ + != com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type.TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, consumeReservationType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); + } + for (int i = 0; i < values_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, values_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (consumeReservationType_ + != com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type.TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, consumeReservationType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); + } + { + int dataSize = 0; + for (int i = 0; i < values_.size(); i++) { + dataSize += computeStringSizeNoTag(values_.getRaw(i)); + } + size += dataSize; + size += 1 * getValuesList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.notebooks.v1beta1.ReservationAffinity)) { + return super.equals(obj); + } + com.google.cloud.notebooks.v1beta1.ReservationAffinity other = + (com.google.cloud.notebooks.v1beta1.ReservationAffinity) obj; + + if (consumeReservationType_ != other.consumeReservationType_) return false; + if (!getKey().equals(other.getKey())) return false; + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONSUME_RESERVATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + consumeReservationType_; + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.notebooks.v1beta1.ReservationAffinity prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Reservation Affinity for consuming Zonal reservation.
+   * 
+ * + * Protobuf type {@code google.cloud.notebooks.v1beta1.ReservationAffinity} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.notebooks.v1beta1.ReservationAffinity) + com.google.cloud.notebooks.v1beta1.ReservationAffinityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.notebooks.v1beta1.InstanceProto + .internal_static_google_cloud_notebooks_v1beta1_ReservationAffinity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.notebooks.v1beta1.InstanceProto + .internal_static_google_cloud_notebooks_v1beta1_ReservationAffinity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.notebooks.v1beta1.ReservationAffinity.class, + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Builder.class); + } + + // Construct using com.google.cloud.notebooks.v1beta1.ReservationAffinity.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + consumeReservationType_ = 0; + + key_ = ""; + + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.notebooks.v1beta1.InstanceProto + .internal_static_google_cloud_notebooks_v1beta1_ReservationAffinity_descriptor; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1beta1.ReservationAffinity getDefaultInstanceForType() { + return com.google.cloud.notebooks.v1beta1.ReservationAffinity.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.notebooks.v1beta1.ReservationAffinity build() { + com.google.cloud.notebooks.v1beta1.ReservationAffinity result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1beta1.ReservationAffinity buildPartial() { + com.google.cloud.notebooks.v1beta1.ReservationAffinity result = + new com.google.cloud.notebooks.v1beta1.ReservationAffinity(this); + int from_bitField0_ = bitField0_; + result.consumeReservationType_ = consumeReservationType_; + result.key_ = key_; + if (((bitField0_ & 0x00000001) != 0)) { + values_ = values_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.notebooks.v1beta1.ReservationAffinity) { + return mergeFrom((com.google.cloud.notebooks.v1beta1.ReservationAffinity) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.notebooks.v1beta1.ReservationAffinity other) { + if (other == com.google.cloud.notebooks.v1beta1.ReservationAffinity.getDefaultInstance()) + return this; + if (other.consumeReservationType_ != 0) { + setConsumeReservationTypeValue(other.getConsumeReservationTypeValue()); + } + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + consumeReservationType_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + key_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureValuesIsMutable(); + values_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int consumeReservationType_ = 0; + /** + * + * + *
+     * Optional. Type of reservation to consume
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for consumeReservationType. + */ + @java.lang.Override + public int getConsumeReservationTypeValue() { + return consumeReservationType_; + } + /** + * + * + *
+     * Optional. Type of reservation to consume
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for consumeReservationType to set. + * @return This builder for chaining. + */ + public Builder setConsumeReservationTypeValue(int value) { + + consumeReservationType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of reservation to consume
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The consumeReservationType. + */ + @java.lang.Override + public com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type getConsumeReservationType() { + @SuppressWarnings("deprecation") + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type result = + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type.valueOf( + consumeReservationType_); + return result == null + ? com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Type of reservation to consume
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The consumeReservationType to set. + * @return This builder for chaining. + */ + public Builder setConsumeReservationType( + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + consumeReservationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of reservation to consume
+     * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearConsumeReservationType() { + + consumeReservationType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object key_ = ""; + /** + * + * + *
+     * Optional. Corresponds to the label key of reservation resource.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Corresponds to the label key of reservation resource.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Corresponds to the label key of reservation resource.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label key of reservation resource.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label key of reservation resource.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList values_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new com.google.protobuf.LazyStringArrayList(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Optional. Corresponds to the label values of reservation resource.
+     * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_.getUnmodifiableView(); + } + /** + * + * + *
+     * Optional. Corresponds to the label values of reservation resource.
+     * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * Optional. Corresponds to the label values of reservation resource.
+     * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+     * Optional. Corresponds to the label values of reservation resource.
+     * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + /** + * + * + *
+     * Optional. Corresponds to the label values of reservation resource.
+     * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label values of reservation resource.
+     * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label values of reservation resource.
+     * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label values of reservation resource.
+     * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label values of reservation resource.
+     * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the values to add. + * @return This builder for chaining. + */ + public Builder addValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.notebooks.v1beta1.ReservationAffinity) + } + + // @@protoc_insertion_point(class_scope:google.cloud.notebooks.v1beta1.ReservationAffinity) + private static final com.google.cloud.notebooks.v1beta1.ReservationAffinity DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.notebooks.v1beta1.ReservationAffinity(); + } + + public static com.google.cloud.notebooks.v1beta1.ReservationAffinity getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReservationAffinity parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.notebooks.v1beta1.ReservationAffinity getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/ReservationAffinityOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/ReservationAffinityOrBuilder.java new file mode 100644 index 000000000000..9be198a0704c --- /dev/null +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/ReservationAffinityOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/notebooks/v1beta1/instance.proto + +package com.google.cloud.notebooks.v1beta1; + +public interface ReservationAffinityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.notebooks.v1beta1.ReservationAffinity) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Type of reservation to consume
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for consumeReservationType. + */ + int getConsumeReservationTypeValue(); + /** + * + * + *
+   * Optional. Type of reservation to consume
+   * 
+ * + * + * .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The consumeReservationType. + */ + com.google.cloud.notebooks.v1beta1.ReservationAffinity.Type getConsumeReservationType(); + + /** + * + * + *
+   * Optional. Corresponds to the label key of reservation resource.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Optional. Corresponds to the label key of reservation resource.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+   * Optional. Corresponds to the label values of reservation resource.
+   * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * Optional. Corresponds to the label values of reservation resource.
+   * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * Optional. Corresponds to the label values of reservation resource.
+   * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + java.lang.String getValues(int index); + /** + * + * + *
+   * Optional. Corresponds to the label values of reservation resource.
+   * 
+ * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + com.google.protobuf.ByteString getValuesBytes(int index); +} diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/SetInstanceAcceleratorRequest.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/SetInstanceAcceleratorRequest.java index f1379dbfbe4d..6c336306f485 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/SetInstanceAcceleratorRequest.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/SetInstanceAcceleratorRequest.java @@ -167,10 +167,10 @@ public com.google.cloud.notebooks.v1beta1.Instance.AcceleratorType getType() { * * *
-   * Required. Count of cores of this accelerator. Note that not all
-   * combinations of `type` and `core_count` are valid. Check [GPUs on Compute
-   * Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a
-   * valid combination. TPUs are not supported.
+   * Required. Count of cores of this accelerator. Note that not all combinations
+   * of `type` and `core_count` are valid. Check [GPUs on
+   * Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to
+   * find a valid combination. TPUs are not supported.
    * 
* * int64 core_count = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -781,10 +781,10 @@ public Builder clearType() { * * *
-     * Required. Count of cores of this accelerator. Note that not all
-     * combinations of `type` and `core_count` are valid. Check [GPUs on Compute
-     * Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a
-     * valid combination. TPUs are not supported.
+     * Required. Count of cores of this accelerator. Note that not all combinations
+     * of `type` and `core_count` are valid. Check [GPUs on
+     * Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to
+     * find a valid combination. TPUs are not supported.
      * 
* * int64 core_count = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -799,10 +799,10 @@ public long getCoreCount() { * * *
-     * Required. Count of cores of this accelerator. Note that not all
-     * combinations of `type` and `core_count` are valid. Check [GPUs on Compute
-     * Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a
-     * valid combination. TPUs are not supported.
+     * Required. Count of cores of this accelerator. Note that not all combinations
+     * of `type` and `core_count` are valid. Check [GPUs on
+     * Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to
+     * find a valid combination. TPUs are not supported.
      * 
* * int64 core_count = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -820,10 +820,10 @@ public Builder setCoreCount(long value) { * * *
-     * Required. Count of cores of this accelerator. Note that not all
-     * combinations of `type` and `core_count` are valid. Check [GPUs on Compute
-     * Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a
-     * valid combination. TPUs are not supported.
+     * Required. Count of cores of this accelerator. Note that not all combinations
+     * of `type` and `core_count` are valid. Check [GPUs on
+     * Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to
+     * find a valid combination. TPUs are not supported.
      * 
* * int64 core_count = 3 [(.google.api.field_behavior) = REQUIRED]; diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/SetInstanceAcceleratorRequestOrBuilder.java b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/SetInstanceAcceleratorRequestOrBuilder.java index faf2ee82803a..5083c6e766a2 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/SetInstanceAcceleratorRequestOrBuilder.java +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/java/com/google/cloud/notebooks/v1beta1/SetInstanceAcceleratorRequestOrBuilder.java @@ -83,10 +83,10 @@ public interface SetInstanceAcceleratorRequestOrBuilder * * *
-   * Required. Count of cores of this accelerator. Note that not all
-   * combinations of `type` and `core_count` are valid. Check [GPUs on Compute
-   * Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a
-   * valid combination. TPUs are not supported.
+   * Required. Count of cores of this accelerator. Note that not all combinations
+   * of `type` and `core_count` are valid. Check [GPUs on
+   * Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to
+   * find a valid combination. TPUs are not supported.
    * 
* * int64 core_count = 3 [(.google.api.field_behavior) = REQUIRED]; diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/environment.proto b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/environment.proto index c047877e0440..3bf88450cd48 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/environment.proto +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/environment.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,13 +20,13 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/notebooks/v1beta1;notebooks"; option csharp_namespace = "Google.Cloud.Notebooks.V1Beta1"; -option php_namespace = "Google\\Cloud\\Notebooks\\V1beta1"; -option ruby_package = "Google::Cloud::Notebooks::V1beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/notebooks/v1beta1;notebooks"; option java_multiple_files = true; option java_outer_classname = "EnvironmentProto"; option java_package = "com.google.cloud.notebooks.v1beta1"; +option php_namespace = "Google\\Cloud\\Notebooks\\V1beta1"; +option ruby_package = "Google::Cloud::Notebooks::V1beta1"; // Definition of a software environment that is used to start a notebook // instance. diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/instance.proto b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/instance.proto index c7a4e999e3d4..9776959218e3 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/instance.proto +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/instance.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,11 +23,39 @@ import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Notebooks.V1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/notebooks/v1beta1;notebooks"; -option php_namespace = "Google\\Cloud\\Notebooks\\V1beta1"; -option ruby_package = "Google::Cloud::Notebooks::V1beta1"; option java_multiple_files = true; option java_outer_classname = "InstanceProto"; option java_package = "com.google.cloud.notebooks.v1beta1"; +option php_namespace = "Google\\Cloud\\Notebooks\\V1beta1"; +option ruby_package = "Google::Cloud::Notebooks::V1beta1"; + +// Reservation Affinity for consuming Zonal reservation. +message ReservationAffinity { + // Indicates whether to consume capacity from an reservation or not. + enum Type { + // Default type. + TYPE_UNSPECIFIED = 0; + + // Do not consume from any allocated capacity. + NO_RESERVATION = 1; + + // Consume any reservation available. + ANY_RESERVATION = 2; + + // Must consume from a specific reservation. Must specify key value fields + // for specifying the reservations. + SPECIFIC_RESERVATION = 3; + } + + // Optional. Type of reservation to consume + Type consume_reservation_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label key of reservation resource. + string key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label values of reservation resource. + repeated string values = 3 [(google.api.field_behavior) = OPTIONAL]; +} // The definition of a notebook instance. message Instance { @@ -36,18 +64,6 @@ message Instance { pattern: "projects/{project}/instances/{instance}" }; - // Definition of a hardware accelerator. Note that not all combinations - // of `type` and `core_count` are valid. Check [GPUs on - // Compute Engine](/compute/docs/gpus/#gpus-list) to find a valid - // combination. TPUs are not supported. - message AcceleratorConfig { - // Type of this accelerator. - AcceleratorType type = 1; - - // Count of cores of this accelerator. - int64 core_count = 2; - } - // Definition of the types of hardware accelerators that can be used on this // instance. enum AcceleratorType { @@ -63,7 +79,7 @@ message Instance { // Accelerator type is Nvidia Tesla V100. NVIDIA_TESLA_V100 = 3; - // Accelerator type is Nvidia Tesla P_4. + // Accelerator type is Nvidia Tesla P4. NVIDIA_TESLA_P4 = 4; // Accelerator type is Nvidia Tesla T4. @@ -75,7 +91,7 @@ message Instance { // Accelerator type is NVIDIA Tesla P100 Virtual Workstations. NVIDIA_TESLA_P100_VWS = 9; - // Accelerator type is NVIDIA Tesla P_4 Virtual Workstations. + // Accelerator type is NVIDIA Tesla P4 Virtual Workstations. NVIDIA_TESLA_P4_VWS = 10; // (Coming soon) Accelerator type is TPU V2. @@ -85,6 +101,18 @@ message Instance { TPU_V3 = 7; } + // Definition of a hardware accelerator. Note that not all combinations + // of `type` and `core_count` are valid. Check [GPUs on + // Compute Engine](/compute/docs/gpus/#gpus-list) to find a valid + // combination. TPUs are not supported. + message AcceleratorConfig { + // Type of this accelerator. + AcceleratorType type = 1; + + // Count of cores of this accelerator. + int64 core_count = 2; + } + // The definition of the states of this instance. enum State { // State is not specified. @@ -117,6 +145,12 @@ message Instance { // The instance is getting registered. REGISTERING = 9; + + // The instance is suspending. + SUSPENDING = 10; + + // The instance is suspended. + SUSPENDED = 11; } // Possible disk types for notebook instances. @@ -146,6 +180,19 @@ message Instance { CMEK = 2; } + // The type of vNIC driver. + enum NicType { + // No type specified. Default should be UNSPECIFIED_NIC_TYPE. + UNSPECIFIED_NIC_TYPE = 0; + + // VIRTIO. Default in Notebooks DLVM. + VIRTIO_NET = 1; + + // GVNIC. Alternative to VIRTIO. + // https://github.com/GoogleCloudPlatform/compute-virtual-ethernet-linux + GVNIC = 2; + } + // Output only. The name of this notebook instance. Format: // `projects/{project_id}/locations/{location}/instances/{instance_id}` string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -161,21 +208,18 @@ message Instance { // Path to a Bash script that automatically runs after a notebook instance // fully boots up. The path must be a URL or - // Cloud Storage path (`gs://path-to-file/file-name`). + // Cloud Storage path (gs://path-to-file/file-name). string post_startup_script = 4; - // Output only. The proxy endpoint that is used to access the Jupyter - // notebook. + // Output only. The proxy endpoint that is used to access the Jupyter notebook. string proxy_uri = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Input only. The owner of this instance after creation. Format: - // `alias@example.com` + // Input only. The owner of this instance after creation. Format: `alias@example.com` // // Currently supports one owner only. If not specified, all of the service // account users of your VM instance's service account can use // the instance. - repeated string instance_owners = 6 - [(google.api.field_behavior) = INPUT_ONLY]; + repeated string instance_owners = 6 [(google.api.field_behavior) = INPUT_ONLY]; // The service account on this instance, giving access to other Google // Cloud services. @@ -187,15 +231,14 @@ message Instance { // is used. string service_account = 7; - // Required. The [Compute Engine machine - // type](https://cloud.google.com/compute/docs/machine-types) of this + // Required. The [Compute Engine machine type](/compute/docs/machine-types) of this // instance. string machine_type = 8 [(google.api.field_behavior) = REQUIRED]; // The hardware accelerator used on this instance. If you use // accelerators, make sure that your configuration has // [enough vCPUs and memory to support the `machine_type` you - // have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + // have selected](/compute/docs/gpus/#gpus-list). AcceleratorConfig accelerator_config = 9; // Output only. The state of this instance. @@ -211,40 +254,37 @@ message Instance { // If not specified, we'll automatically choose from official GPU drivers. string custom_gpu_driver_path = 12; - // Input only. The type of the boot disk attached to this instance, defaults - // to standard persistent disk (`PD_STANDARD`). + // Input only. The type of the boot disk attached to this instance, defaults to + // standard persistent disk (`PD_STANDARD`). DiskType boot_disk_type = 13 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. The size of the boot disk in GB attached to this instance, up - // to a maximum of 64000 GB (64 TB). The minimum recommended value - // is 100 GB. If not specified, this defaults to 100. + // Input only. The size of the boot disk in GB attached to this instance, up to a maximum + // of 64000 GB (64 TB). The minimum recommended value is + // 100 GB. If not specified, this defaults to 100. int64 boot_disk_size_gb = 14 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. The type of the data disk attached to this instance, defaults - // to standard persistent disk (`PD_STANDARD`). + // Input only. The type of the data disk attached to this instance, defaults to + // standard persistent disk (`PD_STANDARD`). DiskType data_disk_type = 25 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. The size of the data disk in GB attached to this instance, up - // to a maximum of 64000 GB (64 TB). You can choose the size of the - // data disk based on how big your notebooks and data are. If not specified, - // this defaults to 100. + // Input only. The size of the data disk in GB attached to this instance, up to a maximum + // of 64000 GB (64 TB). You can choose the size of the data disk + // based on how big your notebooks and data are. If not specified, this + // defaults to 100. int64 data_disk_size_gb = 26 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. If true, the data disk will not be auto deleted when deleting - // the instance. + // Input only. If true, the data disk will not be auto deleted when deleting the instance. bool no_remove_data_disk = 27 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. Disk encryption method used on the boot and data disks, - // defaults to GMEK. - DiskEncryption disk_encryption = 15 - [(google.api.field_behavior) = INPUT_ONLY]; + // Input only. Disk encryption method used on the boot and data disks, defaults to GMEK. + DiskEncryption disk_encryption = 15 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. The KMS key used to encrypt the disks, only applicable if - // disk_encryption is CMEK. Format: + // Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption + // is CMEK. + // Format: // `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}` // - // Learn more about [using your own encryption keys]( - // https://cloud.google.com/kms/docs/quickstart). + // Learn more about [using your own encryption keys](/kms/docs/quickstart). string kms_key = 16 [(google.api.field_behavior) = INPUT_ONLY]; // If true, no public IP will be assigned to this instance. @@ -270,11 +310,23 @@ message Instance { // Custom metadata to apply to this instance. map metadata = 22; + // Optional. The type of vNIC to be used on this interface. This may be gVNIC or + // VirtioNet. + NicType nic_type = 28 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The optional reservation affinity. Setting this field will apply + // the specified [Zonal Compute + // Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) + // to this notebook instance. + ReservationAffinity reservation_affinity = 29 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Flag to enable ip forwarding or not, default false/off. + // https://cloud.google.com/vpc/docs/using-routes#canipforward + bool can_ip_forward = 31 [(google.api.field_behavior) = OPTIONAL]; + // Output only. Instance creation time. - google.protobuf.Timestamp create_time = 23 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Instance update time. - google.protobuf.Timestamp update_time = 24 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/service.proto b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/service.proto index 06064336cc0d..4cfcca1c7480 100644 --- a/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/service.proto +++ b/java-notebooks/proto-google-cloud-notebooks-v1beta1/src/main/proto/google/cloud/notebooks/v1beta1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,26 +17,25 @@ syntax = "proto3"; package google.cloud.notebooks.v1beta1; import "google/api/annotations.proto"; +import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/cloud/notebooks/v1beta1/environment.proto"; import "google/cloud/notebooks/v1beta1/instance.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/client.proto"; option csharp_namespace = "Google.Cloud.Notebooks.V1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/notebooks/v1beta1;notebooks"; -option php_namespace = "Google\\Cloud\\Notebooks\\V1beta1"; -option ruby_package = "Google::Cloud::Notebooks::V1beta1"; option java_multiple_files = true; option java_outer_classname = "NotebooksProto"; option java_package = "com.google.cloud.notebooks.v1beta1"; +option php_namespace = "Google\\Cloud\\Notebooks\\V1beta1"; +option ruby_package = "Google::Cloud::Notebooks::V1beta1"; // API v1beta1 service for Cloud AI Platform Notebooks. service NotebookService { option (google.api.default_host) = "notebooks.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Lists instances in a given project and location. rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { @@ -53,8 +52,7 @@ service NotebookService { } // Creates a new Instance in a given project and location. - rpc CreateInstance(CreateInstanceRequest) - returns (google.longrunning.Operation) { + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*}/instances" body: "instance" @@ -69,8 +67,7 @@ service NotebookService { // Legacy instances are instances created with the legacy Compute Engine // calls. They are not manageable by the Notebooks API out of the box. This // call makes these instances manageable by the Notebooks API. - rpc RegisterInstance(RegisterInstanceRequest) - returns (google.longrunning.Operation) { + rpc RegisterInstance(RegisterInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*}/instances:register" body: "*" @@ -82,8 +79,7 @@ service NotebookService { } // Updates the guest accelerators of a single Instance. - rpc SetInstanceAccelerator(SetInstanceAcceleratorRequest) - returns (google.longrunning.Operation) { + rpc SetInstanceAccelerator(SetInstanceAcceleratorRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta1/{name=projects/*/locations/*/instances/*}:setAccelerator" body: "*" @@ -95,8 +91,7 @@ service NotebookService { } // Updates the machine type of a single Instance. - rpc SetInstanceMachineType(SetInstanceMachineTypeRequest) - returns (google.longrunning.Operation) { + rpc SetInstanceMachineType(SetInstanceMachineTypeRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta1/{name=projects/*/locations/*/instances/*}:setMachineType" body: "*" @@ -108,8 +103,7 @@ service NotebookService { } // Updates the labels of an Instance. - rpc SetInstanceLabels(SetInstanceLabelsRequest) - returns (google.longrunning.Operation) { + rpc SetInstanceLabels(SetInstanceLabelsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta1/{name=projects/*/locations/*/instances/*}:setLabels" body: "*" @@ -121,8 +115,7 @@ service NotebookService { } // Deletes a single Instance. - rpc DeleteInstance(DeleteInstanceRequest) - returns (google.longrunning.Operation) { + rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/locations/*/instances/*}" }; @@ -133,8 +126,7 @@ service NotebookService { } // Starts a notebook instance. - rpc StartInstance(StartInstanceRequest) - returns (google.longrunning.Operation) { + rpc StartInstance(StartInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:start" body: "*" @@ -158,8 +150,7 @@ service NotebookService { } // Resets a notebook instance. - rpc ResetInstance(ResetInstanceRequest) - returns (google.longrunning.Operation) { + rpc ResetInstance(ResetInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:reset" body: "*" @@ -174,8 +165,7 @@ service NotebookService { // report their latest instance information to the Notebooks // API server. The server will merge the reported information to // the instance metadata store. Do not use this method directly. - rpc ReportInstanceInfo(ReportInstanceInfoRequest) - returns (google.longrunning.Operation) { + rpc ReportInstanceInfo(ReportInstanceInfoRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:report" body: "*" @@ -187,16 +177,18 @@ service NotebookService { } // Check if a notebook instance is upgradable. - rpc IsInstanceUpgradeable(IsInstanceUpgradeableRequest) - returns (IsInstanceUpgradeableResponse) { + // Deprecated. Please consider using v1. + rpc IsInstanceUpgradeable(IsInstanceUpgradeableRequest) returns (IsInstanceUpgradeableResponse) { + option deprecated = true; option (google.api.http) = { get: "/v1beta1/{notebook_instance=projects/*/locations/*/instances/*}:isUpgradeable" }; } // Upgrades a notebook instance to the latest version. - rpc UpgradeInstance(UpgradeInstanceRequest) - returns (google.longrunning.Operation) { + // Deprecated. Please consider using v1. + rpc UpgradeInstance(UpgradeInstanceRequest) returns (google.longrunning.Operation) { + option deprecated = true; option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade" body: "*" @@ -209,8 +201,9 @@ service NotebookService { // Allows notebook instances to // call this endpoint to upgrade themselves. Do not use this method directly. - rpc UpgradeInstanceInternal(UpgradeInstanceInternalRequest) - returns (google.longrunning.Operation) { + // Deprecated. Please consider using v1. + rpc UpgradeInstanceInternal(UpgradeInstanceInternalRequest) returns (google.longrunning.Operation) { + option deprecated = true; option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgradeInternal" body: "*" @@ -222,8 +215,7 @@ service NotebookService { } // Lists environments in a project. - rpc ListEnvironments(ListEnvironmentsRequest) - returns (ListEnvironmentsResponse) { + rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) { option (google.api.http) = { get: "/v1beta1/{parent=projects/*/locations/*}/environments" }; @@ -237,8 +229,7 @@ service NotebookService { } // Creates a new Environment. - rpc CreateEnvironment(CreateEnvironmentRequest) - returns (google.longrunning.Operation) { + rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*}/environments" body: "environment" @@ -250,8 +241,7 @@ service NotebookService { } // Deletes a single Environment. - rpc DeleteEnvironment(DeleteEnvironmentRequest) - returns (google.longrunning.Operation) { + rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/locations/*/environments/*}" }; @@ -282,8 +272,7 @@ message OperationMetadata { // Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. bool requested_cancellation = 6; // API version used to start the operation. @@ -364,10 +353,10 @@ message SetInstanceAcceleratorRequest { // Required. Type of this accelerator. Instance.AcceleratorType type = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. Count of cores of this accelerator. Note that not all - // combinations of `type` and `core_count` are valid. Check [GPUs on Compute - // Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a - // valid combination. TPUs are not supported. + // Required. Count of cores of this accelerator. Note that not all combinations + // of `type` and `core_count` are valid. Check [GPUs on + // Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to + // find a valid combination. TPUs are not supported. int64 core_count = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -454,6 +443,11 @@ message IsInstanceUpgradeableResponse { // Additional information about upgrade. string upgrade_info = 3; + + // The new image self link this instance will be upgraded to if calling the + // upgrade endpoint. This field will only be populated if field upgradeable + // is true. + string upgrade_image = 4; } // Request for upgrading a notebook instance @@ -512,10 +506,10 @@ message CreateEnvironmentRequest { // Required. Format: `projects/{project_id}/locations/{location}` string parent = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. User-defined unique ID of this environment. The `environment_id` - // must be 1 to 63 characters long and contain only lowercase letters, numeric - // characters, and dashes. The first character must be a lowercase letter and - // the last character cannot be a dash. + // Required. User-defined unique ID of this environment. The `environment_id` must + // be 1 to 63 characters long and contain only lowercase letters, + // numeric characters, and dashes. The first character must be a lowercase + // letter and the last character cannot be a dash. string environment_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The environment to be created. diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/AsyncDiagnoseRuntime.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/AsyncDiagnoseRuntime.java new file mode 100644 index 000000000000..92cb8a92ec7c --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/AsyncDiagnoseRuntime.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest; +import com.google.cloud.notebooks.v1.DiagnosticConfig; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.longrunning.Operation; + +public class AsyncDiagnoseRuntime { + + public static void main(String[] args) throws Exception { + asyncDiagnoseRuntime(); + } + + public static void asyncDiagnoseRuntime() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + DiagnoseRuntimeRequest request = + DiagnoseRuntimeRequest.newBuilder() + .setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setDiagnosticConfig(DiagnosticConfig.newBuilder().build()) + .build(); + ApiFuture future = + managedNotebookServiceClient.diagnoseRuntimeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/AsyncDiagnoseRuntimeLRO.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/AsyncDiagnoseRuntimeLRO.java new file mode 100644 index 000000000000..b4117ac91b5e --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/AsyncDiagnoseRuntimeLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest; +import com.google.cloud.notebooks.v1.DiagnosticConfig; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.OperationMetadata; +import com.google.cloud.notebooks.v1.Runtime; +import com.google.cloud.notebooks.v1.RuntimeName; + +public class AsyncDiagnoseRuntimeLRO { + + public static void main(String[] args) throws Exception { + asyncDiagnoseRuntimeLRO(); + } + + public static void asyncDiagnoseRuntimeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + DiagnoseRuntimeRequest request = + DiagnoseRuntimeRequest.newBuilder() + .setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setDiagnosticConfig(DiagnosticConfig.newBuilder().build()) + .build(); + OperationFuture future = + managedNotebookServiceClient.diagnoseRuntimeOperationCallable().futureCall(request); + // Do something. + Runtime response = future.get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_LRO_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntime.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntime.java new file mode 100644 index 000000000000..48b0eca6e08f --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntime.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_sync] +import com.google.cloud.notebooks.v1.DiagnoseRuntimeRequest; +import com.google.cloud.notebooks.v1.DiagnosticConfig; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.Runtime; +import com.google.cloud.notebooks.v1.RuntimeName; + +public class SyncDiagnoseRuntime { + + public static void main(String[] args) throws Exception { + syncDiagnoseRuntime(); + } + + public static void syncDiagnoseRuntime() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + DiagnoseRuntimeRequest request = + DiagnoseRuntimeRequest.newBuilder() + .setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setDiagnosticConfig(DiagnosticConfig.newBuilder().build()) + .build(); + Runtime response = managedNotebookServiceClient.diagnoseRuntimeAsync(request).get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntimeRuntimenameDiagnosticconfig.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntimeRuntimenameDiagnosticconfig.java new file mode 100644 index 000000000000..282d95ab7ab2 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntimeRuntimenameDiagnosticconfig.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_RuntimenameDiagnosticconfig_sync] +import com.google.cloud.notebooks.v1.DiagnosticConfig; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.Runtime; +import com.google.cloud.notebooks.v1.RuntimeName; + +public class SyncDiagnoseRuntimeRuntimenameDiagnosticconfig { + + public static void main(String[] args) throws Exception { + syncDiagnoseRuntimeRuntimenameDiagnosticconfig(); + } + + public static void syncDiagnoseRuntimeRuntimenameDiagnosticconfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + RuntimeName name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]"); + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + Runtime response = + managedNotebookServiceClient.diagnoseRuntimeAsync(name, diagnosticConfig).get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_RuntimenameDiagnosticconfig_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntimeStringDiagnosticconfig.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntimeStringDiagnosticconfig.java new file mode 100644 index 000000000000..fdf2ca41e254 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/diagnoseruntime/SyncDiagnoseRuntimeStringDiagnosticconfig.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_StringDiagnosticconfig_sync] +import com.google.cloud.notebooks.v1.DiagnosticConfig; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.Runtime; +import com.google.cloud.notebooks.v1.RuntimeName; + +public class SyncDiagnoseRuntimeStringDiagnosticconfig { + + public static void main(String[] args) throws Exception { + syncDiagnoseRuntimeStringDiagnosticconfig(); + } + + public static void syncDiagnoseRuntimeStringDiagnosticconfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + String name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString(); + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + Runtime response = + managedNotebookServiceClient.diagnoseRuntimeAsync(name, diagnosticConfig).get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_StringDiagnosticconfig_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getiampolicy/AsyncGetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..a335232dee81 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = + managedNotebookServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_GetIamPolicy_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getiampolicy/SyncGetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..c650969e7f81 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_GetIamPolicy_sync] +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = managedNotebookServiceClient.getIamPolicy(request); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_GetIamPolicy_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getlocation/AsyncGetLocation.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..d33780115e03 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = + managedNotebookServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_GetLocation_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getlocation/SyncGetLocation.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..c56b280b9d0d --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/getlocation/SyncGetLocation.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = managedNotebookServiceClient.getLocation(request); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_GetLocation_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/AsyncListLocations.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..d4ba37161b8e --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/AsyncListLocations.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + managedNotebookServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_ListLocations_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/AsyncListLocationsPaged.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..573d8104c56f --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + managedNotebookServiceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_ListLocations_Paged_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/SyncListLocations.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..22ee55d26e73 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/listlocations/SyncListLocations.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : managedNotebookServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_ListLocations_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/setiampolicy/AsyncSetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..265ee689f442 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + managedNotebookServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_SetIamPolicy_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/setiampolicy/SyncSetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..8534a5421b51 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_SetIamPolicy_sync] +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = managedNotebookServiceClient.setIamPolicy(request); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_SetIamPolicy_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/testiampermissions/AsyncTestIamPermissions.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..39b05b18cc16 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + managedNotebookServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_TestIamPermissions_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/testiampermissions/SyncTestIamPermissions.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..bedd66ecacc1 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_TestIamPermissions_sync] +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = + managedNotebookServiceClient.testIamPermissions(request); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_TestIamPermissions_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/AsyncUpdateRuntime.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/AsyncUpdateRuntime.java new file mode 100644 index 000000000000..6e2e294a1ed5 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/AsyncUpdateRuntime.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_UpdateRuntime_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.Runtime; +import com.google.cloud.notebooks.v1.UpdateRuntimeRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateRuntime { + + public static void main(String[] args) throws Exception { + asyncUpdateRuntime(); + } + + public static void asyncUpdateRuntime() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + UpdateRuntimeRequest request = + UpdateRuntimeRequest.newBuilder() + .setRuntime(Runtime.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + managedNotebookServiceClient.updateRuntimeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_UpdateRuntime_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/AsyncUpdateRuntimeLRO.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/AsyncUpdateRuntimeLRO.java new file mode 100644 index 000000000000..76975c016856 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/AsyncUpdateRuntimeLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_UpdateRuntime_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.OperationMetadata; +import com.google.cloud.notebooks.v1.Runtime; +import com.google.cloud.notebooks.v1.UpdateRuntimeRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateRuntimeLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateRuntimeLRO(); + } + + public static void asyncUpdateRuntimeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + UpdateRuntimeRequest request = + UpdateRuntimeRequest.newBuilder() + .setRuntime(Runtime.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + managedNotebookServiceClient.updateRuntimeOperationCallable().futureCall(request); + // Do something. + Runtime response = future.get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_UpdateRuntime_LRO_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/SyncUpdateRuntime.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/SyncUpdateRuntime.java new file mode 100644 index 000000000000..2e652fc964b7 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/SyncUpdateRuntime.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_UpdateRuntime_sync] +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.Runtime; +import com.google.cloud.notebooks.v1.UpdateRuntimeRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateRuntime { + + public static void main(String[] args) throws Exception { + syncUpdateRuntime(); + } + + public static void syncUpdateRuntime() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + UpdateRuntimeRequest request = + UpdateRuntimeRequest.newBuilder() + .setRuntime(Runtime.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Runtime response = managedNotebookServiceClient.updateRuntimeAsync(request).get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_UpdateRuntime_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/SyncUpdateRuntimeRuntimeFieldmask.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/SyncUpdateRuntimeRuntimeFieldmask.java new file mode 100644 index 000000000000..53e16e47d6e9 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/updateruntime/SyncUpdateRuntimeRuntimeFieldmask.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_UpdateRuntime_RuntimeFieldmask_sync] +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.Runtime; +import com.google.protobuf.FieldMask; + +public class SyncUpdateRuntimeRuntimeFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateRuntimeRuntimeFieldmask(); + } + + public static void syncUpdateRuntimeRuntimeFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + Runtime runtime = Runtime.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Runtime response = managedNotebookServiceClient.updateRuntimeAsync(runtime, updateMask).get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_UpdateRuntime_RuntimeFieldmask_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/AsyncUpgradeRuntime.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/AsyncUpgradeRuntime.java new file mode 100644 index 000000000000..22a9ce9b68e4 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/AsyncUpgradeRuntime.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_UpgradeRuntime_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.UpgradeRuntimeRequest; +import com.google.longrunning.Operation; + +public class AsyncUpgradeRuntime { + + public static void main(String[] args) throws Exception { + asyncUpgradeRuntime(); + } + + public static void asyncUpgradeRuntime() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + UpgradeRuntimeRequest request = + UpgradeRuntimeRequest.newBuilder() + .setName("name3373707") + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + managedNotebookServiceClient.upgradeRuntimeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_UpgradeRuntime_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/AsyncUpgradeRuntimeLRO.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/AsyncUpgradeRuntimeLRO.java new file mode 100644 index 000000000000..6b4c167cf8cb --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/AsyncUpgradeRuntimeLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_UpgradeRuntime_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.OperationMetadata; +import com.google.cloud.notebooks.v1.Runtime; +import com.google.cloud.notebooks.v1.UpgradeRuntimeRequest; + +public class AsyncUpgradeRuntimeLRO { + + public static void main(String[] args) throws Exception { + asyncUpgradeRuntimeLRO(); + } + + public static void asyncUpgradeRuntimeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + UpgradeRuntimeRequest request = + UpgradeRuntimeRequest.newBuilder() + .setName("name3373707") + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + managedNotebookServiceClient.upgradeRuntimeOperationCallable().futureCall(request); + // Do something. + Runtime response = future.get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_UpgradeRuntime_LRO_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/SyncUpgradeRuntime.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/SyncUpgradeRuntime.java new file mode 100644 index 000000000000..1442d56e8d42 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/SyncUpgradeRuntime.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_UpgradeRuntime_sync] +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.Runtime; +import com.google.cloud.notebooks.v1.UpgradeRuntimeRequest; + +public class SyncUpgradeRuntime { + + public static void main(String[] args) throws Exception { + syncUpgradeRuntime(); + } + + public static void syncUpgradeRuntime() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + UpgradeRuntimeRequest request = + UpgradeRuntimeRequest.newBuilder() + .setName("name3373707") + .setRequestId("requestId693933066") + .build(); + Runtime response = managedNotebookServiceClient.upgradeRuntimeAsync(request).get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_UpgradeRuntime_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/SyncUpgradeRuntimeString.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/SyncUpgradeRuntimeString.java new file mode 100644 index 000000000000..67bbdc3dd582 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/managednotebookservice/upgraderuntime/SyncUpgradeRuntimeString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_ManagedNotebookService_UpgradeRuntime_String_sync] +import com.google.cloud.notebooks.v1.ManagedNotebookServiceClient; +import com.google.cloud.notebooks.v1.Runtime; + +public class SyncUpgradeRuntimeString { + + public static void main(String[] args) throws Exception { + syncUpgradeRuntimeString(); + } + + public static void syncUpgradeRuntimeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ManagedNotebookServiceClient managedNotebookServiceClient = + ManagedNotebookServiceClient.create()) { + String name = "name3373707"; + Runtime response = managedNotebookServiceClient.upgradeRuntimeAsync(name).get(); + } + } +} +// [END notebooks_v1_generated_ManagedNotebookService_UpgradeRuntime_String_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/AsyncDiagnoseInstance.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/AsyncDiagnoseInstance.java new file mode 100644 index 000000000000..72a4c4c2f865 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/AsyncDiagnoseInstance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_DiagnoseInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1.DiagnoseInstanceRequest; +import com.google.cloud.notebooks.v1.DiagnosticConfig; +import com.google.cloud.notebooks.v1.InstanceName; +import com.google.cloud.notebooks.v1.NotebookServiceClient; +import com.google.longrunning.Operation; + +public class AsyncDiagnoseInstance { + + public static void main(String[] args) throws Exception { + asyncDiagnoseInstance(); + } + + public static void asyncDiagnoseInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + DiagnoseInstanceRequest request = + DiagnoseInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setDiagnosticConfig(DiagnosticConfig.newBuilder().build()) + .build(); + ApiFuture future = + notebookServiceClient.diagnoseInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END notebooks_v1_generated_NotebookService_DiagnoseInstance_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/AsyncDiagnoseInstanceLRO.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/AsyncDiagnoseInstanceLRO.java new file mode 100644 index 000000000000..e77646139906 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/AsyncDiagnoseInstanceLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_DiagnoseInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.notebooks.v1.DiagnoseInstanceRequest; +import com.google.cloud.notebooks.v1.DiagnosticConfig; +import com.google.cloud.notebooks.v1.Instance; +import com.google.cloud.notebooks.v1.InstanceName; +import com.google.cloud.notebooks.v1.NotebookServiceClient; +import com.google.cloud.notebooks.v1.OperationMetadata; + +public class AsyncDiagnoseInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncDiagnoseInstanceLRO(); + } + + public static void asyncDiagnoseInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + DiagnoseInstanceRequest request = + DiagnoseInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setDiagnosticConfig(DiagnosticConfig.newBuilder().build()) + .build(); + OperationFuture future = + notebookServiceClient.diagnoseInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END notebooks_v1_generated_NotebookService_DiagnoseInstance_LRO_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstance.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstance.java new file mode 100644 index 000000000000..e226431b3d4a --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstance.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_DiagnoseInstance_sync] +import com.google.cloud.notebooks.v1.DiagnoseInstanceRequest; +import com.google.cloud.notebooks.v1.DiagnosticConfig; +import com.google.cloud.notebooks.v1.Instance; +import com.google.cloud.notebooks.v1.InstanceName; +import com.google.cloud.notebooks.v1.NotebookServiceClient; + +public class SyncDiagnoseInstance { + + public static void main(String[] args) throws Exception { + syncDiagnoseInstance(); + } + + public static void syncDiagnoseInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + DiagnoseInstanceRequest request = + DiagnoseInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setDiagnosticConfig(DiagnosticConfig.newBuilder().build()) + .build(); + Instance response = notebookServiceClient.diagnoseInstanceAsync(request).get(); + } + } +} +// [END notebooks_v1_generated_NotebookService_DiagnoseInstance_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstanceInstancenameDiagnosticconfig.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstanceInstancenameDiagnosticconfig.java new file mode 100644 index 000000000000..b7580b9d9fab --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstanceInstancenameDiagnosticconfig.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_DiagnoseInstance_InstancenameDiagnosticconfig_sync] +import com.google.cloud.notebooks.v1.DiagnosticConfig; +import com.google.cloud.notebooks.v1.Instance; +import com.google.cloud.notebooks.v1.InstanceName; +import com.google.cloud.notebooks.v1.NotebookServiceClient; + +public class SyncDiagnoseInstanceInstancenameDiagnosticconfig { + + public static void main(String[] args) throws Exception { + syncDiagnoseInstanceInstancenameDiagnosticconfig(); + } + + public static void syncDiagnoseInstanceInstancenameDiagnosticconfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + Instance response = notebookServiceClient.diagnoseInstanceAsync(name, diagnosticConfig).get(); + } + } +} +// [END notebooks_v1_generated_NotebookService_DiagnoseInstance_InstancenameDiagnosticconfig_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstanceStringDiagnosticconfig.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstanceStringDiagnosticconfig.java new file mode 100644 index 000000000000..ec8c7348e94d --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/diagnoseinstance/SyncDiagnoseInstanceStringDiagnosticconfig.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_DiagnoseInstance_StringDiagnosticconfig_sync] +import com.google.cloud.notebooks.v1.DiagnosticConfig; +import com.google.cloud.notebooks.v1.Instance; +import com.google.cloud.notebooks.v1.InstanceName; +import com.google.cloud.notebooks.v1.NotebookServiceClient; + +public class SyncDiagnoseInstanceStringDiagnosticconfig { + + public static void main(String[] args) throws Exception { + syncDiagnoseInstanceStringDiagnosticconfig(); + } + + public static void syncDiagnoseInstanceStringDiagnosticconfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); + DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); + Instance response = notebookServiceClient.diagnoseInstanceAsync(name, diagnosticConfig).get(); + } + } +} +// [END notebooks_v1_generated_NotebookService_DiagnoseInstance_StringDiagnosticconfig_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getiampolicy/AsyncGetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..80937b9e78c9 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1.NotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = notebookServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END notebooks_v1_generated_NotebookService_GetIamPolicy_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getiampolicy/SyncGetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..20d20021f731 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_GetIamPolicy_sync] +import com.google.cloud.notebooks.v1.NotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = notebookServiceClient.getIamPolicy(request); + } + } +} +// [END notebooks_v1_generated_NotebookService_GetIamPolicy_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getlocation/AsyncGetLocation.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..a864a9b2fecd --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1.NotebookServiceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = notebookServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END notebooks_v1_generated_NotebookService_GetLocation_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getlocation/SyncGetLocation.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..886189230caf --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1.NotebookServiceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = notebookServiceClient.getLocation(request); + } + } +} +// [END notebooks_v1_generated_NotebookService_GetLocation_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/AsyncListLocations.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..d0ec76d3e230 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1.NotebookServiceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + notebookServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END notebooks_v1_generated_NotebookService_ListLocations_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/AsyncListLocationsPaged.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..ad69e0c5692c --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1.NotebookServiceClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + notebookServiceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END notebooks_v1_generated_NotebookService_ListLocations_Paged_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/SyncListLocations.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..44526c7db0d2 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1.NotebookServiceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : notebookServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END notebooks_v1_generated_NotebookService_ListLocations_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/setiampolicy/AsyncSetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..fc1cddd63f0a --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1.NotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = notebookServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END notebooks_v1_generated_NotebookService_SetIamPolicy_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/setiampolicy/SyncSetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..f8538486dd8f --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_SetIamPolicy_sync] +import com.google.cloud.notebooks.v1.NotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = notebookServiceClient.setIamPolicy(request); + } + } +} +// [END notebooks_v1_generated_NotebookService_SetIamPolicy_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/testiampermissions/AsyncTestIamPermissions.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..5bab072e444b --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1.NotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + notebookServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END notebooks_v1_generated_NotebookService_TestIamPermissions_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/testiampermissions/SyncTestIamPermissions.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..3d59772d371f --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1.samples; + +// [START notebooks_v1_generated_NotebookService_TestIamPermissions_sync] +import com.google.cloud.notebooks.v1.NotebookServiceClient; +import com.google.cloud.notebooks.v1.RuntimeName; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = notebookServiceClient.testIamPermissions(request); + } + } +} +// [END notebooks_v1_generated_NotebookService_TestIamPermissions_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getiampolicy/AsyncGetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..f4162c897099 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1.samples; + +// [START notebooks_v1beta1_generated_NotebookService_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1beta1.NotebookServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource("GetIamPolicyRequest-1527610370".toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = notebookServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END notebooks_v1beta1_generated_NotebookService_GetIamPolicy_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getiampolicy/SyncGetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..e830eab92f87 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1.samples; + +// [START notebooks_v1beta1_generated_NotebookService_GetIamPolicy_sync] +import com.google.cloud.notebooks.v1beta1.NotebookServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource("GetIamPolicyRequest-1527610370".toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = notebookServiceClient.getIamPolicy(request); + } + } +} +// [END notebooks_v1beta1_generated_NotebookService_GetIamPolicy_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getlocation/AsyncGetLocation.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..e59b3bfb776a --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1.samples; + +// [START notebooks_v1beta1_generated_NotebookService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1beta1.NotebookServiceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = notebookServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END notebooks_v1beta1_generated_NotebookService_GetLocation_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getlocation/SyncGetLocation.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..e8e5c23925d2 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1.samples; + +// [START notebooks_v1beta1_generated_NotebookService_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1beta1.NotebookServiceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = notebookServiceClient.getLocation(request); + } + } +} +// [END notebooks_v1beta1_generated_NotebookService_GetLocation_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/AsyncListLocations.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..4883e9fa9f6a --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1.samples; + +// [START notebooks_v1beta1_generated_NotebookService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1beta1.NotebookServiceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + notebookServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END notebooks_v1beta1_generated_NotebookService_ListLocations_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/AsyncListLocationsPaged.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..676cd8578393 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1.samples; + +// [START notebooks_v1beta1_generated_NotebookService_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1beta1.NotebookServiceClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + notebookServiceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END notebooks_v1beta1_generated_NotebookService_ListLocations_Paged_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/SyncListLocations.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..8be53d365857 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1.samples; + +// [START notebooks_v1beta1_generated_NotebookService_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.notebooks.v1beta1.NotebookServiceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : notebookServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END notebooks_v1beta1_generated_NotebookService_ListLocations_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/setiampolicy/AsyncSetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..59fc57674dfc --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1.samples; + +// [START notebooks_v1beta1_generated_NotebookService_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1beta1.NotebookServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource("SetIamPolicyRequest1223629066".toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = notebookServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END notebooks_v1beta1_generated_NotebookService_SetIamPolicy_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/setiampolicy/SyncSetIamPolicy.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..89bde4f4352e --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1.samples; + +// [START notebooks_v1beta1_generated_NotebookService_SetIamPolicy_sync] +import com.google.cloud.notebooks.v1beta1.NotebookServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource("SetIamPolicyRequest1223629066".toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = notebookServiceClient.setIamPolicy(request); + } + } +} +// [END notebooks_v1beta1_generated_NotebookService_SetIamPolicy_sync] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/testiampermissions/AsyncTestIamPermissions.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..ddb9fc4962c1 --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1.samples; + +// [START notebooks_v1beta1_generated_NotebookService_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.notebooks.v1beta1.NotebookServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource("TestIamPermissionsRequest942398222".toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + notebookServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END notebooks_v1beta1_generated_NotebookService_TestIamPermissions_async] diff --git a/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/testiampermissions/SyncTestIamPermissions.java b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..1312dc28913b --- /dev/null +++ b/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1beta1/notebookservice/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.notebooks.v1beta1.samples; + +// [START notebooks_v1beta1_generated_NotebookService_TestIamPermissions_sync] +import com.google.cloud.notebooks.v1beta1.NotebookServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource("TestIamPermissionsRequest942398222".toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = notebookServiceClient.testIamPermissions(request); + } + } +} +// [END notebooks_v1beta1_generated_NotebookService_TestIamPermissions_sync]