From 2bbae993719c74f226a72dde09548e91c4f0287e Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Thu, 16 Apr 2026 21:30:30 -0400 Subject: [PATCH 1/4] fix(java-os-login): fix copy rules to allow generated v1beta --- java-os-login/.OwlBot-hermetic.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java-os-login/.OwlBot-hermetic.yaml b/java-os-login/.OwlBot-hermetic.yaml index aab0a7cbc0b7..14c0c9ce1a6e 100644 --- a/java-os-login/.OwlBot-hermetic.yaml +++ b/java-os-login/.OwlBot-hermetic.yaml @@ -30,11 +30,11 @@ deep-preserve-regex: - "/.*proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/SshPublicKeyName.java" deep-copy-regex: -- source: "/google/cloud/oslogin/(v\\d)/.*-java/proto-google-.*/src" +- source: "/google/cloud/oslogin/(v.*)/.*-java/proto-google-.*/src" dest: "/owl-bot-staging/java-os-login/$1/proto-google-cloud-os-login-$1/src" -- source: "/google/cloud/oslogin/(v\\d)/.*-java/grpc-google-.*/src" +- source: "/google/cloud/oslogin/(v.*)/.*-java/grpc-google-.*/src" dest: "/owl-bot-staging/java-os-login/$1/grpc-google-cloud-os-login-$1/src" -- source: "/google/cloud/oslogin/(v\\d)/.*-java/gapic-google-.*/src" +- source: "/google/cloud/oslogin/(v.*)/.*-java/gapic-google-.*/src" dest: "/owl-bot-staging/java-os-login/$1/google-cloud-os-login/src" - source: "/google/cloud/oslogin/(v.*)/.*-java/samples/snippets/generated" dest: "/owl-bot-staging/java-os-login/$1/samples/snippets/generated" From 13b4b6ad19133b3d02eca49fdd61d299e4a2cf62 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Fri, 17 Apr 2026 10:30:38 -0400 Subject: [PATCH 2/4] temp: attempt to force generation to run for oslogin --- .../.github/scripts/hermetic_library_generation.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sdk-platform-java/.github/scripts/hermetic_library_generation.sh b/sdk-platform-java/.github/scripts/hermetic_library_generation.sh index fc991aa3e94d..534df6ab1795 100755 --- a/sdk-platform-java/.github/scripts/hermetic_library_generation.sh +++ b/sdk-platform-java/.github/scripts/hermetic_library_generation.sh @@ -120,6 +120,14 @@ python hermetic_build/common/cli/get_changed_libraries.py create \ --current-generation-config-path="${generation_config}"\ --force-regenerate-all="${force_regenerate_all}" | tee "${changed_libraries_file}" changed_libraries="$(cat "${changed_libraries_file}")" +# Force run for os-login +if [[ -z "${changed_libraries}" ]]; then + changed_libraries="os-login" +else + if [[ ! "${changed_libraries}" =~ "os-login" ]]; then + changed_libraries="os-login,${changed_libraries}" + fi +fi echo "Changed libraries are: ${changed_libraries:-"No changed library"}." # run hermetic code generation docker image. From d626b56a9f96845a6ffd0fcd146809bbe93beaea Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Fri, 17 Apr 2026 14:35:32 +0000 Subject: [PATCH 3/4] chore: generate libraries at Fri Apr 17 14:33:42 UTC 2026 --- .../google-cloud-os-login-bom/pom.xml | 10 + java-os-login/google-cloud-os-login/pom.xml | 9 + .../oslogin/v1beta/OsLoginServiceClient.java | 1469 +++++++ .../v1beta/OsLoginServiceSettings.java | 301 ++ .../cloud/oslogin/v1beta/gapic_metadata.json | 42 + .../cloud/oslogin/v1beta/package-info.java | 48 + .../GrpcOsLoginServiceCallableFactory.java | 115 + .../v1beta/stub/GrpcOsLoginServiceStub.java | 423 ++ ...HttpJsonOsLoginServiceCallableFactory.java | 103 + .../stub/HttpJsonOsLoginServiceStub.java | 648 +++ .../v1beta/stub/OsLoginServiceStub.java | 86 + .../stub/OsLoginServiceStubSettings.java | 557 +++ .../reflect-config.json | 1631 +++++++ .../oslogin/v1beta/MockOsLoginService.java | 59 + .../v1beta/MockOsLoginServiceImpl.java | 233 + .../OsLoginServiceClientHttpJsonTest.java | 969 ++++ .../v1beta/OsLoginServiceClientTest.java | 874 ++++ .../grpc-google-cloud-os-login-v1beta/pom.xml | 45 + .../oslogin/v1beta/OsLoginServiceGrpc.java | 1392 ++++++ java-os-login/pom.xml | 12 + .../clirr-ignored-differences.xml | 80 + .../pom.xml | 37 + .../cloud/oslogin/common/OsLoginProto.java | 3904 +++++++++++++++++ .../oslogin/common/PosixAccountName.java | 191 + .../oslogin/common/SshPublicKeyName.java | 192 + .../google/cloud/oslogin/common/UserName.java | 166 + .../v1beta/CreateSshPublicKeyRequest.java | 935 ++++ .../CreateSshPublicKeyRequestOrBuilder.java | 101 + .../v1beta/DeletePosixAccountRequest.java | 625 +++ .../DeletePosixAccountRequestOrBuilder.java | 62 + .../v1beta/DeleteSshPublicKeyRequest.java | 625 +++ .../DeleteSshPublicKeyRequestOrBuilder.java | 62 + .../v1beta/GetLoginProfileRequest.java | 1150 +++++ .../GetLoginProfileRequestOrBuilder.java | 136 + .../v1beta/GetSshPublicKeyRequest.java | 625 +++ .../GetSshPublicKeyRequestOrBuilder.java | 62 + .../v1beta/ImportSshPublicKeyRequest.java | 1587 +++++++ .../ImportSshPublicKeyRequestOrBuilder.java | 211 + .../v1beta/ImportSshPublicKeyResponse.java | 891 ++++ .../ImportSshPublicKeyResponseOrBuilder.java | 91 + .../cloud/oslogin/v1beta/LoginProfile.java | 2113 +++++++++ .../oslogin/v1beta/LoginProfileOrBuilder.java | 233 + .../oslogin/v1beta/LoginProfileView.java | 191 + .../cloud/oslogin/v1beta/OsLoginProto.java | 384 ++ .../cloud/oslogin/v1beta/SecurityKey.java | 1721 ++++++++ .../oslogin/v1beta/SecurityKeyOrBuilder.java | 197 + .../v1beta/SignSshPublicKeyRequest.java | 770 ++++ .../SignSshPublicKeyRequestOrBuilder.java | 80 + .../v1beta/SignSshPublicKeyResponse.java | 581 +++ .../SignSshPublicKeyResponseOrBuilder.java | 54 + .../oslogin/v1beta/UniversalTwoFactor.java | 596 +++ .../v1beta/UniversalTwoFactorOrBuilder.java | 54 + .../v1beta/UpdateSshPublicKeyRequest.java | 1226 ++++++ .../UpdateSshPublicKeyRequestOrBuilder.java | 142 + .../google/cloud/oslogin/v1beta/WebAuthn.java | 594 +++ .../oslogin/v1beta/WebAuthnOrBuilder.java | 54 + .../google/cloud/oslogin/common/common.proto | 107 + .../google/cloud/oslogin/v1beta/oslogin.proto | 330 ++ versions.txt | 2 + 59 files changed, 30188 insertions(+) create mode 100644 java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClient.java create mode 100644 java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceSettings.java create mode 100644 java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/gapic_metadata.json create mode 100644 java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/package-info.java create mode 100644 java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/GrpcOsLoginServiceCallableFactory.java create mode 100644 java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/GrpcOsLoginServiceStub.java create mode 100644 java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/HttpJsonOsLoginServiceCallableFactory.java create mode 100644 java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/HttpJsonOsLoginServiceStub.java create mode 100644 java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/OsLoginServiceStub.java create mode 100644 java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/OsLoginServiceStubSettings.java create mode 100644 java-os-login/google-cloud-os-login/src/main/resources/META-INF/native-image/com.google.cloud.oslogin.v1beta/reflect-config.json create mode 100644 java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/MockOsLoginService.java create mode 100644 java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/MockOsLoginServiceImpl.java create mode 100644 java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClientHttpJsonTest.java create mode 100644 java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClientTest.java create mode 100644 java-os-login/grpc-google-cloud-os-login-v1beta/pom.xml create mode 100644 java-os-login/grpc-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceGrpc.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/clirr-ignored-differences.xml create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/pom.xml create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/OsLoginProto.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/PosixAccountName.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/SshPublicKeyName.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/UserName.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/CreateSshPublicKeyRequest.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/CreateSshPublicKeyRequestOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeletePosixAccountRequest.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeletePosixAccountRequestOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeleteSshPublicKeyRequest.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeleteSshPublicKeyRequestOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetLoginProfileRequest.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetLoginProfileRequestOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetSshPublicKeyRequest.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetSshPublicKeyRequestOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyRequest.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyRequestOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyResponse.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyResponseOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfile.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfileOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfileView.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginProto.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SecurityKey.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SecurityKeyOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyRequest.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyRequestOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyResponse.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyResponseOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UniversalTwoFactor.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UniversalTwoFactorOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UpdateSshPublicKeyRequest.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UpdateSshPublicKeyRequestOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/WebAuthn.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/WebAuthnOrBuilder.java create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/proto/google/cloud/oslogin/common/common.proto create mode 100644 java-os-login/proto-google-cloud-os-login-v1beta/src/main/proto/google/cloud/oslogin/v1beta/oslogin.proto diff --git a/java-os-login/google-cloud-os-login-bom/pom.xml b/java-os-login/google-cloud-os-login-bom/pom.xml index f0fca2f0963e..cff1ffce4af1 100644 --- a/java-os-login/google-cloud-os-login-bom/pom.xml +++ b/java-os-login/google-cloud-os-login-bom/pom.xml @@ -30,11 +30,21 @@ grpc-google-cloud-os-login-v1 2.90.0 + + com.google.api.grpc + grpc-google-cloud-os-login-v1beta + 2.90.0 + com.google.api.grpc proto-google-cloud-os-login-v1 2.90.0 + + com.google.api.grpc + proto-google-cloud-os-login-v1beta + 2.90.0 + diff --git a/java-os-login/google-cloud-os-login/pom.xml b/java-os-login/google-cloud-os-login/pom.xml index 96c585c8a4a5..8b962a5fd174 100644 --- a/java-os-login/google-cloud-os-login/pom.xml +++ b/java-os-login/google-cloud-os-login/pom.xml @@ -41,6 +41,10 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-os-login-v1beta + com.google.api.grpc proto-google-cloud-os-login-v1 @@ -93,6 +97,11 @@ grpc-google-cloud-os-login-v1 test + + com.google.api.grpc + grpc-google-cloud-os-login-v1beta + test + com.google.api diff --git a/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClient.java b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClient.java new file mode 100644 index 000000000000..795d63f137da --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClient.java @@ -0,0 +1,1469 @@ +/* + * Copyright 2026 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.oslogin.v1beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.oslogin.common.OsLoginProto; +import com.google.cloud.oslogin.v1.FingerprintName; +import com.google.cloud.oslogin.v1.ProjectName; +import com.google.cloud.oslogin.v1.UserName; +import com.google.cloud.oslogin.v1beta.stub.OsLoginServiceStub; +import com.google.cloud.oslogin.v1beta.stub.OsLoginServiceStubSettings; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Cloud OS Login API + * + *

The Cloud OS Login API allows you to manage users and their associated SSH public keys for + * logging into virtual machines on Google Cloud Platform. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+ *   UserName parent = UserName.of("[USER]");
+ *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+ *   OsLoginProto.SshPublicKey response =
+ *       osLoginServiceClient.createSshPublicKey(parent, sshPublicKey);
+ * }
+ * }
+ * + *

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

CreateSshPublicKey

Create an SSH public key

+ *

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

+ *
    + *
  • createSshPublicKey(CreateSshPublicKeyRequest request) + *

+ *

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

+ *
    + *
  • createSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey) + *

  • createSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey) + *

+ *

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

+ *
    + *
  • createSshPublicKeyCallable() + *

+ *

DeletePosixAccount

Deletes a POSIX account.

+ *

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

+ *
    + *
  • deletePosixAccount(DeletePosixAccountRequest request) + *

+ *

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

+ *
    + *
  • deletePosixAccount(ProjectName name) + *

  • deletePosixAccount(String name) + *

+ *

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

+ *
    + *
  • deletePosixAccountCallable() + *

+ *

DeleteSshPublicKey

Deletes an SSH public key.

+ *

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

+ *
    + *
  • deleteSshPublicKey(DeleteSshPublicKeyRequest request) + *

+ *

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

+ *
    + *
  • deleteSshPublicKey(FingerprintName name) + *

  • deleteSshPublicKey(String name) + *

+ *

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

+ *
    + *
  • deleteSshPublicKeyCallable() + *

+ *

GetLoginProfile

Retrieves the profile information used for logging in to a virtual machine on Google Compute Engine.

+ *

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

+ *
    + *
  • getLoginProfile(GetLoginProfileRequest request) + *

+ *

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

+ *
    + *
  • getLoginProfile(UserName name) + *

  • getLoginProfile(String name) + *

+ *

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

+ *
    + *
  • getLoginProfileCallable() + *

+ *

GetSshPublicKey

Retrieves an SSH public key.

+ *

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

+ *
    + *
  • getSshPublicKey(GetSshPublicKeyRequest request) + *

+ *

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

+ *
    + *
  • getSshPublicKey(FingerprintName name) + *

  • getSshPublicKey(String name) + *

+ *

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

+ *
    + *
  • getSshPublicKeyCallable() + *

+ *

ImportSshPublicKey

Adds an SSH public key and returns the profile information. Default POSIX account information is set when no username and UID exist as part of the login profile.

+ *

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

+ *
    + *
  • importSshPublicKey(ImportSshPublicKeyRequest request) + *

+ *

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

+ *
    + *
  • importSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey) + *

  • importSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey) + *

  • importSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey, String projectId) + *

  • importSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey, String projectId) + *

+ *

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

+ *
    + *
  • importSshPublicKeyCallable() + *

+ *

UpdateSshPublicKey

Updates an SSH public key and returns the profile information. This method supports patch semantics.

+ *

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

+ *
    + *
  • updateSshPublicKey(UpdateSshPublicKeyRequest request) + *

+ *

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

+ *
    + *
  • updateSshPublicKey(FingerprintName name, OsLoginProto.SshPublicKey sshPublicKey) + *

  • updateSshPublicKey(String name, OsLoginProto.SshPublicKey sshPublicKey) + *

  • updateSshPublicKey(FingerprintName name, OsLoginProto.SshPublicKey sshPublicKey, FieldMask updateMask) + *

  • updateSshPublicKey(String name, OsLoginProto.SshPublicKey sshPublicKey, FieldMask updateMask) + *

+ *

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

+ *
    + *
  • updateSshPublicKeyCallable() + *

+ *

SignSshPublicKey

Signs an SSH public key for a user to authenticate to an instance.

+ *

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

+ *
    + *
  • signSshPublicKey(SignSshPublicKeyRequest request) + *

+ *

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

+ *
    + *
  • signSshPublicKey(String parent, String sshPublicKey) + *

+ *

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

+ *
    + *
  • signSshPublicKeyCallable() + *

+ *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of OsLoginServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * OsLoginServiceSettings osLoginServiceSettings =
+ *     OsLoginServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create(osLoginServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * OsLoginServiceSettings osLoginServiceSettings =
+ *     OsLoginServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create(osLoginServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * OsLoginServiceSettings osLoginServiceSettings =
+ *     OsLoginServiceSettings.newHttpJsonBuilder().build();
+ * OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create(osLoginServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class OsLoginServiceClient implements BackgroundResource { + private final OsLoginServiceSettings settings; + private final OsLoginServiceStub stub; + + /** Constructs an instance of OsLoginServiceClient with default settings. */ + public static final OsLoginServiceClient create() throws IOException { + return create(OsLoginServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of OsLoginServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final OsLoginServiceClient create(OsLoginServiceSettings settings) + throws IOException { + return new OsLoginServiceClient(settings); + } + + /** + * Constructs an instance of OsLoginServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(OsLoginServiceSettings). + */ + public static final OsLoginServiceClient create(OsLoginServiceStub stub) { + return new OsLoginServiceClient(stub); + } + + /** + * Constructs an instance of OsLoginServiceClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected OsLoginServiceClient(OsLoginServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((OsLoginServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected OsLoginServiceClient(OsLoginServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final OsLoginServiceSettings getSettings() { + return settings; + } + + public OsLoginServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an SSH public key + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   UserName parent = UserName.of("[USER]");
+   *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+   *   OsLoginProto.SshPublicKey response =
+   *       osLoginServiceClient.createSshPublicKey(parent, sshPublicKey);
+   * }
+   * }
+ * + * @param parent Required. The unique ID for the user in format `users/{user}`. + * @param sshPublicKey Required. The SSH public key and expiration time. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OsLoginProto.SshPublicKey createSshPublicKey( + UserName parent, OsLoginProto.SshPublicKey sshPublicKey) { + CreateSshPublicKeyRequest request = + CreateSshPublicKeyRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSshPublicKey(sshPublicKey) + .build(); + return createSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an SSH public key + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   String parent = UserName.of("[USER]").toString();
+   *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+   *   OsLoginProto.SshPublicKey response =
+   *       osLoginServiceClient.createSshPublicKey(parent, sshPublicKey);
+   * }
+   * }
+ * + * @param parent Required. The unique ID for the user in format `users/{user}`. + * @param sshPublicKey Required. The SSH public key and expiration time. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OsLoginProto.SshPublicKey createSshPublicKey( + String parent, OsLoginProto.SshPublicKey sshPublicKey) { + CreateSshPublicKeyRequest request = + CreateSshPublicKeyRequest.newBuilder() + .setParent(parent) + .setSshPublicKey(sshPublicKey) + .build(); + return createSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an SSH public key + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   CreateSshPublicKeyRequest request =
+   *       CreateSshPublicKeyRequest.newBuilder()
+   *           .setParent(UserName.of("[USER]").toString())
+   *           .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build())
+   *           .build();
+   *   OsLoginProto.SshPublicKey response = osLoginServiceClient.createSshPublicKey(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 OsLoginProto.SshPublicKey createSshPublicKey(CreateSshPublicKeyRequest request) { + return createSshPublicKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an SSH public key + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   CreateSshPublicKeyRequest request =
+   *       CreateSshPublicKeyRequest.newBuilder()
+   *           .setParent(UserName.of("[USER]").toString())
+   *           .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       osLoginServiceClient.createSshPublicKeyCallable().futureCall(request);
+   *   // Do something.
+   *   OsLoginProto.SshPublicKey response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createSshPublicKeyCallable() { + return stub.createSshPublicKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a POSIX account. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[USER]", "[PROJECT]");
+   *   osLoginServiceClient.deletePosixAccount(name);
+   * }
+   * }
+ * + * @param name Required. A reference to the POSIX account to update. POSIX accounts are identified + * by the project ID they are associated with. A reference to the POSIX account is in format + * `users/{user}/projects/{project}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePosixAccount(ProjectName name) { + DeletePosixAccountRequest request = + DeletePosixAccountRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deletePosixAccount(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a POSIX account. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   String name = ProjectName.of("[USER]", "[PROJECT]").toString();
+   *   osLoginServiceClient.deletePosixAccount(name);
+   * }
+   * }
+ * + * @param name Required. A reference to the POSIX account to update. POSIX accounts are identified + * by the project ID they are associated with. A reference to the POSIX account is in format + * `users/{user}/projects/{project}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePosixAccount(String name) { + DeletePosixAccountRequest request = + DeletePosixAccountRequest.newBuilder().setName(name).build(); + deletePosixAccount(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a POSIX account. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   DeletePosixAccountRequest request =
+   *       DeletePosixAccountRequest.newBuilder()
+   *           .setName(ProjectName.of("[USER]", "[PROJECT]").toString())
+   *           .build();
+   *   osLoginServiceClient.deletePosixAccount(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 void deletePosixAccount(DeletePosixAccountRequest request) { + deletePosixAccountCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a POSIX account. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   DeletePosixAccountRequest request =
+   *       DeletePosixAccountRequest.newBuilder()
+   *           .setName(ProjectName.of("[USER]", "[PROJECT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       osLoginServiceClient.deletePosixAccountCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deletePosixAccountCallable() { + return stub.deletePosixAccountCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an SSH public key. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]");
+   *   osLoginServiceClient.deleteSshPublicKey(name);
+   * }
+   * }
+ * + * @param name Required. The fingerprint of the public key to update. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSshPublicKey(FingerprintName name) { + DeleteSshPublicKeyRequest request = + DeleteSshPublicKeyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an SSH public key. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   String name = FingerprintName.of("[USER]", "[FINGERPRINT]").toString();
+   *   osLoginServiceClient.deleteSshPublicKey(name);
+   * }
+   * }
+ * + * @param name Required. The fingerprint of the public key to update. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSshPublicKey(String name) { + DeleteSshPublicKeyRequest request = + DeleteSshPublicKeyRequest.newBuilder().setName(name).build(); + deleteSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an SSH public key. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   DeleteSshPublicKeyRequest request =
+   *       DeleteSshPublicKeyRequest.newBuilder()
+   *           .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString())
+   *           .build();
+   *   osLoginServiceClient.deleteSshPublicKey(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 void deleteSshPublicKey(DeleteSshPublicKeyRequest request) { + deleteSshPublicKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an SSH public key. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   DeleteSshPublicKeyRequest request =
+   *       DeleteSshPublicKeyRequest.newBuilder()
+   *           .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       osLoginServiceClient.deleteSshPublicKeyCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSshPublicKeyCallable() { + return stub.deleteSshPublicKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the profile information used for logging in to a virtual machine on Google Compute + * Engine. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   UserName name = UserName.of("[USER]");
+   *   LoginProfile response = osLoginServiceClient.getLoginProfile(name);
+   * }
+   * }
+ * + * @param name Required. The unique ID for the user in format `users/{user}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LoginProfile getLoginProfile(UserName name) { + GetLoginProfileRequest request = + GetLoginProfileRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getLoginProfile(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the profile information used for logging in to a virtual machine on Google Compute + * Engine. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   String name = UserName.of("[USER]").toString();
+   *   LoginProfile response = osLoginServiceClient.getLoginProfile(name);
+   * }
+   * }
+ * + * @param name Required. The unique ID for the user in format `users/{user}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LoginProfile getLoginProfile(String name) { + GetLoginProfileRequest request = GetLoginProfileRequest.newBuilder().setName(name).build(); + return getLoginProfile(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the profile information used for logging in to a virtual machine on Google Compute + * Engine. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   GetLoginProfileRequest request =
+   *       GetLoginProfileRequest.newBuilder()
+   *           .setName(UserName.of("[USER]").toString())
+   *           .setProjectId("projectId-894832108")
+   *           .setSystemId("systemId1976085418")
+   *           .setView(LoginProfileView.forNumber(0))
+   *           .build();
+   *   LoginProfile response = osLoginServiceClient.getLoginProfile(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 LoginProfile getLoginProfile(GetLoginProfileRequest request) { + return getLoginProfileCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the profile information used for logging in to a virtual machine on Google Compute + * Engine. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   GetLoginProfileRequest request =
+   *       GetLoginProfileRequest.newBuilder()
+   *           .setName(UserName.of("[USER]").toString())
+   *           .setProjectId("projectId-894832108")
+   *           .setSystemId("systemId1976085418")
+   *           .setView(LoginProfileView.forNumber(0))
+   *           .build();
+   *   ApiFuture future =
+   *       osLoginServiceClient.getLoginProfileCallable().futureCall(request);
+   *   // Do something.
+   *   LoginProfile response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLoginProfileCallable() { + return stub.getLoginProfileCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves an SSH public key. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]");
+   *   OsLoginProto.SshPublicKey response = osLoginServiceClient.getSshPublicKey(name);
+   * }
+   * }
+ * + * @param name Required. The fingerprint of the public key to retrieve. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OsLoginProto.SshPublicKey getSshPublicKey(FingerprintName name) { + GetSshPublicKeyRequest request = + GetSshPublicKeyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves an SSH public key. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   String name = FingerprintName.of("[USER]", "[FINGERPRINT]").toString();
+   *   OsLoginProto.SshPublicKey response = osLoginServiceClient.getSshPublicKey(name);
+   * }
+   * }
+ * + * @param name Required. The fingerprint of the public key to retrieve. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OsLoginProto.SshPublicKey getSshPublicKey(String name) { + GetSshPublicKeyRequest request = GetSshPublicKeyRequest.newBuilder().setName(name).build(); + return getSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves an SSH public key. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   GetSshPublicKeyRequest request =
+   *       GetSshPublicKeyRequest.newBuilder()
+   *           .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString())
+   *           .build();
+   *   OsLoginProto.SshPublicKey response = osLoginServiceClient.getSshPublicKey(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 OsLoginProto.SshPublicKey getSshPublicKey(GetSshPublicKeyRequest request) { + return getSshPublicKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves an SSH public key. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   GetSshPublicKeyRequest request =
+   *       GetSshPublicKeyRequest.newBuilder()
+   *           .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       osLoginServiceClient.getSshPublicKeyCallable().futureCall(request);
+   *   // Do something.
+   *   OsLoginProto.SshPublicKey response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getSshPublicKeyCallable() { + return stub.getSshPublicKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds an SSH public key and returns the profile information. Default POSIX account information + * is set when no username and UID exist as part of the login profile. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   UserName parent = UserName.of("[USER]");
+   *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+   *   ImportSshPublicKeyResponse response =
+   *       osLoginServiceClient.importSshPublicKey(parent, sshPublicKey);
+   * }
+   * }
+ * + * @param parent The unique ID for the user in format `users/{user}`. + * @param sshPublicKey Required. The SSH public key and expiration time. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ImportSshPublicKeyResponse importSshPublicKey( + UserName parent, OsLoginProto.SshPublicKey sshPublicKey) { + ImportSshPublicKeyRequest request = + ImportSshPublicKeyRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSshPublicKey(sshPublicKey) + .build(); + return importSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds an SSH public key and returns the profile information. Default POSIX account information + * is set when no username and UID exist as part of the login profile. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   String parent = UserName.of("[USER]").toString();
+   *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+   *   ImportSshPublicKeyResponse response =
+   *       osLoginServiceClient.importSshPublicKey(parent, sshPublicKey);
+   * }
+   * }
+ * + * @param parent The unique ID for the user in format `users/{user}`. + * @param sshPublicKey Required. The SSH public key and expiration time. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ImportSshPublicKeyResponse importSshPublicKey( + String parent, OsLoginProto.SshPublicKey sshPublicKey) { + ImportSshPublicKeyRequest request = + ImportSshPublicKeyRequest.newBuilder() + .setParent(parent) + .setSshPublicKey(sshPublicKey) + .build(); + return importSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds an SSH public key and returns the profile information. Default POSIX account information + * is set when no username and UID exist as part of the login profile. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   UserName parent = UserName.of("[USER]");
+   *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+   *   String projectId = "projectId-894832108";
+   *   ImportSshPublicKeyResponse response =
+   *       osLoginServiceClient.importSshPublicKey(parent, sshPublicKey, projectId);
+   * }
+   * }
+ * + * @param parent The unique ID for the user in format `users/{user}`. + * @param sshPublicKey Required. The SSH public key and expiration time. + * @param projectId The project ID of the Google Cloud Platform project. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ImportSshPublicKeyResponse importSshPublicKey( + UserName parent, OsLoginProto.SshPublicKey sshPublicKey, String projectId) { + ImportSshPublicKeyRequest request = + ImportSshPublicKeyRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSshPublicKey(sshPublicKey) + .setProjectId(projectId) + .build(); + return importSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds an SSH public key and returns the profile information. Default POSIX account information + * is set when no username and UID exist as part of the login profile. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   String parent = UserName.of("[USER]").toString();
+   *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+   *   String projectId = "projectId-894832108";
+   *   ImportSshPublicKeyResponse response =
+   *       osLoginServiceClient.importSshPublicKey(parent, sshPublicKey, projectId);
+   * }
+   * }
+ * + * @param parent The unique ID for the user in format `users/{user}`. + * @param sshPublicKey Required. The SSH public key and expiration time. + * @param projectId The project ID of the Google Cloud Platform project. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ImportSshPublicKeyResponse importSshPublicKey( + String parent, OsLoginProto.SshPublicKey sshPublicKey, String projectId) { + ImportSshPublicKeyRequest request = + ImportSshPublicKeyRequest.newBuilder() + .setParent(parent) + .setSshPublicKey(sshPublicKey) + .setProjectId(projectId) + .build(); + return importSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds an SSH public key and returns the profile information. Default POSIX account information + * is set when no username and UID exist as part of the login profile. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   ImportSshPublicKeyRequest request =
+   *       ImportSshPublicKeyRequest.newBuilder()
+   *           .setParent(UserName.of("[USER]").toString())
+   *           .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build())
+   *           .setProjectId("projectId-894832108")
+   *           .setView(LoginProfileView.forNumber(0))
+   *           .addAllRegions(new ArrayList())
+   *           .build();
+   *   ImportSshPublicKeyResponse response = osLoginServiceClient.importSshPublicKey(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 ImportSshPublicKeyResponse importSshPublicKey(ImportSshPublicKeyRequest request) { + return importSshPublicKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds an SSH public key and returns the profile information. Default POSIX account information + * is set when no username and UID exist as part of the login profile. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   ImportSshPublicKeyRequest request =
+   *       ImportSshPublicKeyRequest.newBuilder()
+   *           .setParent(UserName.of("[USER]").toString())
+   *           .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build())
+   *           .setProjectId("projectId-894832108")
+   *           .setView(LoginProfileView.forNumber(0))
+   *           .addAllRegions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       osLoginServiceClient.importSshPublicKeyCallable().futureCall(request);
+   *   // Do something.
+   *   ImportSshPublicKeyResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + importSshPublicKeyCallable() { + return stub.importSshPublicKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an SSH public key and returns the profile information. This method supports patch + * semantics. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]");
+   *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+   *   OsLoginProto.SshPublicKey response =
+   *       osLoginServiceClient.updateSshPublicKey(name, sshPublicKey);
+   * }
+   * }
+ * + * @param name Required. The fingerprint of the public key to update. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @param sshPublicKey Required. The SSH public key and expiration time. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OsLoginProto.SshPublicKey updateSshPublicKey( + FingerprintName name, OsLoginProto.SshPublicKey sshPublicKey) { + UpdateSshPublicKeyRequest request = + UpdateSshPublicKeyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setSshPublicKey(sshPublicKey) + .build(); + return updateSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an SSH public key and returns the profile information. This method supports patch + * semantics. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   String name = FingerprintName.of("[USER]", "[FINGERPRINT]").toString();
+   *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+   *   OsLoginProto.SshPublicKey response =
+   *       osLoginServiceClient.updateSshPublicKey(name, sshPublicKey);
+   * }
+   * }
+ * + * @param name Required. The fingerprint of the public key to update. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @param sshPublicKey Required. The SSH public key and expiration time. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OsLoginProto.SshPublicKey updateSshPublicKey( + String name, OsLoginProto.SshPublicKey sshPublicKey) { + UpdateSshPublicKeyRequest request = + UpdateSshPublicKeyRequest.newBuilder().setName(name).setSshPublicKey(sshPublicKey).build(); + return updateSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an SSH public key and returns the profile information. This method supports patch + * semantics. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]");
+   *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   OsLoginProto.SshPublicKey response =
+   *       osLoginServiceClient.updateSshPublicKey(name, sshPublicKey, updateMask);
+   * }
+   * }
+ * + * @param name Required. The fingerprint of the public key to update. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @param sshPublicKey Required. The SSH public key and expiration time. + * @param updateMask Mask to control which fields get updated. Updates all if not present. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OsLoginProto.SshPublicKey updateSshPublicKey( + FingerprintName name, OsLoginProto.SshPublicKey sshPublicKey, FieldMask updateMask) { + UpdateSshPublicKeyRequest request = + UpdateSshPublicKeyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setSshPublicKey(sshPublicKey) + .setUpdateMask(updateMask) + .build(); + return updateSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an SSH public key and returns the profile information. This method supports patch + * semantics. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   String name = FingerprintName.of("[USER]", "[FINGERPRINT]").toString();
+   *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   OsLoginProto.SshPublicKey response =
+   *       osLoginServiceClient.updateSshPublicKey(name, sshPublicKey, updateMask);
+   * }
+   * }
+ * + * @param name Required. The fingerprint of the public key to update. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @param sshPublicKey Required. The SSH public key and expiration time. + * @param updateMask Mask to control which fields get updated. Updates all if not present. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OsLoginProto.SshPublicKey updateSshPublicKey( + String name, OsLoginProto.SshPublicKey sshPublicKey, FieldMask updateMask) { + UpdateSshPublicKeyRequest request = + UpdateSshPublicKeyRequest.newBuilder() + .setName(name) + .setSshPublicKey(sshPublicKey) + .setUpdateMask(updateMask) + .build(); + return updateSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an SSH public key and returns the profile information. This method supports patch + * semantics. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   UpdateSshPublicKeyRequest request =
+   *       UpdateSshPublicKeyRequest.newBuilder()
+   *           .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString())
+   *           .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OsLoginProto.SshPublicKey response = osLoginServiceClient.updateSshPublicKey(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 OsLoginProto.SshPublicKey updateSshPublicKey(UpdateSshPublicKeyRequest request) { + return updateSshPublicKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an SSH public key and returns the profile information. This method supports patch + * semantics. + * + *

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   UpdateSshPublicKeyRequest request =
+   *       UpdateSshPublicKeyRequest.newBuilder()
+   *           .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString())
+   *           .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       osLoginServiceClient.updateSshPublicKeyCallable().futureCall(request);
+   *   // Do something.
+   *   OsLoginProto.SshPublicKey response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateSshPublicKeyCallable() { + return stub.updateSshPublicKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Signs an SSH public key for a user to authenticate to 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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   String parent = "parent-995424086";
+   *   String sshPublicKey = "sshPublicKey1661966862";
+   *   SignSshPublicKeyResponse response =
+   *       osLoginServiceClient.signSshPublicKey(parent, sshPublicKey);
+   * }
+   * }
+ * + * @param parent The parent project and region for the signing request. + * @param sshPublicKey The SSH public key to sign. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SignSshPublicKeyResponse signSshPublicKey(String parent, String sshPublicKey) { + SignSshPublicKeyRequest request = + SignSshPublicKeyRequest.newBuilder() + .setParent(parent) + .setSshPublicKey(sshPublicKey) + .build(); + return signSshPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Signs an SSH public key for a user to authenticate to 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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   SignSshPublicKeyRequest request =
+   *       SignSshPublicKeyRequest.newBuilder()
+   *           .setSshPublicKey("sshPublicKey1661966862")
+   *           .setParent("parent-995424086")
+   *           .build();
+   *   SignSshPublicKeyResponse response = osLoginServiceClient.signSshPublicKey(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 SignSshPublicKeyResponse signSshPublicKey(SignSshPublicKeyRequest request) { + return signSshPublicKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Signs an SSH public key for a user to authenticate to 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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+   *   SignSshPublicKeyRequest request =
+   *       SignSshPublicKeyRequest.newBuilder()
+   *           .setSshPublicKey("sshPublicKey1661966862")
+   *           .setParent("parent-995424086")
+   *           .build();
+   *   ApiFuture future =
+   *       osLoginServiceClient.signSshPublicKeyCallable().futureCall(request);
+   *   // Do something.
+   *   SignSshPublicKeyResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + signSshPublicKeyCallable() { + return stub.signSshPublicKeyCallable(); + } + + @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); + } +} diff --git a/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceSettings.java b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceSettings.java new file mode 100644 index 000000000000..57b26b43be3a --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceSettings.java @@ -0,0 +1,301 @@ +/* + * Copyright 2026 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.oslogin.v1beta; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.oslogin.common.OsLoginProto; +import com.google.cloud.oslogin.v1beta.stub.OsLoginServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link OsLoginServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (oslogin.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSshPublicKey: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * OsLoginServiceSettings.Builder osLoginServiceSettingsBuilder =
+ *     OsLoginServiceSettings.newBuilder();
+ * osLoginServiceSettingsBuilder
+ *     .createSshPublicKeySettings()
+ *     .setRetrySettings(
+ *         osLoginServiceSettingsBuilder
+ *             .createSshPublicKeySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * OsLoginServiceSettings osLoginServiceSettings = osLoginServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class OsLoginServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createSshPublicKey. */ + public UnaryCallSettings + createSshPublicKeySettings() { + return ((OsLoginServiceStubSettings) getStubSettings()).createSshPublicKeySettings(); + } + + /** Returns the object with the settings used for calls to deletePosixAccount. */ + public UnaryCallSettings deletePosixAccountSettings() { + return ((OsLoginServiceStubSettings) getStubSettings()).deletePosixAccountSettings(); + } + + /** Returns the object with the settings used for calls to deleteSshPublicKey. */ + public UnaryCallSettings deleteSshPublicKeySettings() { + return ((OsLoginServiceStubSettings) getStubSettings()).deleteSshPublicKeySettings(); + } + + /** Returns the object with the settings used for calls to getLoginProfile. */ + public UnaryCallSettings getLoginProfileSettings() { + return ((OsLoginServiceStubSettings) getStubSettings()).getLoginProfileSettings(); + } + + /** Returns the object with the settings used for calls to getSshPublicKey. */ + public UnaryCallSettings + getSshPublicKeySettings() { + return ((OsLoginServiceStubSettings) getStubSettings()).getSshPublicKeySettings(); + } + + /** Returns the object with the settings used for calls to importSshPublicKey. */ + public UnaryCallSettings + importSshPublicKeySettings() { + return ((OsLoginServiceStubSettings) getStubSettings()).importSshPublicKeySettings(); + } + + /** Returns the object with the settings used for calls to updateSshPublicKey. */ + public UnaryCallSettings + updateSshPublicKeySettings() { + return ((OsLoginServiceStubSettings) getStubSettings()).updateSshPublicKeySettings(); + } + + /** Returns the object with the settings used for calls to signSshPublicKey. */ + public UnaryCallSettings + signSshPublicKeySettings() { + return ((OsLoginServiceStubSettings) getStubSettings()).signSshPublicKeySettings(); + } + + public static final OsLoginServiceSettings create(OsLoginServiceStubSettings stub) + throws IOException { + return new OsLoginServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return OsLoginServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return OsLoginServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return OsLoginServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return OsLoginServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return OsLoginServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return OsLoginServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return OsLoginServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return OsLoginServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected OsLoginServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for OsLoginServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(OsLoginServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(OsLoginServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(OsLoginServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(OsLoginServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(OsLoginServiceStubSettings.newHttpJsonBuilder()); + } + + public OsLoginServiceStubSettings.Builder getStubSettingsBuilder() { + return ((OsLoginServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createSshPublicKey. */ + public UnaryCallSettings.Builder + createSshPublicKeySettings() { + return getStubSettingsBuilder().createSshPublicKeySettings(); + } + + /** Returns the builder for the settings used for calls to deletePosixAccount. */ + public UnaryCallSettings.Builder + deletePosixAccountSettings() { + return getStubSettingsBuilder().deletePosixAccountSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSshPublicKey. */ + public UnaryCallSettings.Builder + deleteSshPublicKeySettings() { + return getStubSettingsBuilder().deleteSshPublicKeySettings(); + } + + /** Returns the builder for the settings used for calls to getLoginProfile. */ + public UnaryCallSettings.Builder + getLoginProfileSettings() { + return getStubSettingsBuilder().getLoginProfileSettings(); + } + + /** Returns the builder for the settings used for calls to getSshPublicKey. */ + public UnaryCallSettings.Builder + getSshPublicKeySettings() { + return getStubSettingsBuilder().getSshPublicKeySettings(); + } + + /** Returns the builder for the settings used for calls to importSshPublicKey. */ + public UnaryCallSettings.Builder + importSshPublicKeySettings() { + return getStubSettingsBuilder().importSshPublicKeySettings(); + } + + /** Returns the builder for the settings used for calls to updateSshPublicKey. */ + public UnaryCallSettings.Builder + updateSshPublicKeySettings() { + return getStubSettingsBuilder().updateSshPublicKeySettings(); + } + + /** Returns the builder for the settings used for calls to signSshPublicKey. */ + public UnaryCallSettings.Builder + signSshPublicKeySettings() { + return getStubSettingsBuilder().signSshPublicKeySettings(); + } + + @Override + public OsLoginServiceSettings build() throws IOException { + return new OsLoginServiceSettings(this); + } + } +} diff --git a/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/gapic_metadata.json b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..a44f37ed98a2 --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/gapic_metadata.json @@ -0,0 +1,42 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.oslogin.v1beta", + "libraryPackage": "com.google.cloud.oslogin.v1beta", + "services": { + "OsLoginService": { + "clients": { + "grpc": { + "libraryClient": "OsLoginServiceClient", + "rpcs": { + "CreateSshPublicKey": { + "methods": ["createSshPublicKey", "createSshPublicKey", "createSshPublicKey", "createSshPublicKeyCallable"] + }, + "DeletePosixAccount": { + "methods": ["deletePosixAccount", "deletePosixAccount", "deletePosixAccount", "deletePosixAccountCallable"] + }, + "DeleteSshPublicKey": { + "methods": ["deleteSshPublicKey", "deleteSshPublicKey", "deleteSshPublicKey", "deleteSshPublicKeyCallable"] + }, + "GetLoginProfile": { + "methods": ["getLoginProfile", "getLoginProfile", "getLoginProfile", "getLoginProfileCallable"] + }, + "GetSshPublicKey": { + "methods": ["getSshPublicKey", "getSshPublicKey", "getSshPublicKey", "getSshPublicKeyCallable"] + }, + "ImportSshPublicKey": { + "methods": ["importSshPublicKey", "importSshPublicKey", "importSshPublicKey", "importSshPublicKey", "importSshPublicKey", "importSshPublicKeyCallable"] + }, + "SignSshPublicKey": { + "methods": ["signSshPublicKey", "signSshPublicKey", "signSshPublicKeyCallable"] + }, + "UpdateSshPublicKey": { + "methods": ["updateSshPublicKey", "updateSshPublicKey", "updateSshPublicKey", "updateSshPublicKey", "updateSshPublicKey", "updateSshPublicKeyCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/package-info.java b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/package-info.java new file mode 100644 index 000000000000..d8dc6ab14e79 --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/package-info.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 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. + */ + +/** + * A client to Cloud OS Login API + * + *

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

======================= OsLoginServiceClient ======================= + * + *

Service Description: Cloud OS Login API + * + *

The Cloud OS Login API allows you to manage users and their associated SSH public keys for + * logging into virtual machines on Google Cloud Platform. + * + *

Sample for OsLoginServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
+ *   UserName parent = UserName.of("[USER]");
+ *   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
+ *   OsLoginProto.SshPublicKey response =
+ *       osLoginServiceClient.createSshPublicKey(parent, sshPublicKey);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.oslogin.v1beta; + +import javax.annotation.Generated; diff --git a/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/GrpcOsLoginServiceCallableFactory.java b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/GrpcOsLoginServiceCallableFactory.java new file mode 100644 index 000000000000..1ce776042caf --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/GrpcOsLoginServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 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.oslogin.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the OsLoginService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcOsLoginServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/GrpcOsLoginServiceStub.java b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/GrpcOsLoginServiceStub.java new file mode 100644 index 000000000000..406186f86b91 --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/GrpcOsLoginServiceStub.java @@ -0,0 +1,423 @@ +/* + * Copyright 2026 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.oslogin.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.oslogin.common.OsLoginProto; +import com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest; +import com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.GetLoginProfileRequest; +import com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse; +import com.google.cloud.oslogin.v1beta.LoginProfile; +import com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse; +import com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the OsLoginService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcOsLoginServiceStub extends OsLoginServiceStub { + private static final MethodDescriptor + createSshPublicKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/CreateSshPublicKey") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSshPublicKeyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(OsLoginProto.SshPublicKey.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deletePosixAccountMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/DeletePosixAccount") + .setRequestMarshaller( + ProtoUtils.marshaller(DeletePosixAccountRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteSshPublicKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/DeleteSshPublicKey") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteSshPublicKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getLoginProfileMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/GetLoginProfile") + .setRequestMarshaller( + ProtoUtils.marshaller(GetLoginProfileRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LoginProfile.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getSshPublicKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/GetSshPublicKey") + .setRequestMarshaller( + ProtoUtils.marshaller(GetSshPublicKeyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(OsLoginProto.SshPublicKey.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + importSshPublicKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/ImportSshPublicKey") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportSshPublicKeyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ImportSshPublicKeyResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateSshPublicKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/UpdateSshPublicKey") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateSshPublicKeyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(OsLoginProto.SshPublicKey.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + signSshPublicKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/SignSshPublicKey") + .setRequestMarshaller( + ProtoUtils.marshaller(SignSshPublicKeyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SignSshPublicKeyResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable + createSshPublicKeyCallable; + private final UnaryCallable deletePosixAccountCallable; + private final UnaryCallable deleteSshPublicKeyCallable; + private final UnaryCallable getLoginProfileCallable; + private final UnaryCallable + getSshPublicKeyCallable; + private final UnaryCallable + importSshPublicKeyCallable; + private final UnaryCallable + updateSshPublicKeyCallable; + private final UnaryCallable + signSshPublicKeyCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcOsLoginServiceStub create(OsLoginServiceStubSettings settings) + throws IOException { + return new GrpcOsLoginServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcOsLoginServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcOsLoginServiceStub( + OsLoginServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcOsLoginServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcOsLoginServiceStub( + OsLoginServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcOsLoginServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcOsLoginServiceStub(OsLoginServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcOsLoginServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcOsLoginServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcOsLoginServiceStub( + OsLoginServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + createSshPublicKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSshPublicKeyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings deletePosixAccountTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deletePosixAccountMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings deleteSshPublicKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSshPublicKeyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings getLoginProfileTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLoginProfileMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + getSshPublicKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSshPublicKeyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + importSshPublicKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importSshPublicKeyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings + updateSshPublicKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSshPublicKeyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + signSshPublicKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(signSshPublicKeyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.createSshPublicKeyCallable = + callableFactory.createUnaryCallable( + createSshPublicKeyTransportSettings, + settings.createSshPublicKeySettings(), + clientContext); + this.deletePosixAccountCallable = + callableFactory.createUnaryCallable( + deletePosixAccountTransportSettings, + settings.deletePosixAccountSettings(), + clientContext); + this.deleteSshPublicKeyCallable = + callableFactory.createUnaryCallable( + deleteSshPublicKeyTransportSettings, + settings.deleteSshPublicKeySettings(), + clientContext); + this.getLoginProfileCallable = + callableFactory.createUnaryCallable( + getLoginProfileTransportSettings, settings.getLoginProfileSettings(), clientContext); + this.getSshPublicKeyCallable = + callableFactory.createUnaryCallable( + getSshPublicKeyTransportSettings, settings.getSshPublicKeySettings(), clientContext); + this.importSshPublicKeyCallable = + callableFactory.createUnaryCallable( + importSshPublicKeyTransportSettings, + settings.importSshPublicKeySettings(), + clientContext); + this.updateSshPublicKeyCallable = + callableFactory.createUnaryCallable( + updateSshPublicKeyTransportSettings, + settings.updateSshPublicKeySettings(), + clientContext); + this.signSshPublicKeyCallable = + callableFactory.createUnaryCallable( + signSshPublicKeyTransportSettings, settings.signSshPublicKeySettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + createSshPublicKeyCallable() { + return createSshPublicKeyCallable; + } + + @Override + public UnaryCallable deletePosixAccountCallable() { + return deletePosixAccountCallable; + } + + @Override + public UnaryCallable deleteSshPublicKeyCallable() { + return deleteSshPublicKeyCallable; + } + + @Override + public UnaryCallable getLoginProfileCallable() { + return getLoginProfileCallable; + } + + @Override + public UnaryCallable + getSshPublicKeyCallable() { + return getSshPublicKeyCallable; + } + + @Override + public UnaryCallable + importSshPublicKeyCallable() { + return importSshPublicKeyCallable; + } + + @Override + public UnaryCallable + updateSshPublicKeyCallable() { + return updateSshPublicKeyCallable; + } + + @Override + public UnaryCallable + signSshPublicKeyCallable() { + return signSshPublicKeyCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/HttpJsonOsLoginServiceCallableFactory.java b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/HttpJsonOsLoginServiceCallableFactory.java new file mode 100644 index 000000000000..066a9e8c7342 --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/HttpJsonOsLoginServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 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.oslogin.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the OsLoginService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonOsLoginServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/HttpJsonOsLoginServiceStub.java b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/HttpJsonOsLoginServiceStub.java new file mode 100644 index 000000000000..9cdc46cc6857 --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/HttpJsonOsLoginServiceStub.java @@ -0,0 +1,648 @@ +/* + * Copyright 2026 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.oslogin.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.oslogin.common.OsLoginProto; +import com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest; +import com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.GetLoginProfileRequest; +import com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse; +import com.google.cloud.oslogin.v1beta.LoginProfile; +import com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse; +import com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the OsLoginService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonOsLoginServiceStub extends OsLoginServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createSshPublicKeyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/CreateSshPublicKey") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=users/*}/sshPublicKeys", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("sshPublicKey", request.getSshPublicKey(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(OsLoginProto.SshPublicKey.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deletePosixAccountMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/DeletePosixAccount") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=users/*/projects/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteSshPublicKeyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/DeleteSshPublicKey") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=users/*/sshPublicKeys/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLoginProfileMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/GetLoginProfile") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=users/*}/loginProfile", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "projectId", request.getProjectId()); + serializer.putQueryParam(fields, "systemId", request.getSystemId()); + serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(LoginProfile.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getSshPublicKeyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/GetSshPublicKey") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=users/*/sshPublicKeys/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(OsLoginProto.SshPublicKey.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + importSshPublicKeyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/ImportSshPublicKey") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=users/*}:importSshPublicKey", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "projectId", request.getProjectId()); + serializer.putQueryParam(fields, "regions", request.getRegionsList()); + serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("sshPublicKey", request.getSshPublicKey(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ImportSshPublicKeyResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateSshPublicKeyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/UpdateSshPublicKey") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=users/*/sshPublicKeys/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("sshPublicKey", request.getSshPublicKey(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(OsLoginProto.SshPublicKey.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + signSshPublicKeyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.oslogin.v1beta.OsLoginService/SignSshPublicKey") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=users/*/projects/*/zones/*}:signSshPublicKey", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1beta/{parent=users/*/projects/*/locations/*}:signSshPublicKey") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SignSshPublicKeyResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + createSshPublicKeyCallable; + private final UnaryCallable deletePosixAccountCallable; + private final UnaryCallable deleteSshPublicKeyCallable; + private final UnaryCallable getLoginProfileCallable; + private final UnaryCallable + getSshPublicKeyCallable; + private final UnaryCallable + importSshPublicKeyCallable; + private final UnaryCallable + updateSshPublicKeyCallable; + private final UnaryCallable + signSshPublicKeyCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonOsLoginServiceStub create(OsLoginServiceStubSettings settings) + throws IOException { + return new HttpJsonOsLoginServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonOsLoginServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonOsLoginServiceStub( + OsLoginServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonOsLoginServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonOsLoginServiceStub( + OsLoginServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonOsLoginServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonOsLoginServiceStub( + OsLoginServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonOsLoginServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonOsLoginServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonOsLoginServiceStub( + OsLoginServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + createSshPublicKeyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSshPublicKeyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings deletePosixAccountTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deletePosixAccountMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings deleteSshPublicKeyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSshPublicKeyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings getLoginProfileTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLoginProfileMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + getSshPublicKeyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSshPublicKeyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + importSshPublicKeyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(importSshPublicKeyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings + updateSshPublicKeyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateSshPublicKeyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + signSshPublicKeyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(signSshPublicKeyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.createSshPublicKeyCallable = + callableFactory.createUnaryCallable( + createSshPublicKeyTransportSettings, + settings.createSshPublicKeySettings(), + clientContext); + this.deletePosixAccountCallable = + callableFactory.createUnaryCallable( + deletePosixAccountTransportSettings, + settings.deletePosixAccountSettings(), + clientContext); + this.deleteSshPublicKeyCallable = + callableFactory.createUnaryCallable( + deleteSshPublicKeyTransportSettings, + settings.deleteSshPublicKeySettings(), + clientContext); + this.getLoginProfileCallable = + callableFactory.createUnaryCallable( + getLoginProfileTransportSettings, settings.getLoginProfileSettings(), clientContext); + this.getSshPublicKeyCallable = + callableFactory.createUnaryCallable( + getSshPublicKeyTransportSettings, settings.getSshPublicKeySettings(), clientContext); + this.importSshPublicKeyCallable = + callableFactory.createUnaryCallable( + importSshPublicKeyTransportSettings, + settings.importSshPublicKeySettings(), + clientContext); + this.updateSshPublicKeyCallable = + callableFactory.createUnaryCallable( + updateSshPublicKeyTransportSettings, + settings.updateSshPublicKeySettings(), + clientContext); + this.signSshPublicKeyCallable = + callableFactory.createUnaryCallable( + signSshPublicKeyTransportSettings, settings.signSshPublicKeySettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSshPublicKeyMethodDescriptor); + methodDescriptors.add(deletePosixAccountMethodDescriptor); + methodDescriptors.add(deleteSshPublicKeyMethodDescriptor); + methodDescriptors.add(getLoginProfileMethodDescriptor); + methodDescriptors.add(getSshPublicKeyMethodDescriptor); + methodDescriptors.add(importSshPublicKeyMethodDescriptor); + methodDescriptors.add(updateSshPublicKeyMethodDescriptor); + methodDescriptors.add(signSshPublicKeyMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + createSshPublicKeyCallable() { + return createSshPublicKeyCallable; + } + + @Override + public UnaryCallable deletePosixAccountCallable() { + return deletePosixAccountCallable; + } + + @Override + public UnaryCallable deleteSshPublicKeyCallable() { + return deleteSshPublicKeyCallable; + } + + @Override + public UnaryCallable getLoginProfileCallable() { + return getLoginProfileCallable; + } + + @Override + public UnaryCallable + getSshPublicKeyCallable() { + return getSshPublicKeyCallable; + } + + @Override + public UnaryCallable + importSshPublicKeyCallable() { + return importSshPublicKeyCallable; + } + + @Override + public UnaryCallable + updateSshPublicKeyCallable() { + return updateSshPublicKeyCallable; + } + + @Override + public UnaryCallable + signSshPublicKeyCallable() { + return signSshPublicKeyCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/OsLoginServiceStub.java b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/OsLoginServiceStub.java new file mode 100644 index 000000000000..eb6bf9bd2de3 --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/OsLoginServiceStub.java @@ -0,0 +1,86 @@ +/* + * Copyright 2026 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.oslogin.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.oslogin.common.OsLoginProto; +import com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest; +import com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.GetLoginProfileRequest; +import com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse; +import com.google.cloud.oslogin.v1beta.LoginProfile; +import com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse; +import com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the OsLoginService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class OsLoginServiceStub implements BackgroundResource { + + public UnaryCallable + createSshPublicKeyCallable() { + throw new UnsupportedOperationException("Not implemented: createSshPublicKeyCallable()"); + } + + public UnaryCallable deletePosixAccountCallable() { + throw new UnsupportedOperationException("Not implemented: deletePosixAccountCallable()"); + } + + public UnaryCallable deleteSshPublicKeyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSshPublicKeyCallable()"); + } + + public UnaryCallable getLoginProfileCallable() { + throw new UnsupportedOperationException("Not implemented: getLoginProfileCallable()"); + } + + public UnaryCallable + getSshPublicKeyCallable() { + throw new UnsupportedOperationException("Not implemented: getSshPublicKeyCallable()"); + } + + public UnaryCallable + importSshPublicKeyCallable() { + throw new UnsupportedOperationException("Not implemented: importSshPublicKeyCallable()"); + } + + public UnaryCallable + updateSshPublicKeyCallable() { + throw new UnsupportedOperationException("Not implemented: updateSshPublicKeyCallable()"); + } + + public UnaryCallable + signSshPublicKeyCallable() { + throw new UnsupportedOperationException("Not implemented: signSshPublicKeyCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/OsLoginServiceStubSettings.java b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/OsLoginServiceStubSettings.java new file mode 100644 index 000000000000..c61d5a62029e --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1beta/stub/OsLoginServiceStubSettings.java @@ -0,0 +1,557 @@ +/* + * Copyright 2026 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.oslogin.v1beta.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.oslogin.common.OsLoginProto; +import com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest; +import com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.GetLoginProfileRequest; +import com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse; +import com.google.cloud.oslogin.v1beta.LoginProfile; +import com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest; +import com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse; +import com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest; +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.protobuf.Empty; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link OsLoginServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (oslogin.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSshPublicKey: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * OsLoginServiceStubSettings.Builder osLoginServiceSettingsBuilder =
+ *     OsLoginServiceStubSettings.newBuilder();
+ * osLoginServiceSettingsBuilder
+ *     .createSshPublicKeySettings()
+ *     .setRetrySettings(
+ *         osLoginServiceSettingsBuilder
+ *             .createSshPublicKeySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * OsLoginServiceStubSettings osLoginServiceSettings = osLoginServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class OsLoginServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .build(); + + private final UnaryCallSettings + createSshPublicKeySettings; + private final UnaryCallSettings deletePosixAccountSettings; + private final UnaryCallSettings deleteSshPublicKeySettings; + private final UnaryCallSettings getLoginProfileSettings; + private final UnaryCallSettings + getSshPublicKeySettings; + private final UnaryCallSettings + importSshPublicKeySettings; + private final UnaryCallSettings + updateSshPublicKeySettings; + private final UnaryCallSettings + signSshPublicKeySettings; + + /** Returns the object with the settings used for calls to createSshPublicKey. */ + public UnaryCallSettings + createSshPublicKeySettings() { + return createSshPublicKeySettings; + } + + /** Returns the object with the settings used for calls to deletePosixAccount. */ + public UnaryCallSettings deletePosixAccountSettings() { + return deletePosixAccountSettings; + } + + /** Returns the object with the settings used for calls to deleteSshPublicKey. */ + public UnaryCallSettings deleteSshPublicKeySettings() { + return deleteSshPublicKeySettings; + } + + /** Returns the object with the settings used for calls to getLoginProfile. */ + public UnaryCallSettings getLoginProfileSettings() { + return getLoginProfileSettings; + } + + /** Returns the object with the settings used for calls to getSshPublicKey. */ + public UnaryCallSettings + getSshPublicKeySettings() { + return getSshPublicKeySettings; + } + + /** Returns the object with the settings used for calls to importSshPublicKey. */ + public UnaryCallSettings + importSshPublicKeySettings() { + return importSshPublicKeySettings; + } + + /** Returns the object with the settings used for calls to updateSshPublicKey. */ + public UnaryCallSettings + updateSshPublicKeySettings() { + return updateSshPublicKeySettings; + } + + /** Returns the object with the settings used for calls to signSshPublicKey. */ + public UnaryCallSettings + signSshPublicKeySettings() { + return signSshPublicKeySettings; + } + + public OsLoginServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcOsLoginServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonOsLoginServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "oslogin"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "oslogin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "oslogin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(OsLoginServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(OsLoginServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return OsLoginServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected OsLoginServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSshPublicKeySettings = settingsBuilder.createSshPublicKeySettings().build(); + deletePosixAccountSettings = settingsBuilder.deletePosixAccountSettings().build(); + deleteSshPublicKeySettings = settingsBuilder.deleteSshPublicKeySettings().build(); + getLoginProfileSettings = settingsBuilder.getLoginProfileSettings().build(); + getSshPublicKeySettings = settingsBuilder.getSshPublicKeySettings().build(); + importSshPublicKeySettings = settingsBuilder.importSshPublicKeySettings().build(); + updateSshPublicKeySettings = settingsBuilder.updateSshPublicKeySettings().build(); + signSshPublicKeySettings = settingsBuilder.signSshPublicKeySettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-os-login") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for OsLoginServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createSshPublicKeySettings; + private final UnaryCallSettings.Builder + deletePosixAccountSettings; + private final UnaryCallSettings.Builder + deleteSshPublicKeySettings; + private final UnaryCallSettings.Builder + getLoginProfileSettings; + private final UnaryCallSettings.Builder + getSshPublicKeySettings; + private final UnaryCallSettings.Builder + importSshPublicKeySettings; + private final UnaryCallSettings.Builder + updateSshPublicKeySettings; + private final UnaryCallSettings.Builder + signSshPublicKeySettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSshPublicKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deletePosixAccountSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSshPublicKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getLoginProfileSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSshPublicKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importSshPublicKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSshPublicKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + signSshPublicKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSshPublicKeySettings, + deletePosixAccountSettings, + deleteSshPublicKeySettings, + getLoginProfileSettings, + getSshPublicKeySettings, + importSshPublicKeySettings, + updateSshPublicKeySettings, + signSshPublicKeySettings); + initDefaults(this); + } + + protected Builder(OsLoginServiceStubSettings settings) { + super(settings); + + createSshPublicKeySettings = settings.createSshPublicKeySettings.toBuilder(); + deletePosixAccountSettings = settings.deletePosixAccountSettings.toBuilder(); + deleteSshPublicKeySettings = settings.deleteSshPublicKeySettings.toBuilder(); + getLoginProfileSettings = settings.getLoginProfileSettings.toBuilder(); + getSshPublicKeySettings = settings.getSshPublicKeySettings.toBuilder(); + importSshPublicKeySettings = settings.importSshPublicKeySettings.toBuilder(); + updateSshPublicKeySettings = settings.updateSshPublicKeySettings.toBuilder(); + signSshPublicKeySettings = settings.signSshPublicKeySettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSshPublicKeySettings, + deletePosixAccountSettings, + deleteSshPublicKeySettings, + getLoginProfileSettings, + getSshPublicKeySettings, + importSshPublicKeySettings, + updateSshPublicKeySettings, + signSshPublicKeySettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSshPublicKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deletePosixAccountSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteSshPublicKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getLoginProfileSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getSshPublicKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .importSshPublicKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateSshPublicKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .signSshPublicKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createSshPublicKey. */ + public UnaryCallSettings.Builder + createSshPublicKeySettings() { + return createSshPublicKeySettings; + } + + /** Returns the builder for the settings used for calls to deletePosixAccount. */ + public UnaryCallSettings.Builder + deletePosixAccountSettings() { + return deletePosixAccountSettings; + } + + /** Returns the builder for the settings used for calls to deleteSshPublicKey. */ + public UnaryCallSettings.Builder + deleteSshPublicKeySettings() { + return deleteSshPublicKeySettings; + } + + /** Returns the builder for the settings used for calls to getLoginProfile. */ + public UnaryCallSettings.Builder + getLoginProfileSettings() { + return getLoginProfileSettings; + } + + /** Returns the builder for the settings used for calls to getSshPublicKey. */ + public UnaryCallSettings.Builder + getSshPublicKeySettings() { + return getSshPublicKeySettings; + } + + /** Returns the builder for the settings used for calls to importSshPublicKey. */ + public UnaryCallSettings.Builder + importSshPublicKeySettings() { + return importSshPublicKeySettings; + } + + /** Returns the builder for the settings used for calls to updateSshPublicKey. */ + public UnaryCallSettings.Builder + updateSshPublicKeySettings() { + return updateSshPublicKeySettings; + } + + /** Returns the builder for the settings used for calls to signSshPublicKey. */ + public UnaryCallSettings.Builder + signSshPublicKeySettings() { + return signSshPublicKeySettings; + } + + @Override + public OsLoginServiceStubSettings build() throws IOException { + return new OsLoginServiceStubSettings(this); + } + } +} diff --git a/java-os-login/google-cloud-os-login/src/main/resources/META-INF/native-image/com.google.cloud.oslogin.v1beta/reflect-config.json b/java-os-login/google-cloud-os-login/src/main/resources/META-INF/native-image/com.google.cloud.oslogin.v1beta/reflect-config.json new file mode 100644 index 000000000000..8eabf8f13260 --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/main/resources/META-INF/native-image/com.google.cloud.oslogin.v1beta/reflect-config.json @@ -0,0 +1,1631 @@ +[ + { + "name": "com.google.api.BatchingConfigProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingConfigProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FlowControlLimitExceededBehaviorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.common.OsLoginProto$OperatingSystemType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.common.OsLoginProto$PosixAccount", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.common.OsLoginProto$PosixAccount$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.common.OsLoginProto$SshPublicKey", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.common.OsLoginProto$SshPublicKey$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.GetLoginProfileRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.GetLoginProfileRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.LoginProfile", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.LoginProfile$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.LoginProfileView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.SecurityKey", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.SecurityKey$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.UniversalTwoFactor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.UniversalTwoFactor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.WebAuthn", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.oslogin.v1beta.WebAuthn$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnforceNamingStyle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$DefaultSymbolVisibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SymbolVisibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/MockOsLoginService.java b/java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/MockOsLoginService.java new file mode 100644 index 000000000000..8c6fa62b474a --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/MockOsLoginService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 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.oslogin.v1beta; + +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 MockOsLoginService implements MockGrpcService { + private final MockOsLoginServiceImpl serviceImpl; + + public MockOsLoginService() { + serviceImpl = new MockOsLoginServiceImpl(); + } + + @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-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/MockOsLoginServiceImpl.java b/java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/MockOsLoginServiceImpl.java new file mode 100644 index 000000000000..836f7034af9a --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/MockOsLoginServiceImpl.java @@ -0,0 +1,233 @@ +/* + * Copyright 2026 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.oslogin.v1beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.oslogin.common.OsLoginProto; +import com.google.cloud.oslogin.v1beta.OsLoginServiceGrpc.OsLoginServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +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 MockOsLoginServiceImpl extends OsLoginServiceImplBase { + private List requests; + private Queue responses; + + public MockOsLoginServiceImpl() { + 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 createSshPublicKey( + CreateSshPublicKeyRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof OsLoginProto.SshPublicKey) { + requests.add(request); + responseObserver.onNext(((OsLoginProto.SshPublicKey) 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 CreateSshPublicKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + OsLoginProto.SshPublicKey.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deletePosixAccount( + DeletePosixAccountRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeletePosixAccount, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSshPublicKey( + DeleteSshPublicKeyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteSshPublicKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLoginProfile( + GetLoginProfileRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LoginProfile) { + requests.add(request); + responseObserver.onNext(((LoginProfile) 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 GetLoginProfile, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LoginProfile.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSshPublicKey( + GetSshPublicKeyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof OsLoginProto.SshPublicKey) { + requests.add(request); + responseObserver.onNext(((OsLoginProto.SshPublicKey) 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 GetSshPublicKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + OsLoginProto.SshPublicKey.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void importSshPublicKey( + ImportSshPublicKeyRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ImportSshPublicKeyResponse) { + requests.add(request); + responseObserver.onNext(((ImportSshPublicKeyResponse) 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 ImportSshPublicKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ImportSshPublicKeyResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSshPublicKey( + UpdateSshPublicKeyRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof OsLoginProto.SshPublicKey) { + requests.add(request); + responseObserver.onNext(((OsLoginProto.SshPublicKey) 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 UpdateSshPublicKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + OsLoginProto.SshPublicKey.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void signSshPublicKey( + SignSshPublicKeyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SignSshPublicKeyResponse) { + requests.add(request); + responseObserver.onNext(((SignSshPublicKeyResponse) 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 SignSshPublicKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SignSshPublicKeyResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClientHttpJsonTest.java b/java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..4eda6fd8c827 --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClientHttpJsonTest.java @@ -0,0 +1,969 @@ +/* + * Copyright 2026 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.oslogin.v1beta; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.oslogin.common.OsLoginProto; +import com.google.cloud.oslogin.v1.FingerprintName; +import com.google.cloud.oslogin.v1.ProjectName; +import com.google.cloud.oslogin.v1.UserName; +import com.google.cloud.oslogin.v1beta.stub.HttpJsonOsLoginServiceStub; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class OsLoginServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static OsLoginServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonOsLoginServiceStub.getMethodDescriptors(), + OsLoginServiceSettings.getDefaultEndpoint()); + OsLoginServiceSettings settings = + OsLoginServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + OsLoginServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = OsLoginServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createSshPublicKeyTest() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = client.createSshPublicKey(parent, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSshPublicKeyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.createSshPublicKey(parent, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSshPublicKeyTest2() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "users/user-1015"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = client.createSshPublicKey(parent, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSshPublicKeyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "users/user-1015"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.createSshPublicKey(parent, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePosixAccountTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectName name = ProjectName.of("[USER]", "[PROJECT]"); + + client.deletePosixAccount(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deletePosixAccountExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName name = ProjectName.of("[USER]", "[PROJECT]"); + client.deletePosixAccount(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePosixAccountTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-9716/projects/project-9716"; + + client.deletePosixAccount(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deletePosixAccountExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-9716/projects/project-9716"; + client.deletePosixAccount(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSshPublicKeyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + + client.deleteSshPublicKey(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSshPublicKeyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + client.deleteSshPublicKey(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSshPublicKeyTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-7353/sshPublicKeys/sshPublicKey-7353"; + + client.deleteSshPublicKey(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSshPublicKeyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-7353/sshPublicKeys/sshPublicKey-7353"; + client.deleteSshPublicKey(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLoginProfileTest() throws Exception { + LoginProfile expectedResponse = + LoginProfile.newBuilder() + .setName("name3373707") + .addAllPosixAccounts(new ArrayList()) + .putAllSshPublicKeys(new HashMap()) + .addAllSecurityKeys(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + LoginProfile actualResponse = client.getLoginProfile(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLoginProfileExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.getLoginProfile(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLoginProfileTest2() throws Exception { + LoginProfile expectedResponse = + LoginProfile.newBuilder() + .setName("name3373707") + .addAllPosixAccounts(new ArrayList()) + .putAllSshPublicKeys(new HashMap()) + .addAllSecurityKeys(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-6376"; + + LoginProfile actualResponse = client.getLoginProfile(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLoginProfileExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-6376"; + client.getLoginProfile(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSshPublicKeyTest() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + + OsLoginProto.SshPublicKey actualResponse = client.getSshPublicKey(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSshPublicKeyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + client.getSshPublicKey(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSshPublicKeyTest2() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-7353/sshPublicKeys/sshPublicKey-7353"; + + OsLoginProto.SshPublicKey actualResponse = client.getSshPublicKey(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSshPublicKeyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-7353/sshPublicKeys/sshPublicKey-7353"; + client.getSshPublicKey(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importSshPublicKeyTest() throws Exception { + ImportSshPublicKeyResponse expectedResponse = + ImportSshPublicKeyResponse.newBuilder() + .setLoginProfile(LoginProfile.newBuilder().build()) + .setDetails("details1557721666") + .build(); + mockService.addResponse(expectedResponse); + + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + ImportSshPublicKeyResponse actualResponse = client.importSshPublicKey(parent, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void importSshPublicKeyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.importSshPublicKey(parent, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importSshPublicKeyTest2() throws Exception { + ImportSshPublicKeyResponse expectedResponse = + ImportSshPublicKeyResponse.newBuilder() + .setLoginProfile(LoginProfile.newBuilder().build()) + .setDetails("details1557721666") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "users/user-1015"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + ImportSshPublicKeyResponse actualResponse = client.importSshPublicKey(parent, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void importSshPublicKeyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "users/user-1015"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.importSshPublicKey(parent, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importSshPublicKeyTest3() throws Exception { + ImportSshPublicKeyResponse expectedResponse = + ImportSshPublicKeyResponse.newBuilder() + .setLoginProfile(LoginProfile.newBuilder().build()) + .setDetails("details1557721666") + .build(); + mockService.addResponse(expectedResponse); + + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + String projectId = "projectId-894832108"; + + ImportSshPublicKeyResponse actualResponse = + client.importSshPublicKey(parent, sshPublicKey, projectId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void importSshPublicKeyExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + String projectId = "projectId-894832108"; + client.importSshPublicKey(parent, sshPublicKey, projectId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importSshPublicKeyTest4() throws Exception { + ImportSshPublicKeyResponse expectedResponse = + ImportSshPublicKeyResponse.newBuilder() + .setLoginProfile(LoginProfile.newBuilder().build()) + .setDetails("details1557721666") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "users/user-1015"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + String projectId = "projectId-894832108"; + + ImportSshPublicKeyResponse actualResponse = + client.importSshPublicKey(parent, sshPublicKey, projectId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void importSshPublicKeyExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "users/user-1015"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + String projectId = "projectId-894832108"; + client.importSshPublicKey(parent, sshPublicKey, projectId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSshPublicKeyTest() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = client.updateSshPublicKey(name, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateSshPublicKeyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.updateSshPublicKey(name, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSshPublicKeyTest2() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-7353/sshPublicKeys/sshPublicKey-7353"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = client.updateSshPublicKey(name, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateSshPublicKeyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-7353/sshPublicKeys/sshPublicKey-7353"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.updateSshPublicKey(name, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSshPublicKeyTest3() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = + client.updateSshPublicKey(name, sshPublicKey, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateSshPublicKeyExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSshPublicKey(name, sshPublicKey, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSshPublicKeyTest4() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-7353/sshPublicKeys/sshPublicKey-7353"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = + client.updateSshPublicKey(name, sshPublicKey, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateSshPublicKeyExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-7353/sshPublicKeys/sshPublicKey-7353"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSshPublicKey(name, sshPublicKey, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void signSshPublicKeyTest() throws Exception { + SignSshPublicKeyResponse expectedResponse = + SignSshPublicKeyResponse.newBuilder() + .setSignedSshPublicKey("signedSshPublicKey1974899530") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "users/user-514/projects/project-514/zones/zone-514"; + String sshPublicKey = "sshPublicKey1661966862"; + + SignSshPublicKeyResponse actualResponse = client.signSshPublicKey(parent, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void signSshPublicKeyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "users/user-514/projects/project-514/zones/zone-514"; + String sshPublicKey = "sshPublicKey1661966862"; + client.signSshPublicKey(parent, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClientTest.java b/java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClientTest.java new file mode 100644 index 000000000000..a3b284c04648 --- /dev/null +++ b/java-os-login/google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1beta/OsLoginServiceClientTest.java @@ -0,0 +1,874 @@ +/* + * Copyright 2026 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.oslogin.v1beta; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.cloud.oslogin.common.OsLoginProto; +import com.google.cloud.oslogin.v1.FingerprintName; +import com.google.cloud.oslogin.v1.ProjectName; +import com.google.cloud.oslogin.v1.UserName; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class OsLoginServiceClientTest { + private static MockOsLoginService mockOsLoginService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private OsLoginServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockOsLoginService = new MockOsLoginService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockOsLoginService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + OsLoginServiceSettings settings = + OsLoginServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = OsLoginServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSshPublicKeyTest() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockOsLoginService.addResponse(expectedResponse); + + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = client.createSshPublicKey(parent, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSshPublicKeyRequest actualRequest = ((CreateSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(sshPublicKey, actualRequest.getSshPublicKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSshPublicKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.createSshPublicKey(parent, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSshPublicKeyTest2() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockOsLoginService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = client.createSshPublicKey(parent, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSshPublicKeyRequest actualRequest = ((CreateSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(sshPublicKey, actualRequest.getSshPublicKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSshPublicKeyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + String parent = "parent-995424086"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.createSshPublicKey(parent, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePosixAccountTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockOsLoginService.addResponse(expectedResponse); + + ProjectName name = ProjectName.of("[USER]", "[PROJECT]"); + + client.deletePosixAccount(name); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePosixAccountRequest actualRequest = ((DeletePosixAccountRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePosixAccountExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + ProjectName name = ProjectName.of("[USER]", "[PROJECT]"); + client.deletePosixAccount(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePosixAccountTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockOsLoginService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deletePosixAccount(name); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePosixAccountRequest actualRequest = ((DeletePosixAccountRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePosixAccountExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + String name = "name3373707"; + client.deletePosixAccount(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSshPublicKeyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockOsLoginService.addResponse(expectedResponse); + + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + + client.deleteSshPublicKey(name); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSshPublicKeyRequest actualRequest = ((DeleteSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSshPublicKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + client.deleteSshPublicKey(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSshPublicKeyTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockOsLoginService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteSshPublicKey(name); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSshPublicKeyRequest actualRequest = ((DeleteSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSshPublicKeyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + String name = "name3373707"; + client.deleteSshPublicKey(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLoginProfileTest() throws Exception { + LoginProfile expectedResponse = + LoginProfile.newBuilder() + .setName("name3373707") + .addAllPosixAccounts(new ArrayList()) + .putAllSshPublicKeys(new HashMap()) + .addAllSecurityKeys(new ArrayList()) + .build(); + mockOsLoginService.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + LoginProfile actualResponse = client.getLoginProfile(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLoginProfileRequest actualRequest = ((GetLoginProfileRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLoginProfileExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.getLoginProfile(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLoginProfileTest2() throws Exception { + LoginProfile expectedResponse = + LoginProfile.newBuilder() + .setName("name3373707") + .addAllPosixAccounts(new ArrayList()) + .putAllSshPublicKeys(new HashMap()) + .addAllSecurityKeys(new ArrayList()) + .build(); + mockOsLoginService.addResponse(expectedResponse); + + String name = "name3373707"; + + LoginProfile actualResponse = client.getLoginProfile(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLoginProfileRequest actualRequest = ((GetLoginProfileRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLoginProfileExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + String name = "name3373707"; + client.getLoginProfile(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSshPublicKeyTest() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockOsLoginService.addResponse(expectedResponse); + + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + + OsLoginProto.SshPublicKey actualResponse = client.getSshPublicKey(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSshPublicKeyRequest actualRequest = ((GetSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSshPublicKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + client.getSshPublicKey(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSshPublicKeyTest2() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockOsLoginService.addResponse(expectedResponse); + + String name = "name3373707"; + + OsLoginProto.SshPublicKey actualResponse = client.getSshPublicKey(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSshPublicKeyRequest actualRequest = ((GetSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSshPublicKeyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + String name = "name3373707"; + client.getSshPublicKey(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importSshPublicKeyTest() throws Exception { + ImportSshPublicKeyResponse expectedResponse = + ImportSshPublicKeyResponse.newBuilder() + .setLoginProfile(LoginProfile.newBuilder().build()) + .setDetails("details1557721666") + .build(); + mockOsLoginService.addResponse(expectedResponse); + + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + ImportSshPublicKeyResponse actualResponse = client.importSshPublicKey(parent, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportSshPublicKeyRequest actualRequest = ((ImportSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(sshPublicKey, actualRequest.getSshPublicKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importSshPublicKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.importSshPublicKey(parent, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importSshPublicKeyTest2() throws Exception { + ImportSshPublicKeyResponse expectedResponse = + ImportSshPublicKeyResponse.newBuilder() + .setLoginProfile(LoginProfile.newBuilder().build()) + .setDetails("details1557721666") + .build(); + mockOsLoginService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + ImportSshPublicKeyResponse actualResponse = client.importSshPublicKey(parent, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportSshPublicKeyRequest actualRequest = ((ImportSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(sshPublicKey, actualRequest.getSshPublicKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importSshPublicKeyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + String parent = "parent-995424086"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.importSshPublicKey(parent, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importSshPublicKeyTest3() throws Exception { + ImportSshPublicKeyResponse expectedResponse = + ImportSshPublicKeyResponse.newBuilder() + .setLoginProfile(LoginProfile.newBuilder().build()) + .setDetails("details1557721666") + .build(); + mockOsLoginService.addResponse(expectedResponse); + + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + String projectId = "projectId-894832108"; + + ImportSshPublicKeyResponse actualResponse = + client.importSshPublicKey(parent, sshPublicKey, projectId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportSshPublicKeyRequest actualRequest = ((ImportSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(sshPublicKey, actualRequest.getSshPublicKey()); + Assert.assertEquals(projectId, actualRequest.getProjectId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importSshPublicKeyExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + UserName parent = UserName.of("[USER]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + String projectId = "projectId-894832108"; + client.importSshPublicKey(parent, sshPublicKey, projectId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importSshPublicKeyTest4() throws Exception { + ImportSshPublicKeyResponse expectedResponse = + ImportSshPublicKeyResponse.newBuilder() + .setLoginProfile(LoginProfile.newBuilder().build()) + .setDetails("details1557721666") + .build(); + mockOsLoginService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + String projectId = "projectId-894832108"; + + ImportSshPublicKeyResponse actualResponse = + client.importSshPublicKey(parent, sshPublicKey, projectId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportSshPublicKeyRequest actualRequest = ((ImportSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(sshPublicKey, actualRequest.getSshPublicKey()); + Assert.assertEquals(projectId, actualRequest.getProjectId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importSshPublicKeyExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + String parent = "parent-995424086"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + String projectId = "projectId-894832108"; + client.importSshPublicKey(parent, sshPublicKey, projectId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSshPublicKeyTest() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockOsLoginService.addResponse(expectedResponse); + + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = client.updateSshPublicKey(name, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSshPublicKeyRequest actualRequest = ((UpdateSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(sshPublicKey, actualRequest.getSshPublicKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSshPublicKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.updateSshPublicKey(name, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSshPublicKeyTest2() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockOsLoginService.addResponse(expectedResponse); + + String name = "name3373707"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = client.updateSshPublicKey(name, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSshPublicKeyRequest actualRequest = ((UpdateSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(sshPublicKey, actualRequest.getSshPublicKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSshPublicKeyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + String name = "name3373707"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + client.updateSshPublicKey(name, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSshPublicKeyTest3() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockOsLoginService.addResponse(expectedResponse); + + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = + client.updateSshPublicKey(name, sshPublicKey, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSshPublicKeyRequest actualRequest = ((UpdateSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(sshPublicKey, actualRequest.getSshPublicKey()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSshPublicKeyExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSshPublicKey(name, sshPublicKey, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSshPublicKeyTest4() throws Exception { + OsLoginProto.SshPublicKey expectedResponse = + OsLoginProto.SshPublicKey.newBuilder() + .setKey("key106079") + .setExpirationTimeUsec(-2058878882) + .setFingerprint("fingerprint-1375934236") + .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + .build(); + mockOsLoginService.addResponse(expectedResponse); + + String name = "name3373707"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + OsLoginProto.SshPublicKey actualResponse = + client.updateSshPublicKey(name, sshPublicKey, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSshPublicKeyRequest actualRequest = ((UpdateSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(sshPublicKey, actualRequest.getSshPublicKey()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSshPublicKeyExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + String name = "name3373707"; + OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSshPublicKey(name, sshPublicKey, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void signSshPublicKeyTest() throws Exception { + SignSshPublicKeyResponse expectedResponse = + SignSshPublicKeyResponse.newBuilder() + .setSignedSshPublicKey("signedSshPublicKey1974899530") + .build(); + mockOsLoginService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String sshPublicKey = "sshPublicKey1661966862"; + + SignSshPublicKeyResponse actualResponse = client.signSshPublicKey(parent, sshPublicKey); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsLoginService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SignSshPublicKeyRequest actualRequest = ((SignSshPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(sshPublicKey, actualRequest.getSshPublicKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void signSshPublicKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsLoginService.addException(exception); + + try { + String parent = "parent-995424086"; + String sshPublicKey = "sshPublicKey1661966862"; + client.signSshPublicKey(parent, sshPublicKey); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-os-login/grpc-google-cloud-os-login-v1beta/pom.xml b/java-os-login/grpc-google-cloud-os-login-v1beta/pom.xml new file mode 100644 index 000000000000..134832889801 --- /dev/null +++ b/java-os-login/grpc-google-cloud-os-login-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-os-login-v1beta + 2.90.0 + grpc-google-cloud-os-login-v1beta + GRPC library for google-cloud-os-login + + com.google.cloud + google-cloud-os-login-parent + 2.90.0 + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-os-login-v1beta + + + com.google.guava + guava + + + diff --git a/java-os-login/grpc-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceGrpc.java b/java-os-login/grpc-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceGrpc.java new file mode 100644 index 000000000000..f5fe9cea1612 --- /dev/null +++ b/java-os-login/grpc-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginServiceGrpc.java @@ -0,0 +1,1392 @@ +/* + * Copyright 2026 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.oslogin.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Cloud OS Login API
+ * The Cloud OS Login API allows you to manage users and their associated SSH
+ * public keys for logging into virtual machines on Google Cloud Platform.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class OsLoginServiceGrpc { + + private OsLoginServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.oslogin.v1beta.OsLoginService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getCreateSshPublicKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSshPublicKey", + requestType = com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest.class, + responseType = com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getCreateSshPublicKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getCreateSshPublicKeyMethod; + if ((getCreateSshPublicKeyMethod = OsLoginServiceGrpc.getCreateSshPublicKeyMethod) == null) { + synchronized (OsLoginServiceGrpc.class) { + if ((getCreateSshPublicKeyMethod = OsLoginServiceGrpc.getCreateSshPublicKeyMethod) + == null) { + OsLoginServiceGrpc.getCreateSshPublicKeyMethod = + getCreateSshPublicKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSshPublicKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey + .getDefaultInstance())) + .setSchemaDescriptor( + new OsLoginServiceMethodDescriptorSupplier("CreateSshPublicKey")) + .build(); + } + } + } + return getCreateSshPublicKeyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest, com.google.protobuf.Empty> + getDeletePosixAccountMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePosixAccount", + requestType = com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest, com.google.protobuf.Empty> + getDeletePosixAccountMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest, com.google.protobuf.Empty> + getDeletePosixAccountMethod; + if ((getDeletePosixAccountMethod = OsLoginServiceGrpc.getDeletePosixAccountMethod) == null) { + synchronized (OsLoginServiceGrpc.class) { + if ((getDeletePosixAccountMethod = OsLoginServiceGrpc.getDeletePosixAccountMethod) + == null) { + OsLoginServiceGrpc.getDeletePosixAccountMethod = + getDeletePosixAccountMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeletePosixAccount")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new OsLoginServiceMethodDescriptorSupplier("DeletePosixAccount")) + .build(); + } + } + } + return getDeletePosixAccountMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest, com.google.protobuf.Empty> + getDeleteSshPublicKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSshPublicKey", + requestType = com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest, com.google.protobuf.Empty> + getDeleteSshPublicKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest, com.google.protobuf.Empty> + getDeleteSshPublicKeyMethod; + if ((getDeleteSshPublicKeyMethod = OsLoginServiceGrpc.getDeleteSshPublicKeyMethod) == null) { + synchronized (OsLoginServiceGrpc.class) { + if ((getDeleteSshPublicKeyMethod = OsLoginServiceGrpc.getDeleteSshPublicKeyMethod) + == null) { + OsLoginServiceGrpc.getDeleteSshPublicKeyMethod = + getDeleteSshPublicKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSshPublicKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new OsLoginServiceMethodDescriptorSupplier("DeleteSshPublicKey")) + .build(); + } + } + } + return getDeleteSshPublicKeyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest, + com.google.cloud.oslogin.v1beta.LoginProfile> + getGetLoginProfileMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetLoginProfile", + requestType = com.google.cloud.oslogin.v1beta.GetLoginProfileRequest.class, + responseType = com.google.cloud.oslogin.v1beta.LoginProfile.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest, + com.google.cloud.oslogin.v1beta.LoginProfile> + getGetLoginProfileMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest, + com.google.cloud.oslogin.v1beta.LoginProfile> + getGetLoginProfileMethod; + if ((getGetLoginProfileMethod = OsLoginServiceGrpc.getGetLoginProfileMethod) == null) { + synchronized (OsLoginServiceGrpc.class) { + if ((getGetLoginProfileMethod = OsLoginServiceGrpc.getGetLoginProfileMethod) == null) { + OsLoginServiceGrpc.getGetLoginProfileMethod = + getGetLoginProfileMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetLoginProfile")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.v1beta.LoginProfile.getDefaultInstance())) + .setSchemaDescriptor( + new OsLoginServiceMethodDescriptorSupplier("GetLoginProfile")) + .build(); + } + } + } + return getGetLoginProfileMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getGetSshPublicKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSshPublicKey", + requestType = com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.class, + responseType = com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getGetSshPublicKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getGetSshPublicKeyMethod; + if ((getGetSshPublicKeyMethod = OsLoginServiceGrpc.getGetSshPublicKeyMethod) == null) { + synchronized (OsLoginServiceGrpc.class) { + if ((getGetSshPublicKeyMethod = OsLoginServiceGrpc.getGetSshPublicKeyMethod) == null) { + OsLoginServiceGrpc.getGetSshPublicKeyMethod = + getGetSshPublicKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSshPublicKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey + .getDefaultInstance())) + .setSchemaDescriptor( + new OsLoginServiceMethodDescriptorSupplier("GetSshPublicKey")) + .build(); + } + } + } + return getGetSshPublicKeyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest, + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse> + getImportSshPublicKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportSshPublicKey", + requestType = com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.class, + responseType = com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest, + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse> + getImportSshPublicKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest, + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse> + getImportSshPublicKeyMethod; + if ((getImportSshPublicKeyMethod = OsLoginServiceGrpc.getImportSshPublicKeyMethod) == null) { + synchronized (OsLoginServiceGrpc.class) { + if ((getImportSshPublicKeyMethod = OsLoginServiceGrpc.getImportSshPublicKeyMethod) + == null) { + OsLoginServiceGrpc.getImportSshPublicKeyMethod = + getImportSshPublicKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportSshPublicKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new OsLoginServiceMethodDescriptorSupplier("ImportSshPublicKey")) + .build(); + } + } + } + return getImportSshPublicKeyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getUpdateSshPublicKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSshPublicKey", + requestType = com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.class, + responseType = com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getUpdateSshPublicKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getUpdateSshPublicKeyMethod; + if ((getUpdateSshPublicKeyMethod = OsLoginServiceGrpc.getUpdateSshPublicKeyMethod) == null) { + synchronized (OsLoginServiceGrpc.class) { + if ((getUpdateSshPublicKeyMethod = OsLoginServiceGrpc.getUpdateSshPublicKeyMethod) + == null) { + OsLoginServiceGrpc.getUpdateSshPublicKeyMethod = + getUpdateSshPublicKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSshPublicKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey + .getDefaultInstance())) + .setSchemaDescriptor( + new OsLoginServiceMethodDescriptorSupplier("UpdateSshPublicKey")) + .build(); + } + } + } + return getUpdateSshPublicKeyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest, + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse> + getSignSshPublicKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SignSshPublicKey", + requestType = com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest.class, + responseType = com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest, + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse> + getSignSshPublicKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest, + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse> + getSignSshPublicKeyMethod; + if ((getSignSshPublicKeyMethod = OsLoginServiceGrpc.getSignSshPublicKeyMethod) == null) { + synchronized (OsLoginServiceGrpc.class) { + if ((getSignSshPublicKeyMethod = OsLoginServiceGrpc.getSignSshPublicKeyMethod) == null) { + OsLoginServiceGrpc.getSignSshPublicKeyMethod = + getSignSshPublicKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SignSshPublicKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new OsLoginServiceMethodDescriptorSupplier("SignSshPublicKey")) + .build(); + } + } + } + return getSignSshPublicKeyMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static OsLoginServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OsLoginServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsLoginServiceStub(channel, callOptions); + } + }; + return OsLoginServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static OsLoginServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OsLoginServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsLoginServiceBlockingV2Stub(channel, callOptions); + } + }; + return OsLoginServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static OsLoginServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OsLoginServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsLoginServiceBlockingStub(channel, callOptions); + } + }; + return OsLoginServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static OsLoginServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OsLoginServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsLoginServiceFutureStub(channel, callOptions); + } + }; + return OsLoginServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Cloud OS Login API
+   * The Cloud OS Login API allows you to manage users and their associated SSH
+   * public keys for logging into virtual machines on Google Cloud Platform.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Create an SSH public key
+     * 
+ */ + default void createSshPublicKey( + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSshPublicKeyMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a POSIX account.
+     * 
+ */ + default void deletePosixAccount( + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeletePosixAccountMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes an SSH public key.
+     * 
+ */ + default void deleteSshPublicKey( + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSshPublicKeyMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the profile information used for logging in to a virtual machine
+     * on Google Compute Engine.
+     * 
+ */ + default void getLoginProfile( + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetLoginProfileMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves an SSH public key.
+     * 
+ */ + default void getSshPublicKey( + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSshPublicKeyMethod(), responseObserver); + } + + /** + * + * + *
+     * Adds an SSH public key and returns the profile information. Default POSIX
+     * account information is set when no username and UID exist as part of the
+     * login profile.
+     * 
+ */ + default void importSshPublicKey( + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportSshPublicKeyMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an SSH public key and returns the profile information. This method
+     * supports patch semantics.
+     * 
+ */ + default void updateSshPublicKey( + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateSshPublicKeyMethod(), responseObserver); + } + + /** + * + * + *
+     * Signs an SSH public key for a user to authenticate to an instance.
+     * 
+ */ + default void signSshPublicKey( + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSignSshPublicKeyMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service OsLoginService. + * + *
+   * Cloud OS Login API
+   * The Cloud OS Login API allows you to manage users and their associated SSH
+   * public keys for logging into virtual machines on Google Cloud Platform.
+   * 
+ */ + public abstract static class OsLoginServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return OsLoginServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service OsLoginService. + * + *
+   * Cloud OS Login API
+   * The Cloud OS Login API allows you to manage users and their associated SSH
+   * public keys for logging into virtual machines on Google Cloud Platform.
+   * 
+ */ + public static final class OsLoginServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private OsLoginServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OsLoginServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsLoginServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Create an SSH public key
+     * 
+ */ + public void createSshPublicKey( + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSshPublicKeyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a POSIX account.
+     * 
+ */ + public void deletePosixAccount( + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeletePosixAccountMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes an SSH public key.
+     * 
+ */ + public void deleteSshPublicKey( + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSshPublicKeyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves the profile information used for logging in to a virtual machine
+     * on Google Compute Engine.
+     * 
+ */ + public void getLoginProfile( + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetLoginProfileMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves an SSH public key.
+     * 
+ */ + public void getSshPublicKey( + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSshPublicKeyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Adds an SSH public key and returns the profile information. Default POSIX
+     * account information is set when no username and UID exist as part of the
+     * login profile.
+     * 
+ */ + public void importSshPublicKey( + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportSshPublicKeyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an SSH public key and returns the profile information. This method
+     * supports patch semantics.
+     * 
+ */ + public void updateSshPublicKey( + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSshPublicKeyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Signs an SSH public key for a user to authenticate to an instance.
+     * 
+ */ + public void signSshPublicKey( + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSignSshPublicKeyMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service OsLoginService. + * + *
+   * Cloud OS Login API
+   * The Cloud OS Login API allows you to manage users and their associated SSH
+   * public keys for logging into virtual machines on Google Cloud Platform.
+   * 
+ */ + public static final class OsLoginServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private OsLoginServiceBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OsLoginServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsLoginServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Create an SSH public key
+     * 
+ */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey createSshPublicKey( + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSshPublicKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a POSIX account.
+     * 
+ */ + public com.google.protobuf.Empty deletePosixAccount( + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeletePosixAccountMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an SSH public key.
+     * 
+ */ + public com.google.protobuf.Empty deleteSshPublicKey( + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteSshPublicKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the profile information used for logging in to a virtual machine
+     * on Google Compute Engine.
+     * 
+ */ + public com.google.cloud.oslogin.v1beta.LoginProfile getLoginProfile( + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetLoginProfileMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves an SSH public key.
+     * 
+ */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKey( + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSshPublicKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Adds an SSH public key and returns the profile information. Default POSIX
+     * account information is set when no username and UID exist as part of the
+     * login profile.
+     * 
+ */ + public com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse importSshPublicKey( + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getImportSshPublicKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an SSH public key and returns the profile information. This method
+     * supports patch semantics.
+     * 
+ */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey updateSshPublicKey( + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateSshPublicKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Signs an SSH public key for a user to authenticate to an instance.
+     * 
+ */ + public com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse signSshPublicKey( + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSignSshPublicKeyMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service OsLoginService. + * + *
+   * Cloud OS Login API
+   * The Cloud OS Login API allows you to manage users and their associated SSH
+   * public keys for logging into virtual machines on Google Cloud Platform.
+   * 
+ */ + public static final class OsLoginServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private OsLoginServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OsLoginServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsLoginServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Create an SSH public key
+     * 
+ */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey createSshPublicKey( + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSshPublicKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a POSIX account.
+     * 
+ */ + public com.google.protobuf.Empty deletePosixAccount( + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePosixAccountMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an SSH public key.
+     * 
+ */ + public com.google.protobuf.Empty deleteSshPublicKey( + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSshPublicKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the profile information used for logging in to a virtual machine
+     * on Google Compute Engine.
+     * 
+ */ + public com.google.cloud.oslogin.v1beta.LoginProfile getLoginProfile( + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetLoginProfileMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves an SSH public key.
+     * 
+ */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKey( + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSshPublicKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Adds an SSH public key and returns the profile information. Default POSIX
+     * account information is set when no username and UID exist as part of the
+     * login profile.
+     * 
+ */ + public com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse importSshPublicKey( + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportSshPublicKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an SSH public key and returns the profile information. This method
+     * supports patch semantics.
+     * 
+ */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey updateSshPublicKey( + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSshPublicKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Signs an SSH public key for a user to authenticate to an instance.
+     * 
+ */ + public com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse signSshPublicKey( + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSignSshPublicKeyMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service OsLoginService. + * + *
+   * Cloud OS Login API
+   * The Cloud OS Login API allows you to manage users and their associated SSH
+   * public keys for logging into virtual machines on Google Cloud Platform.
+   * 
+ */ + public static final class OsLoginServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private OsLoginServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OsLoginServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsLoginServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Create an SSH public key
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + createSshPublicKey(com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSshPublicKeyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a POSIX account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deletePosixAccount(com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeletePosixAccountMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes an SSH public key.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSshPublicKey(com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSshPublicKeyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the profile information used for logging in to a virtual machine
+     * on Google Compute Engine.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.oslogin.v1beta.LoginProfile> + getLoginProfile(com.google.cloud.oslogin.v1beta.GetLoginProfileRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetLoginProfileMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves an SSH public key.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getSshPublicKey(com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSshPublicKeyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Adds an SSH public key and returns the profile information. Default POSIX
+     * account information is set when no username and UID exist as part of the
+     * login profile.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse> + importSshPublicKey(com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportSshPublicKeyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an SSH public key and returns the profile information. This method
+     * supports patch semantics.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + updateSshPublicKey(com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSshPublicKeyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Signs an SSH public key for a user to authenticate to an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse> + signSshPublicKey(com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSignSshPublicKeyMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SSH_PUBLIC_KEY = 0; + private static final int METHODID_DELETE_POSIX_ACCOUNT = 1; + private static final int METHODID_DELETE_SSH_PUBLIC_KEY = 2; + private static final int METHODID_GET_LOGIN_PROFILE = 3; + private static final int METHODID_GET_SSH_PUBLIC_KEY = 4; + private static final int METHODID_IMPORT_SSH_PUBLIC_KEY = 5; + private static final int METHODID_UPDATE_SSH_PUBLIC_KEY = 6; + private static final int METHODID_SIGN_SSH_PUBLIC_KEY = 7; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_SSH_PUBLIC_KEY: + serviceImpl.createSshPublicKey( + (com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey>) + responseObserver); + break; + case METHODID_DELETE_POSIX_ACCOUNT: + serviceImpl.deletePosixAccount( + (com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SSH_PUBLIC_KEY: + serviceImpl.deleteSshPublicKey( + (com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_LOGIN_PROFILE: + serviceImpl.getLoginProfile( + (com.google.cloud.oslogin.v1beta.GetLoginProfileRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SSH_PUBLIC_KEY: + serviceImpl.getSshPublicKey( + (com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey>) + responseObserver); + break; + case METHODID_IMPORT_SSH_PUBLIC_KEY: + serviceImpl.importSshPublicKey( + (com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse>) + responseObserver); + break; + case METHODID_UPDATE_SSH_PUBLIC_KEY: + serviceImpl.updateSshPublicKey( + (com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey>) + responseObserver); + break; + case METHODID_SIGN_SSH_PUBLIC_KEY: + serviceImpl.signSshPublicKey( + (com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSshPublicKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey>( + service, METHODID_CREATE_SSH_PUBLIC_KEY))) + .addMethod( + getDeletePosixAccountMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_POSIX_ACCOUNT))) + .addMethod( + getDeleteSshPublicKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_SSH_PUBLIC_KEY))) + .addMethod( + getGetLoginProfileMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest, + com.google.cloud.oslogin.v1beta.LoginProfile>( + service, METHODID_GET_LOGIN_PROFILE))) + .addMethod( + getGetSshPublicKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey>( + service, METHODID_GET_SSH_PUBLIC_KEY))) + .addMethod( + getImportSshPublicKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest, + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse>( + service, METHODID_IMPORT_SSH_PUBLIC_KEY))) + .addMethod( + getUpdateSshPublicKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey>( + service, METHODID_UPDATE_SSH_PUBLIC_KEY))) + .addMethod( + getSignSshPublicKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest, + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse>( + service, METHODID_SIGN_SSH_PUBLIC_KEY))) + .build(); + } + + private abstract static class OsLoginServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + OsLoginServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("OsLoginService"); + } + } + + private static final class OsLoginServiceFileDescriptorSupplier + extends OsLoginServiceBaseDescriptorSupplier { + OsLoginServiceFileDescriptorSupplier() {} + } + + private static final class OsLoginServiceMethodDescriptorSupplier + extends OsLoginServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + OsLoginServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (OsLoginServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new OsLoginServiceFileDescriptorSupplier()) + .addMethod(getCreateSshPublicKeyMethod()) + .addMethod(getDeletePosixAccountMethod()) + .addMethod(getDeleteSshPublicKeyMethod()) + .addMethod(getGetLoginProfileMethod()) + .addMethod(getGetSshPublicKeyMethod()) + .addMethod(getImportSshPublicKeyMethod()) + .addMethod(getUpdateSshPublicKeyMethod()) + .addMethod(getSignSshPublicKeyMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-os-login/pom.xml b/java-os-login/pom.xml index eba0434ad1b0..752448fab2bb 100644 --- a/java-os-login/pom.xml +++ b/java-os-login/pom.xml @@ -31,6 +31,16 @@ proto-google-cloud-os-login-v1 2.90.0 + + com.google.api.grpc + proto-google-cloud-os-login-v1beta + 2.90.0 + + + com.google.api.grpc + grpc-google-cloud-os-login-v1beta + 2.90.0 + com.google.api.grpc grpc-google-cloud-os-login-v1 @@ -47,7 +57,9 @@ google-cloud-os-login grpc-google-cloud-os-login-v1 + grpc-google-cloud-os-login-v1beta proto-google-cloud-os-login-v1 + proto-google-cloud-os-login-v1beta google-cloud-os-login-bom diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/clirr-ignored-differences.xml b/java-os-login/proto-google-cloud-os-login-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..a751b491485b --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,80 @@ + + + + + 7012 + com/google/cloud/oslogin/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/oslogin/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/oslogin/v1beta/*OrBuilder + boolean has*(*) + + + + 7006 + com/google/cloud/oslogin/v1beta/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/cloud/oslogin/v1beta/** + * addRepeatedField(*) + ** + + + 7006 + com/google/cloud/oslogin/v1beta/** + * clear() + ** + + + 7006 + com/google/cloud/oslogin/v1beta/** + * clearField(*) + ** + + + 7006 + com/google/cloud/oslogin/v1beta/** + * clearOneof(*) + ** + + + 7006 + com/google/cloud/oslogin/v1beta/** + * clone() + ** + + + 7006 + com/google/cloud/oslogin/v1beta/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/cloud/oslogin/v1beta/** + * setField(*) + ** + + + 7006 + com/google/cloud/oslogin/v1beta/** + * setRepeatedField(*) + ** + + + 7006 + com/google/cloud/oslogin/v1beta/** + * setUnknownFields(*) + ** + + diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/pom.xml b/java-os-login/proto-google-cloud-os-login-v1beta/pom.xml new file mode 100644 index 000000000000..d7623d3f4a31 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-os-login-v1beta + 2.90.0 + proto-google-cloud-os-login-v1beta + Proto library for google-cloud-os-login + + com.google.cloud + google-cloud-os-login-parent + 2.90.0 + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/OsLoginProto.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/OsLoginProto.java new file mode 100644 index 000000000000..ffcc9dc2d758 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/OsLoginProto.java @@ -0,0 +1,3904 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/common/common.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.common; + +@com.google.protobuf.Generated +public final class OsLoginProto extends com.google.protobuf.GeneratedFile { + private OsLoginProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OsLoginProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + /** + * + * + *
+   * The operating system options for account entries.
+   * 
+ * + * Protobuf enum {@code google.cloud.oslogin.common.OperatingSystemType} + */ + public enum OperatingSystemType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The operating system type associated with the user account information is
+     * unspecified.
+     * 
+ * + * OPERATING_SYSTEM_TYPE_UNSPECIFIED = 0; + */ + OPERATING_SYSTEM_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Linux user account information.
+     * 
+ * + * LINUX = 1; + */ + LINUX(1), + /** + * + * + *
+     * Windows user account information.
+     * 
+ * + * WINDOWS = 2; + */ + WINDOWS(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperatingSystemType"); + } + + /** + * + * + *
+     * The operating system type associated with the user account information is
+     * unspecified.
+     * 
+ * + * OPERATING_SYSTEM_TYPE_UNSPECIFIED = 0; + */ + public static final int OPERATING_SYSTEM_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Linux user account information.
+     * 
+ * + * LINUX = 1; + */ + public static final int LINUX_VALUE = 1; + + /** + * + * + *
+     * Windows user account information.
+     * 
+ * + * WINDOWS = 2; + */ + public static final int WINDOWS_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 OperatingSystemType 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 OperatingSystemType forNumber(int value) { + switch (value) { + case 0: + return OPERATING_SYSTEM_TYPE_UNSPECIFIED; + case 1: + return LINUX; + case 2: + return WINDOWS; + 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 OperatingSystemType findValueByNumber(int number) { + return OperatingSystemType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.oslogin.common.OsLoginProto.getDescriptor().getEnumTypes().get(0); + } + + private static final OperatingSystemType[] VALUES = values(); + + public static OperatingSystemType 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 OperatingSystemType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.oslogin.common.OperatingSystemType) + } + + public interface PosixAccountOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.common.PosixAccount) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Only one POSIX account can be marked as primary.
+     * 
+ * + * bool primary = 1; + * + * @return The primary. + */ + boolean getPrimary(); + + /** + * + * + *
+     * The username of the POSIX account.
+     * 
+ * + * string username = 2; + * + * @return The username. + */ + java.lang.String getUsername(); + + /** + * + * + *
+     * The username of the POSIX account.
+     * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+     * The user ID.
+     * 
+ * + * int64 uid = 3; + * + * @return The uid. + */ + long getUid(); + + /** + * + * + *
+     * The default group ID.
+     * 
+ * + * int64 gid = 4; + * + * @return The gid. + */ + long getGid(); + + /** + * + * + *
+     * The path to the home directory for this account.
+     * 
+ * + * string home_directory = 5; + * + * @return The homeDirectory. + */ + java.lang.String getHomeDirectory(); + + /** + * + * + *
+     * The path to the home directory for this account.
+     * 
+ * + * string home_directory = 5; + * + * @return The bytes for homeDirectory. + */ + com.google.protobuf.ByteString getHomeDirectoryBytes(); + + /** + * + * + *
+     * The path to the logic shell for this account.
+     * 
+ * + * string shell = 6; + * + * @return The shell. + */ + java.lang.String getShell(); + + /** + * + * + *
+     * The path to the logic shell for this account.
+     * 
+ * + * string shell = 6; + * + * @return The bytes for shell. + */ + com.google.protobuf.ByteString getShellBytes(); + + /** + * + * + *
+     * The GECOS (user information) entry for this account.
+     * 
+ * + * string gecos = 7; + * + * @return The gecos. + */ + java.lang.String getGecos(); + + /** + * + * + *
+     * The GECOS (user information) entry for this account.
+     * 
+ * + * string gecos = 7; + * + * @return The bytes for gecos. + */ + com.google.protobuf.ByteString getGecosBytes(); + + /** + * + * + *
+     * System identifier for which account the username or uid applies to.
+     * By default, the empty value is used.
+     * 
+ * + * string system_id = 8; + * + * @return The systemId. + */ + java.lang.String getSystemId(); + + /** + * + * + *
+     * System identifier for which account the username or uid applies to.
+     * By default, the empty value is used.
+     * 
+ * + * string system_id = 8; + * + * @return The bytes for systemId. + */ + com.google.protobuf.ByteString getSystemIdBytes(); + + /** + * + * + *
+     * Output only. A POSIX account identifier.
+     * 
+ * + * string account_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The accountId. + */ + java.lang.String getAccountId(); + + /** + * + * + *
+     * Output only. A POSIX account identifier.
+     * 
+ * + * string account_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for accountId. + */ + com.google.protobuf.ByteString getAccountIdBytes(); + + /** + * + * + *
+     * The operating system type where this account applies.
+     * 
+ * + * .google.cloud.oslogin.common.OperatingSystemType operating_system_type = 10; + * + * @return The enum numeric value on the wire for operatingSystemType. + */ + int getOperatingSystemTypeValue(); + + /** + * + * + *
+     * The operating system type where this account applies.
+     * 
+ * + * .google.cloud.oslogin.common.OperatingSystemType operating_system_type = 10; + * + * @return The operatingSystemType. + */ + com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType getOperatingSystemType(); + + /** + * + * + *
+     * Output only. The canonical resource name.
+     * 
+ * + * string name = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * Output only. The canonical resource name.
+     * 
+ * + * string name = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + } + + /** + * + * + *
+   * The POSIX account information associated with a Google account.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.common.PosixAccount} + */ + public static final class PosixAccount extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.common.PosixAccount) + PosixAccountOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PosixAccount"); + } + + // Use PosixAccount.newBuilder() to construct. + private PosixAccount(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PosixAccount() { + username_ = ""; + homeDirectory_ = ""; + shell_ = ""; + gecos_ = ""; + systemId_ = ""; + accountId_ = ""; + operatingSystemType_ = 0; + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.common.OsLoginProto + .internal_static_google_cloud_oslogin_common_PosixAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.common.OsLoginProto + .internal_static_google_cloud_oslogin_common_PosixAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.class, + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.Builder.class); + } + + public static final int PRIMARY_FIELD_NUMBER = 1; + private boolean primary_ = false; + + /** + * + * + *
+     * Only one POSIX account can be marked as primary.
+     * 
+ * + * bool primary = 1; + * + * @return The primary. + */ + @java.lang.Override + public boolean getPrimary() { + return primary_; + } + + public static final int USERNAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object username_ = ""; + + /** + * + * + *
+     * The username of the POSIX account.
+     * 
+ * + * string username = 2; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + 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(); + username_ = s; + return s; + } + } + + /** + * + * + *
+     * The username of the POSIX account.
+     * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UID_FIELD_NUMBER = 3; + private long uid_ = 0L; + + /** + * + * + *
+     * The user ID.
+     * 
+ * + * int64 uid = 3; + * + * @return The uid. + */ + @java.lang.Override + public long getUid() { + return uid_; + } + + public static final int GID_FIELD_NUMBER = 4; + private long gid_ = 0L; + + /** + * + * + *
+     * The default group ID.
+     * 
+ * + * int64 gid = 4; + * + * @return The gid. + */ + @java.lang.Override + public long getGid() { + return gid_; + } + + public static final int HOME_DIRECTORY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object homeDirectory_ = ""; + + /** + * + * + *
+     * The path to the home directory for this account.
+     * 
+ * + * string home_directory = 5; + * + * @return The homeDirectory. + */ + @java.lang.Override + public java.lang.String getHomeDirectory() { + java.lang.Object ref = homeDirectory_; + 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(); + homeDirectory_ = s; + return s; + } + } + + /** + * + * + *
+     * The path to the home directory for this account.
+     * 
+ * + * string home_directory = 5; + * + * @return The bytes for homeDirectory. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHomeDirectoryBytes() { + java.lang.Object ref = homeDirectory_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + homeDirectory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHELL_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object shell_ = ""; + + /** + * + * + *
+     * The path to the logic shell for this account.
+     * 
+ * + * string shell = 6; + * + * @return The shell. + */ + @java.lang.Override + public java.lang.String getShell() { + java.lang.Object ref = shell_; + 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(); + shell_ = s; + return s; + } + } + + /** + * + * + *
+     * The path to the logic shell for this account.
+     * 
+ * + * string shell = 6; + * + * @return The bytes for shell. + */ + @java.lang.Override + public com.google.protobuf.ByteString getShellBytes() { + java.lang.Object ref = shell_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shell_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GECOS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object gecos_ = ""; + + /** + * + * + *
+     * The GECOS (user information) entry for this account.
+     * 
+ * + * string gecos = 7; + * + * @return The gecos. + */ + @java.lang.Override + public java.lang.String getGecos() { + java.lang.Object ref = gecos_; + 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(); + gecos_ = s; + return s; + } + } + + /** + * + * + *
+     * The GECOS (user information) entry for this account.
+     * 
+ * + * string gecos = 7; + * + * @return The bytes for gecos. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGecosBytes() { + java.lang.Object ref = gecos_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gecos_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SYSTEM_ID_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object systemId_ = ""; + + /** + * + * + *
+     * System identifier for which account the username or uid applies to.
+     * By default, the empty value is used.
+     * 
+ * + * string system_id = 8; + * + * @return The systemId. + */ + @java.lang.Override + public java.lang.String getSystemId() { + java.lang.Object ref = systemId_; + 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(); + systemId_ = s; + return s; + } + } + + /** + * + * + *
+     * System identifier for which account the username or uid applies to.
+     * By default, the empty value is used.
+     * 
+ * + * string system_id = 8; + * + * @return The bytes for systemId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSystemIdBytes() { + java.lang.Object ref = systemId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + systemId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCOUNT_ID_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object accountId_ = ""; + + /** + * + * + *
+     * Output only. A POSIX account identifier.
+     * 
+ * + * string account_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The accountId. + */ + @java.lang.Override + public java.lang.String getAccountId() { + java.lang.Object ref = accountId_; + 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(); + accountId_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. A POSIX account identifier.
+     * 
+ * + * string account_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for accountId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAccountIdBytes() { + java.lang.Object ref = accountId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accountId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATING_SYSTEM_TYPE_FIELD_NUMBER = 10; + private int operatingSystemType_ = 0; + + /** + * + * + *
+     * The operating system type where this account applies.
+     * 
+ * + * .google.cloud.oslogin.common.OperatingSystemType operating_system_type = 10; + * + * @return The enum numeric value on the wire for operatingSystemType. + */ + @java.lang.Override + public int getOperatingSystemTypeValue() { + return operatingSystemType_; + } + + /** + * + * + *
+     * The operating system type where this account applies.
+     * 
+ * + * .google.cloud.oslogin.common.OperatingSystemType operating_system_type = 10; + * + * @return The operatingSystemType. + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType + getOperatingSystemType() { + com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType result = + com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType.forNumber( + operatingSystemType_); + return result == null + ? com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType.UNRECOGNIZED + : result; + } + + public static final int NAME_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The canonical resource name.
+     * 
+ * + * string name = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + + /** + * + * + *
+     * Output only. The canonical resource name.
+     * 
+ * + * string name = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + + 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 (primary_ != false) { + output.writeBool(1, primary_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, username_); + } + if (uid_ != 0L) { + output.writeInt64(3, uid_); + } + if (gid_ != 0L) { + output.writeInt64(4, gid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(homeDirectory_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, homeDirectory_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(shell_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, shell_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(gecos_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, gecos_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(systemId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, systemId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(accountId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, accountId_); + } + if (operatingSystemType_ + != com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType + .OPERATING_SYSTEM_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, operatingSystemType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (primary_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, primary_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, username_); + } + if (uid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, uid_); + } + if (gid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, gid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(homeDirectory_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, homeDirectory_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(shell_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, shell_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(gecos_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, gecos_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(systemId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, systemId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(accountId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, accountId_); + } + if (operatingSystemType_ + != com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType + .OPERATING_SYSTEM_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, operatingSystemType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, name_); + } + 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.oslogin.common.OsLoginProto.PosixAccount)) { + return super.equals(obj); + } + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount other = + (com.google.cloud.oslogin.common.OsLoginProto.PosixAccount) obj; + + if (getPrimary() != other.getPrimary()) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (getUid() != other.getUid()) return false; + if (getGid() != other.getGid()) return false; + if (!getHomeDirectory().equals(other.getHomeDirectory())) return false; + if (!getShell().equals(other.getShell())) return false; + if (!getGecos().equals(other.getGecos())) return false; + if (!getSystemId().equals(other.getSystemId())) return false; + if (!getAccountId().equals(other.getAccountId())) return false; + if (operatingSystemType_ != other.operatingSystemType_) return false; + if (!getName().equals(other.getName())) 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) + PRIMARY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPrimary()); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getUid()); + hash = (37 * hash) + GID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGid()); + hash = (37 * hash) + HOME_DIRECTORY_FIELD_NUMBER; + hash = (53 * hash) + getHomeDirectory().hashCode(); + hash = (37 * hash) + SHELL_FIELD_NUMBER; + hash = (53 * hash) + getShell().hashCode(); + hash = (37 * hash) + GECOS_FIELD_NUMBER; + hash = (53 * hash) + getGecos().hashCode(); + hash = (37 * hash) + SYSTEM_ID_FIELD_NUMBER; + hash = (53 * hash) + getSystemId().hashCode(); + hash = (37 * hash) + ACCOUNT_ID_FIELD_NUMBER; + hash = (53 * hash) + getAccountId().hashCode(); + hash = (37 * hash) + OPERATING_SYSTEM_TYPE_FIELD_NUMBER; + hash = (53 * hash) + operatingSystemType_; + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.common.OsLoginProto.PosixAccount parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.PosixAccount 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.oslogin.common.OsLoginProto.PosixAccount parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.PosixAccount 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.oslogin.common.OsLoginProto.PosixAccount parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.PosixAccount parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.PosixAccount parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.PosixAccount parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.PosixAccount parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.PosixAccount parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.PosixAccount parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.PosixAccount parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.common.OsLoginProto.PosixAccount 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * The POSIX account information associated with a Google account.
+     * 
+ * + * Protobuf type {@code google.cloud.oslogin.common.PosixAccount} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.common.PosixAccount) + com.google.cloud.oslogin.common.OsLoginProto.PosixAccountOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.common.OsLoginProto + .internal_static_google_cloud_oslogin_common_PosixAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.common.OsLoginProto + .internal_static_google_cloud_oslogin_common_PosixAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.class, + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.Builder.class); + } + + // Construct using com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + primary_ = false; + username_ = ""; + uid_ = 0L; + gid_ = 0L; + homeDirectory_ = ""; + shell_ = ""; + gecos_ = ""; + systemId_ = ""; + accountId_ = ""; + operatingSystemType_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.common.OsLoginProto + .internal_static_google_cloud_oslogin_common_PosixAccount_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.PosixAccount getDefaultInstanceForType() { + return com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.PosixAccount build() { + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.PosixAccount buildPartial() { + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount result = + new com.google.cloud.oslogin.common.OsLoginProto.PosixAccount(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.common.OsLoginProto.PosixAccount result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.primary_ = primary_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.username_ = username_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.gid_ = gid_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.homeDirectory_ = homeDirectory_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.shell_ = shell_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.gecos_ = gecos_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.systemId_ = systemId_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.accountId_ = accountId_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.operatingSystemType_ = operatingSystemType_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.common.OsLoginProto.PosixAccount) { + return mergeFrom((com.google.cloud.oslogin.common.OsLoginProto.PosixAccount) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.common.OsLoginProto.PosixAccount other) { + if (other == com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.getDefaultInstance()) + return this; + if (other.getPrimary() != false) { + setPrimary(other.getPrimary()); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getUid() != 0L) { + setUid(other.getUid()); + } + if (other.getGid() != 0L) { + setGid(other.getGid()); + } + if (!other.getHomeDirectory().isEmpty()) { + homeDirectory_ = other.homeDirectory_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getShell().isEmpty()) { + shell_ = other.shell_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getGecos().isEmpty()) { + gecos_ = other.gecos_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getSystemId().isEmpty()) { + systemId_ = other.systemId_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getAccountId().isEmpty()) { + accountId_ = other.accountId_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.operatingSystemType_ != 0) { + setOperatingSystemTypeValue(other.getOperatingSystemTypeValue()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000400; + 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: + { + primary_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + uid_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + gid_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + homeDirectory_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + shell_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + gecos_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + systemId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + accountId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 80: + { + operatingSystemType_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 90: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + 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 boolean primary_; + + /** + * + * + *
+       * Only one POSIX account can be marked as primary.
+       * 
+ * + * bool primary = 1; + * + * @return The primary. + */ + @java.lang.Override + public boolean getPrimary() { + return primary_; + } + + /** + * + * + *
+       * Only one POSIX account can be marked as primary.
+       * 
+ * + * bool primary = 1; + * + * @param value The primary to set. + * @return This builder for chaining. + */ + public Builder setPrimary(boolean value) { + + primary_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Only one POSIX account can be marked as primary.
+       * 
+ * + * bool primary = 1; + * + * @return This builder for chaining. + */ + public Builder clearPrimary() { + bitField0_ = (bitField0_ & ~0x00000001); + primary_ = false; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + + /** + * + * + *
+       * The username of the POSIX account.
+       * 
+ * + * string username = 2; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The username of the POSIX account.
+       * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The username of the POSIX account.
+       * 
+ * + * string username = 2; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The username of the POSIX account.
+       * 
+ * + * string username = 2; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + username_ = getDefaultInstance().getUsername(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * The username of the POSIX account.
+       * 
+ * + * string username = 2; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long uid_; + + /** + * + * + *
+       * The user ID.
+       * 
+ * + * int64 uid = 3; + * + * @return The uid. + */ + @java.lang.Override + public long getUid() { + return uid_; + } + + /** + * + * + *
+       * The user ID.
+       * 
+ * + * int64 uid = 3; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(long value) { + + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The user ID.
+       * 
+ * + * int64 uid = 3; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + bitField0_ = (bitField0_ & ~0x00000004); + uid_ = 0L; + onChanged(); + return this; + } + + private long gid_; + + /** + * + * + *
+       * The default group ID.
+       * 
+ * + * int64 gid = 4; + * + * @return The gid. + */ + @java.lang.Override + public long getGid() { + return gid_; + } + + /** + * + * + *
+       * The default group ID.
+       * 
+ * + * int64 gid = 4; + * + * @param value The gid to set. + * @return This builder for chaining. + */ + public Builder setGid(long value) { + + gid_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The default group ID.
+       * 
+ * + * int64 gid = 4; + * + * @return This builder for chaining. + */ + public Builder clearGid() { + bitField0_ = (bitField0_ & ~0x00000008); + gid_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object homeDirectory_ = ""; + + /** + * + * + *
+       * The path to the home directory for this account.
+       * 
+ * + * string home_directory = 5; + * + * @return The homeDirectory. + */ + public java.lang.String getHomeDirectory() { + java.lang.Object ref = homeDirectory_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + homeDirectory_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The path to the home directory for this account.
+       * 
+ * + * string home_directory = 5; + * + * @return The bytes for homeDirectory. + */ + public com.google.protobuf.ByteString getHomeDirectoryBytes() { + java.lang.Object ref = homeDirectory_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + homeDirectory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The path to the home directory for this account.
+       * 
+ * + * string home_directory = 5; + * + * @param value The homeDirectory to set. + * @return This builder for chaining. + */ + public Builder setHomeDirectory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + homeDirectory_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * The path to the home directory for this account.
+       * 
+ * + * string home_directory = 5; + * + * @return This builder for chaining. + */ + public Builder clearHomeDirectory() { + homeDirectory_ = getDefaultInstance().getHomeDirectory(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+       * The path to the home directory for this account.
+       * 
+ * + * string home_directory = 5; + * + * @param value The bytes for homeDirectory to set. + * @return This builder for chaining. + */ + public Builder setHomeDirectoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + homeDirectory_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object shell_ = ""; + + /** + * + * + *
+       * The path to the logic shell for this account.
+       * 
+ * + * string shell = 6; + * + * @return The shell. + */ + public java.lang.String getShell() { + java.lang.Object ref = shell_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shell_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The path to the logic shell for this account.
+       * 
+ * + * string shell = 6; + * + * @return The bytes for shell. + */ + public com.google.protobuf.ByteString getShellBytes() { + java.lang.Object ref = shell_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shell_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The path to the logic shell for this account.
+       * 
+ * + * string shell = 6; + * + * @param value The shell to set. + * @return This builder for chaining. + */ + public Builder setShell(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + shell_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * The path to the logic shell for this account.
+       * 
+ * + * string shell = 6; + * + * @return This builder for chaining. + */ + public Builder clearShell() { + shell_ = getDefaultInstance().getShell(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+       * The path to the logic shell for this account.
+       * 
+ * + * string shell = 6; + * + * @param value The bytes for shell to set. + * @return This builder for chaining. + */ + public Builder setShellBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + shell_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object gecos_ = ""; + + /** + * + * + *
+       * The GECOS (user information) entry for this account.
+       * 
+ * + * string gecos = 7; + * + * @return The gecos. + */ + public java.lang.String getGecos() { + java.lang.Object ref = gecos_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gecos_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The GECOS (user information) entry for this account.
+       * 
+ * + * string gecos = 7; + * + * @return The bytes for gecos. + */ + public com.google.protobuf.ByteString getGecosBytes() { + java.lang.Object ref = gecos_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gecos_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The GECOS (user information) entry for this account.
+       * 
+ * + * string gecos = 7; + * + * @param value The gecos to set. + * @return This builder for chaining. + */ + public Builder setGecos(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + gecos_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * The GECOS (user information) entry for this account.
+       * 
+ * + * string gecos = 7; + * + * @return This builder for chaining. + */ + public Builder clearGecos() { + gecos_ = getDefaultInstance().getGecos(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+       * The GECOS (user information) entry for this account.
+       * 
+ * + * string gecos = 7; + * + * @param value The bytes for gecos to set. + * @return This builder for chaining. + */ + public Builder setGecosBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + gecos_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object systemId_ = ""; + + /** + * + * + *
+       * System identifier for which account the username or uid applies to.
+       * By default, the empty value is used.
+       * 
+ * + * string system_id = 8; + * + * @return The systemId. + */ + public java.lang.String getSystemId() { + java.lang.Object ref = systemId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + systemId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * System identifier for which account the username or uid applies to.
+       * By default, the empty value is used.
+       * 
+ * + * string system_id = 8; + * + * @return The bytes for systemId. + */ + public com.google.protobuf.ByteString getSystemIdBytes() { + java.lang.Object ref = systemId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + systemId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * System identifier for which account the username or uid applies to.
+       * By default, the empty value is used.
+       * 
+ * + * string system_id = 8; + * + * @param value The systemId to set. + * @return This builder for chaining. + */ + public Builder setSystemId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + systemId_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * System identifier for which account the username or uid applies to.
+       * By default, the empty value is used.
+       * 
+ * + * string system_id = 8; + * + * @return This builder for chaining. + */ + public Builder clearSystemId() { + systemId_ = getDefaultInstance().getSystemId(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+       * System identifier for which account the username or uid applies to.
+       * By default, the empty value is used.
+       * 
+ * + * string system_id = 8; + * + * @param value The bytes for systemId to set. + * @return This builder for chaining. + */ + public Builder setSystemIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + systemId_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object accountId_ = ""; + + /** + * + * + *
+       * Output only. A POSIX account identifier.
+       * 
+ * + * string account_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The accountId. + */ + public java.lang.String getAccountId() { + java.lang.Object ref = accountId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accountId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. A POSIX account identifier.
+       * 
+ * + * string account_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for accountId. + */ + public com.google.protobuf.ByteString getAccountIdBytes() { + java.lang.Object ref = accountId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accountId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. A POSIX account identifier.
+       * 
+ * + * string account_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The accountId to set. + * @return This builder for chaining. + */ + public Builder setAccountId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + accountId_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. A POSIX account identifier.
+       * 
+ * + * string account_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAccountId() { + accountId_ = getDefaultInstance().getAccountId(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. A POSIX account identifier.
+       * 
+ * + * string account_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for accountId to set. + * @return This builder for chaining. + */ + public Builder setAccountIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + accountId_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private int operatingSystemType_ = 0; + + /** + * + * + *
+       * The operating system type where this account applies.
+       * 
+ * + * .google.cloud.oslogin.common.OperatingSystemType operating_system_type = 10; + * + * @return The enum numeric value on the wire for operatingSystemType. + */ + @java.lang.Override + public int getOperatingSystemTypeValue() { + return operatingSystemType_; + } + + /** + * + * + *
+       * The operating system type where this account applies.
+       * 
+ * + * .google.cloud.oslogin.common.OperatingSystemType operating_system_type = 10; + * + * @param value The enum numeric value on the wire for operatingSystemType to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemTypeValue(int value) { + operatingSystemType_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+       * The operating system type where this account applies.
+       * 
+ * + * .google.cloud.oslogin.common.OperatingSystemType operating_system_type = 10; + * + * @return The operatingSystemType. + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType + getOperatingSystemType() { + com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType result = + com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType.forNumber( + operatingSystemType_); + return result == null + ? com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * The operating system type where this account applies.
+       * 
+ * + * .google.cloud.oslogin.common.OperatingSystemType operating_system_type = 10; + * + * @param value The operatingSystemType to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemType( + com.google.cloud.oslogin.common.OsLoginProto.OperatingSystemType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + operatingSystemType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * The operating system type where this account applies.
+       * 
+ * + * .google.cloud.oslogin.common.OperatingSystemType operating_system_type = 10; + * + * @return This builder for chaining. + */ + public Builder clearOperatingSystemType() { + bitField0_ = (bitField0_ & ~0x00000200); + operatingSystemType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * Output only. The canonical resource name.
+       * 
+ * + * string name = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + + /** + * + * + *
+       * Output only. The canonical resource name.
+       * 
+ * + * string name = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + + /** + * + * + *
+       * Output only. The canonical resource name.
+       * 
+ * + * string name = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The canonical resource name.
+       * 
+ * + * string name = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The canonical resource name.
+       * 
+ * + * string name = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.common.PosixAccount) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.common.PosixAccount) + private static final com.google.cloud.oslogin.common.OsLoginProto.PosixAccount DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.common.OsLoginProto.PosixAccount(); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.PosixAccount getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PosixAccount 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.oslogin.common.OsLoginProto.PosixAccount getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SshPublicKeyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.common.SshPublicKey) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Public key text in SSH format, defined by
+     * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6.
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + + /** + * + * + *
+     * Public key text in SSH format, defined by
+     * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6.
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+     * An expiration time in microseconds since epoch.
+     * 
+ * + * int64 expiration_time_usec = 2; + * + * @return The expirationTimeUsec. + */ + long getExpirationTimeUsec(); + + /** + * + * + *
+     * Output only. The SHA-256 fingerprint of the SSH public key.
+     * 
+ * + * string fingerprint = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The fingerprint. + */ + java.lang.String getFingerprint(); + + /** + * + * + *
+     * Output only. The SHA-256 fingerprint of the SSH public key.
+     * 
+ * + * string fingerprint = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for fingerprint. + */ + com.google.protobuf.ByteString getFingerprintBytes(); + + /** + * + * + *
+     * Output only. The canonical resource name.
+     * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * Output only. The canonical resource name.
+     * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + } + + /** + * + * + *
+   * The SSH public key information associated with a Google account.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.common.SshPublicKey} + */ + public static final class SshPublicKey extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.common.SshPublicKey) + SshPublicKeyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SshPublicKey"); + } + + // Use SshPublicKey.newBuilder() to construct. + private SshPublicKey(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SshPublicKey() { + key_ = ""; + fingerprint_ = ""; + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.common.OsLoginProto + .internal_static_google_cloud_oslogin_common_SshPublicKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.common.OsLoginProto + .internal_static_google_cloud_oslogin_common_SshPublicKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.class, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + + /** + * + * + *
+     * Public key text in SSH format, defined by
+     * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6.
+     * 
+ * + * string key = 1; + * + * @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; + } + } + + /** + * + * + *
+     * Public key text in SSH format, defined by
+     * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6.
+     * 
+ * + * string key = 1; + * + * @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 EXPIRATION_TIME_USEC_FIELD_NUMBER = 2; + private long expirationTimeUsec_ = 0L; + + /** + * + * + *
+     * An expiration time in microseconds since epoch.
+     * 
+ * + * int64 expiration_time_usec = 2; + * + * @return The expirationTimeUsec. + */ + @java.lang.Override + public long getExpirationTimeUsec() { + return expirationTimeUsec_; + } + + public static final int FINGERPRINT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object fingerprint_ = ""; + + /** + * + * + *
+     * Output only. The SHA-256 fingerprint of the SSH public key.
+     * 
+ * + * string fingerprint = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The fingerprint. + */ + @java.lang.Override + public java.lang.String getFingerprint() { + java.lang.Object ref = fingerprint_; + 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(); + fingerprint_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The SHA-256 fingerprint of the SSH public key.
+     * 
+ * + * string fingerprint = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for fingerprint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFingerprintBytes() { + java.lang.Object ref = fingerprint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fingerprint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The canonical resource name.
+     * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + + /** + * + * + *
+     * Output only. The canonical resource name.
+     * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + + 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.GeneratedMessage.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, key_); + } + if (expirationTimeUsec_ != 0L) { + output.writeInt64(2, expirationTimeUsec_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fingerprint_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, fingerprint_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, key_); + } + if (expirationTimeUsec_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, expirationTimeUsec_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fingerprint_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, fingerprint_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, name_); + } + 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.oslogin.common.OsLoginProto.SshPublicKey)) { + return super.equals(obj); + } + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey other = + (com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey) obj; + + if (!getKey().equals(other.getKey())) return false; + if (getExpirationTimeUsec() != other.getExpirationTimeUsec()) return false; + if (!getFingerprint().equals(other.getFingerprint())) return false; + if (!getName().equals(other.getName())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + EXPIRATION_TIME_USEC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getExpirationTimeUsec()); + hash = (37 * hash) + FINGERPRINT_FIELD_NUMBER; + hash = (53 * hash) + getFingerprint().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey 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.oslogin.common.OsLoginProto.SshPublicKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey 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.oslogin.common.OsLoginProto.SshPublicKey parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.common.OsLoginProto.SshPublicKey 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * The SSH public key information associated with a Google account.
+     * 
+ * + * Protobuf type {@code google.cloud.oslogin.common.SshPublicKey} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.common.SshPublicKey) + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.common.OsLoginProto + .internal_static_google_cloud_oslogin_common_SshPublicKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.common.OsLoginProto + .internal_static_google_cloud_oslogin_common_SshPublicKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.class, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder.class); + } + + // Construct using com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + expirationTimeUsec_ = 0L; + fingerprint_ = ""; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.common.OsLoginProto + .internal_static_google_cloud_oslogin_common_SshPublicKey_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getDefaultInstanceForType() { + return com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey build() { + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey buildPartial() { + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey result = + new com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.expirationTimeUsec_ = expirationTimeUsec_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fingerprint_ = fingerprint_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey) { + return mergeFrom((com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey other) { + if (other == com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getExpirationTimeUsec() != 0L) { + setExpirationTimeUsec(other.getExpirationTimeUsec()); + } + if (!other.getFingerprint().isEmpty()) { + fingerprint_ = other.fingerprint_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000008; + 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: + { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + expirationTimeUsec_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + fingerprint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + 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 java.lang.Object key_ = ""; + + /** + * + * + *
+       * Public key text in SSH format, defined by
+       * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6.
+       * 
+ * + * string key = 1; + * + * @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; + } + } + + /** + * + * + *
+       * Public key text in SSH format, defined by
+       * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6.
+       * 
+ * + * string key = 1; + * + * @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; + } + } + + /** + * + * + *
+       * Public key text in SSH format, defined by
+       * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6.
+       * 
+ * + * string key = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Public key text in SSH format, defined by
+       * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6.
+       * 
+ * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Public key text in SSH format, defined by
+       * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6.
+       * 
+ * + * string key = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long expirationTimeUsec_; + + /** + * + * + *
+       * An expiration time in microseconds since epoch.
+       * 
+ * + * int64 expiration_time_usec = 2; + * + * @return The expirationTimeUsec. + */ + @java.lang.Override + public long getExpirationTimeUsec() { + return expirationTimeUsec_; + } + + /** + * + * + *
+       * An expiration time in microseconds since epoch.
+       * 
+ * + * int64 expiration_time_usec = 2; + * + * @param value The expirationTimeUsec to set. + * @return This builder for chaining. + */ + public Builder setExpirationTimeUsec(long value) { + + expirationTimeUsec_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * An expiration time in microseconds since epoch.
+       * 
+ * + * int64 expiration_time_usec = 2; + * + * @return This builder for chaining. + */ + public Builder clearExpirationTimeUsec() { + bitField0_ = (bitField0_ & ~0x00000002); + expirationTimeUsec_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object fingerprint_ = ""; + + /** + * + * + *
+       * Output only. The SHA-256 fingerprint of the SSH public key.
+       * 
+ * + * string fingerprint = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The fingerprint. + */ + public java.lang.String getFingerprint() { + java.lang.Object ref = fingerprint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fingerprint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The SHA-256 fingerprint of the SSH public key.
+       * 
+ * + * string fingerprint = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for fingerprint. + */ + public com.google.protobuf.ByteString getFingerprintBytes() { + java.lang.Object ref = fingerprint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fingerprint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The SHA-256 fingerprint of the SSH public key.
+       * 
+ * + * string fingerprint = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The fingerprint to set. + * @return This builder for chaining. + */ + public Builder setFingerprint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fingerprint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The SHA-256 fingerprint of the SSH public key.
+       * 
+ * + * string fingerprint = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearFingerprint() { + fingerprint_ = getDefaultInstance().getFingerprint(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The SHA-256 fingerprint of the SSH public key.
+       * 
+ * + * string fingerprint = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for fingerprint to set. + * @return This builder for chaining. + */ + public Builder setFingerprintBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fingerprint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * Output only. The canonical resource name.
+       * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + + /** + * + * + *
+       * Output only. The canonical resource name.
+       * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + + /** + * + * + *
+       * Output only. The canonical resource name.
+       * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The canonical resource name.
+       * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The canonical resource name.
+       * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.common.SshPublicKey) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.common.SshPublicKey) + private static final com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey(); + } + + public static com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SshPublicKey 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.oslogin.common.OsLoginProto.SshPublicKey getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_common_PosixAccount_descriptor; + private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_common_PosixAccount_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_common_SshPublicKey_descriptor; + private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_common_SshPublicKey_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "(google/cloud/oslogin/common/common.pro" + + "to\022\033google.cloud.oslogin.common\032\037google/" + + "api/field_behavior.proto\032\031google/api/resource.proto\"\334\002\n" + + "\014PosixAccount\022\017\n" + + "\007primary\030\001 \001(\010\022\020\n" + + "\010username\030\002 \001(\t\022\013\n" + + "\003uid\030\003 \001(\003\022\013\n" + + "\003gid\030\004 \001(\003\022\026\n" + + "\016home_directory\030\005 \001(\t\022\r\n" + + "\005shell\030\006 \001(\t\022\r\n" + + "\005gecos\030\007 \001(\t\022\021\n" + + "\tsystem_id\030\010 \001(\t\022\027\n\n" + + "account_id\030\t \001(\tB\003\340A\003\022O\n" + + "\025operating_system_type\030\n" + + " \001(\01620.google.cloud.oslogin.common.OperatingSystemType\022\021\n" + + "\004name\030\013 \001(\tB\003\340A\003:I\352AF\n" + + "#oslogin.googleapis.com/Pos" + + "ixAccount\022\037users/{user}/projects/{project}\"\272\001\n" + + "\014SshPublicKey\022\013\n" + + "\003key\030\001 \001(\t\022\034\n" + + "\024expiration_time_usec\030\002 \001(\003\022\030\n" + + "\013fingerprint\030\003 \001(\tB\003\340A\003\022\021\n" + + "\004name\030\004 \001(\tB\003\340A\003:R\352AO\n" + + "#oslogin.googleapis.com/SshPublicKey\022(users/{user}/sshPublicKeys/{fingerprint}*T\n" + + "\023OperatingSystemType\022%\n" + + "!OPERATING_SYSTEM_TYPE_UNSPECIFIED\020\000\022\t\n" + + "\005LINUX\020\001\022\013\n" + + "\007WINDOWS\020\002B\360\001\n" + + "\037com.google.cloud.oslogin.commonB\014OsLoginProtoZ4cloud.google.com/go/oslogin/com" + + "mon/commonpb;commonpb\252\002\033Google.Cloud.OsL" + + "ogin.Common\312\002\033Google\\Cloud\\OsLogin\\Common\352\002\036Google::Cloud::OsLogin::Common\352A+\n" + + "\033oslogin.googleapis.com/User\022\014users/{user}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_oslogin_common_PosixAccount_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_oslogin_common_PosixAccount_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_oslogin_common_PosixAccount_descriptor, + new java.lang.String[] { + "Primary", + "Username", + "Uid", + "Gid", + "HomeDirectory", + "Shell", + "Gecos", + "SystemId", + "AccountId", + "OperatingSystemType", + "Name", + }); + internal_static_google_cloud_oslogin_common_SshPublicKey_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_oslogin_common_SshPublicKey_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_oslogin_common_SshPublicKey_descriptor, + new java.lang.String[] { + "Key", "ExpirationTimeUsec", "Fingerprint", "Name", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/PosixAccountName.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/PosixAccountName.java new file mode 100644 index 000000000000..ba8422596e79 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/PosixAccountName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2026 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.oslogin.common; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class PosixAccountName implements ResourceName { + private static final PathTemplate USER_PROJECT = + PathTemplate.createWithoutUrlEncoding("users/{user}/projects/{project}"); + private volatile Map fieldValuesMap; + private final String user; + private final String project; + + @Deprecated + protected PosixAccountName() { + user = null; + project = null; + } + + private PosixAccountName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public String getUser() { + return user; + } + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PosixAccountName of(String user, String project) { + return newBuilder().setUser(user).setProject(project).build(); + } + + public static String format(String user, String project) { + return newBuilder().setUser(user).setProject(project).build().toString(); + } + + public static PosixAccountName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER_PROJECT.validatedMatch( + formattedString, "PosixAccountName.parse: formattedString not in valid format"); + return of(matchMap.get("user"), matchMap.get("project")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (PosixAccountName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER_PROJECT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + if (project != null) { + fieldMapBuilder.put("project", project); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER_PROJECT.instantiate("user", user, "project", project); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PosixAccountName that = ((PosixAccountName) o); + return Objects.equals(this.user, that.user) && Objects.equals(this.project, that.project); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + h *= 1000003; + h ^= Objects.hashCode(project); + return h; + } + + /** Builder for users/{user}/projects/{project}. */ + public static class Builder { + private String user; + private String project; + + protected Builder() {} + + public String getUser() { + return user; + } + + public String getProject() { + return project; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder(PosixAccountName posixAccountName) { + this.user = posixAccountName.user; + this.project = posixAccountName.project; + } + + public PosixAccountName build() { + return new PosixAccountName(this); + } + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/SshPublicKeyName.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/SshPublicKeyName.java new file mode 100644 index 000000000000..89732ee79758 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/SshPublicKeyName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 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.oslogin.common; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SshPublicKeyName implements ResourceName { + private static final PathTemplate USER_FINGERPRINT = + PathTemplate.createWithoutUrlEncoding("users/{user}/sshPublicKeys/{fingerprint}"); + private volatile Map fieldValuesMap; + private final String user; + private final String fingerprint; + + @Deprecated + protected SshPublicKeyName() { + user = null; + fingerprint = null; + } + + private SshPublicKeyName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + fingerprint = Preconditions.checkNotNull(builder.getFingerprint()); + } + + public String getUser() { + return user; + } + + public String getFingerprint() { + return fingerprint; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SshPublicKeyName of(String user, String fingerprint) { + return newBuilder().setUser(user).setFingerprint(fingerprint).build(); + } + + public static String format(String user, String fingerprint) { + return newBuilder().setUser(user).setFingerprint(fingerprint).build().toString(); + } + + public static SshPublicKeyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER_FINGERPRINT.validatedMatch( + formattedString, "SshPublicKeyName.parse: formattedString not in valid format"); + return of(matchMap.get("user"), matchMap.get("fingerprint")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (SshPublicKeyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER_FINGERPRINT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + if (fingerprint != null) { + fieldMapBuilder.put("fingerprint", fingerprint); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER_FINGERPRINT.instantiate("user", user, "fingerprint", fingerprint); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SshPublicKeyName that = ((SshPublicKeyName) o); + return Objects.equals(this.user, that.user) + && Objects.equals(this.fingerprint, that.fingerprint); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + h *= 1000003; + h ^= Objects.hashCode(fingerprint); + return h; + } + + /** Builder for users/{user}/sshPublicKeys/{fingerprint}. */ + public static class Builder { + private String user; + private String fingerprint; + + protected Builder() {} + + public String getUser() { + return user; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + private Builder(SshPublicKeyName sshPublicKeyName) { + this.user = sshPublicKeyName.user; + this.fingerprint = sshPublicKeyName.fingerprint; + } + + public SshPublicKeyName build() { + return new SshPublicKeyName(this); + } + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/UserName.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/UserName.java new file mode 100644 index 000000000000..6cd3ec8915d6 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/common/UserName.java @@ -0,0 +1,166 @@ +/* + * Copyright 2026 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.oslogin.common; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class UserName implements ResourceName { + private static final PathTemplate USER = PathTemplate.createWithoutUrlEncoding("users/{user}"); + private volatile Map fieldValuesMap; + private final String user; + + @Deprecated + protected UserName() { + user = null; + } + + private UserName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static UserName of(String user) { + return newBuilder().setUser(user).build(); + } + + public static String format(String user) { + return newBuilder().setUser(user).build().toString(); + } + + public static UserName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER.validatedMatch(formattedString, "UserName.parse: formattedString not in valid format"); + return of(matchMap.get("user")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (UserName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER.instantiate("user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + UserName that = ((UserName) o); + return Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for users/{user}. */ + public static class Builder { + private String user; + + protected Builder() {} + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(UserName userName) { + this.user = userName.user; + } + + public UserName build() { + return new UserName(this); + } + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/CreateSshPublicKeyRequest.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/CreateSshPublicKeyRequest.java new file mode 100644 index 000000000000..6d08901d28f1 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/CreateSshPublicKeyRequest.java @@ -0,0 +1,935 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * A request message for creating an SSH public key.
+ * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest} + */ +@com.google.protobuf.Generated +public final class CreateSshPublicKeyRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest) + CreateSshPublicKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateSshPublicKeyRequest"); + } + + // Use CreateSshPublicKeyRequest.newBuilder() to construct. + private CreateSshPublicKeyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateSshPublicKeyRequest() { + parent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_CreateSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_CreateSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique ID for the user in format `users/{user}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique ID for the user in format `users/{user}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SSH_PUBLIC_KEY_FIELD_NUMBER = 2; + private com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey sshPublicKey_; + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sshPublicKey field is set. + */ + @java.lang.Override + public boolean hasSshPublicKey() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sshPublicKey. + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKey() { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder + getSshPublicKeyOrBuilder() { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSshPublicKey()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSshPublicKey()); + } + 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.oslogin.v1beta.CreateSshPublicKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest other = + (com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasSshPublicKey() != other.hasSshPublicKey()) return false; + if (hasSshPublicKey()) { + if (!getSshPublicKey().equals(other.getSshPublicKey())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasSshPublicKey()) { + hash = (37 * hash) + SSH_PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getSshPublicKey().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest 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.oslogin.v1beta.CreateSshPublicKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest 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.oslogin.v1beta.CreateSshPublicKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.CreateSshPublicKeyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A request message for creating an SSH public key.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest) + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_CreateSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_CreateSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSshPublicKeyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + sshPublicKey_ = null; + if (sshPublicKeyBuilder_ != null) { + sshPublicKeyBuilder_.dispose(); + sshPublicKeyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_CreateSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest build() { + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest buildPartial() { + com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest result = + new com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sshPublicKey_ = + sshPublicKeyBuilder_ == null ? sshPublicKey_ : sshPublicKeyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest) { + return mergeFrom((com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest other) { + if (other == com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSshPublicKey()) { + mergeSshPublicKey(other.getSshPublicKey()); + } + 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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetSshPublicKeyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + 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 int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique ID for the user in format `users/{user}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique ID for the user in format `users/{user}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique ID for the user in format `users/{user}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique ID for the user in format `users/{user}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique ID for the user in format `users/{user}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey sshPublicKey_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder> + sshPublicKeyBuilder_; + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sshPublicKey field is set. + */ + public boolean hasSshPublicKey() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sshPublicKey. + */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKey() { + if (sshPublicKeyBuilder_ == null) { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } else { + return sshPublicKeyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSshPublicKey( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey value) { + if (sshPublicKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sshPublicKey_ = value; + } else { + sshPublicKeyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSshPublicKey( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder builderForValue) { + if (sshPublicKeyBuilder_ == null) { + sshPublicKey_ = builderForValue.build(); + } else { + sshPublicKeyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSshPublicKey( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey value) { + if (sshPublicKeyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && sshPublicKey_ != null + && sshPublicKey_ + != com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance()) { + getSshPublicKeyBuilder().mergeFrom(value); + } else { + sshPublicKey_ = value; + } + } else { + sshPublicKeyBuilder_.mergeFrom(value); + } + if (sshPublicKey_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSshPublicKey() { + bitField0_ = (bitField0_ & ~0x00000002); + sshPublicKey_ = null; + if (sshPublicKeyBuilder_ != null) { + sshPublicKeyBuilder_.dispose(); + sshPublicKeyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder + getSshPublicKeyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetSshPublicKeyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder + getSshPublicKeyOrBuilder() { + if (sshPublicKeyBuilder_ != null) { + return sshPublicKeyBuilder_.getMessageOrBuilder(); + } else { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder> + internalGetSshPublicKeyFieldBuilder() { + if (sshPublicKeyBuilder_ == null) { + sshPublicKeyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder>( + getSshPublicKey(), getParentForChildren(), isClean()); + sshPublicKey_ = null; + } + return sshPublicKeyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest) + private static final com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest(); + } + + public static com.google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSshPublicKeyRequest 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.oslogin.v1beta.CreateSshPublicKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/CreateSshPublicKeyRequestOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/CreateSshPublicKeyRequestOrBuilder.java new file mode 100644 index 000000000000..97cc3649c4f7 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/CreateSshPublicKeyRequestOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface CreateSshPublicKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique ID for the user in format `users/{user}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique ID for the user in format `users/{user}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sshPublicKey field is set. + */ + boolean hasSshPublicKey(); + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sshPublicKey. + */ + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKey(); + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder getSshPublicKeyOrBuilder(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeletePosixAccountRequest.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeletePosixAccountRequest.java new file mode 100644 index 000000000000..8017c45a5f4d --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeletePosixAccountRequest.java @@ -0,0 +1,625 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * A request message for deleting a POSIX account entry.
+ * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.DeletePosixAccountRequest} + */ +@com.google.protobuf.Generated +public final class DeletePosixAccountRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.DeletePosixAccountRequest) + DeletePosixAccountRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeletePosixAccountRequest"); + } + + // Use DeletePosixAccountRequest.newBuilder() to construct. + private DeletePosixAccountRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeletePosixAccountRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_DeletePosixAccountRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_DeletePosixAccountRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest.class, + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. A reference to the POSIX account to update. POSIX accounts are
+   * identified by the project ID they are associated with. A reference to the
+   * POSIX account is in format `users/{user}/projects/{project}`.
+   * 
+ * + * + * 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. A reference to the POSIX account to update. POSIX accounts are
+   * identified by the project ID they are associated with. A reference to the
+   * POSIX account is in format `users/{user}/projects/{project}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + 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.oslogin.v1beta.DeletePosixAccountRequest)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest other = + (com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest) obj; + + if (!getName().equals(other.getName())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest 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.oslogin.v1beta.DeletePosixAccountRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest 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.oslogin.v1beta.DeletePosixAccountRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.DeletePosixAccountRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A request message for deleting a POSIX account entry.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.DeletePosixAccountRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.DeletePosixAccountRequest) + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_DeletePosixAccountRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_DeletePosixAccountRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest.class, + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_DeletePosixAccountRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest build() { + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest buildPartial() { + com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest result = + new com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest) { + return mergeFrom((com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest other) { + if (other == com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + 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 java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. A reference to the POSIX account to update. POSIX accounts are
+     * identified by the project ID they are associated with. A reference to the
+     * POSIX account is in format `users/{user}/projects/{project}`.
+     * 
+ * + * + * 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. A reference to the POSIX account to update. POSIX accounts are
+     * identified by the project ID they are associated with. A reference to the
+     * POSIX account is in format `users/{user}/projects/{project}`.
+     * 
+ * + * + * 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. A reference to the POSIX account to update. POSIX accounts are
+     * identified by the project ID they are associated with. A reference to the
+     * POSIX account is in format `users/{user}/projects/{project}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A reference to the POSIX account to update. POSIX accounts are
+     * identified by the project ID they are associated with. A reference to the
+     * POSIX account is in format `users/{user}/projects/{project}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A reference to the POSIX account to update. POSIX accounts are
+     * identified by the project ID they are associated with. A reference to the
+     * POSIX account is in format `users/{user}/projects/{project}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.DeletePosixAccountRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.DeletePosixAccountRequest) + private static final com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest(); + } + + public static com.google.cloud.oslogin.v1beta.DeletePosixAccountRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePosixAccountRequest 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.oslogin.v1beta.DeletePosixAccountRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeletePosixAccountRequestOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeletePosixAccountRequestOrBuilder.java new file mode 100644 index 000000000000..b2d24b497671 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeletePosixAccountRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface DeletePosixAccountRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.DeletePosixAccountRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A reference to the POSIX account to update. POSIX accounts are
+   * identified by the project ID they are associated with. A reference to the
+   * POSIX account is in format `users/{user}/projects/{project}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. A reference to the POSIX account to update. POSIX accounts are
+   * identified by the project ID they are associated with. A reference to the
+   * POSIX account is in format `users/{user}/projects/{project}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeleteSshPublicKeyRequest.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeleteSshPublicKeyRequest.java new file mode 100644 index 000000000000..ea04b2c8c574 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeleteSshPublicKeyRequest.java @@ -0,0 +1,625 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * A request message for deleting an SSH public key.
+ * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest} + */ +@com.google.protobuf.Generated +public final class DeleteSshPublicKeyRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest) + DeleteSshPublicKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteSshPublicKeyRequest"); + } + + // Use DeleteSshPublicKeyRequest.newBuilder() to construct. + private DeleteSshPublicKeyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteSshPublicKeyRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_DeleteSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_DeleteSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The fingerprint of the public key to update. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * 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. The fingerprint of the public key to update. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + 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.oslogin.v1beta.DeleteSshPublicKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest other = + (com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest) obj; + + if (!getName().equals(other.getName())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest 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.oslogin.v1beta.DeleteSshPublicKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest 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.oslogin.v1beta.DeleteSshPublicKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.DeleteSshPublicKeyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A request message for deleting an SSH public key.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest) + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_DeleteSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_DeleteSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_DeleteSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest build() { + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest buildPartial() { + com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest result = + new com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest) { + return mergeFrom((com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest other) { + if (other == com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + 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 java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The fingerprint of the public key to update. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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. The fingerprint of the public key to update. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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. The fingerprint of the public key to update. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The fingerprint of the public key to update. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The fingerprint of the public key to update. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest) + private static final com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest(); + } + + public static com.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSshPublicKeyRequest 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.oslogin.v1beta.DeleteSshPublicKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeleteSshPublicKeyRequestOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeleteSshPublicKeyRequestOrBuilder.java new file mode 100644 index 000000000000..42bd998b8e8b --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/DeleteSshPublicKeyRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface DeleteSshPublicKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The fingerprint of the public key to update. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The fingerprint of the public key to update. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetLoginProfileRequest.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetLoginProfileRequest.java new file mode 100644 index 000000000000..d0a432fa8247 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetLoginProfileRequest.java @@ -0,0 +1,1150 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * A request message for retrieving the login profile information for a user.
+ * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.GetLoginProfileRequest} + */ +@com.google.protobuf.Generated +public final class GetLoginProfileRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.GetLoginProfileRequest) + GetLoginProfileRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetLoginProfileRequest"); + } + + // Use GetLoginProfileRequest.newBuilder() to construct. + private GetLoginProfileRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetLoginProfileRequest() { + name_ = ""; + projectId_ = ""; + systemId_ = ""; + view_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_GetLoginProfileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_GetLoginProfileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest.class, + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique ID for the user in format `users/{user}`.
+   * 
+ * + * + * 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. The unique ID for the user in format `users/{user}`.
+   * 
+ * + * + * 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 PROJECT_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object projectId_ = ""; + + /** + * + * + *
+   * The project ID of the Google Cloud Platform project.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the Google Cloud Platform project.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SYSTEM_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object systemId_ = ""; + + /** + * + * + *
+   * A system ID for filtering the results of the request.
+   * 
+ * + * string system_id = 3; + * + * @return The systemId. + */ + @java.lang.Override + public java.lang.String getSystemId() { + java.lang.Object ref = systemId_; + 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(); + systemId_ = s; + return s; + } + } + + /** + * + * + *
+   * A system ID for filtering the results of the request.
+   * 
+ * + * string system_id = 3; + * + * @return The bytes for systemId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSystemIdBytes() { + java.lang.Object ref = systemId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + systemId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 4; + private int view_ = 0; + + /** + * + * + *
+   * The view configures whether to retrieve security keys information.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+   * The view configures whether to retrieve security keys information.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.LoginProfileView getView() { + com.google.cloud.oslogin.v1beta.LoginProfileView result = + com.google.cloud.oslogin.v1beta.LoginProfileView.forNumber(view_); + return result == null ? com.google.cloud.oslogin.v1beta.LoginProfileView.UNRECOGNIZED : result; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, projectId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(systemId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, systemId_); + } + if (view_ + != com.google.cloud.oslogin.v1beta.LoginProfileView.LOGIN_PROFILE_VIEW_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, view_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, projectId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(systemId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, systemId_); + } + if (view_ + != com.google.cloud.oslogin.v1beta.LoginProfileView.LOGIN_PROFILE_VIEW_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, view_); + } + 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.oslogin.v1beta.GetLoginProfileRequest)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest other = + (com.google.cloud.oslogin.v1beta.GetLoginProfileRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getSystemId().equals(other.getSystemId())) return false; + if (view_ != other.view_) 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) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + SYSTEM_ID_FIELD_NUMBER; + hash = (53 * hash) + getSystemId().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.GetLoginProfileRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.GetLoginProfileRequest 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.oslogin.v1beta.GetLoginProfileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.GetLoginProfileRequest 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.oslogin.v1beta.GetLoginProfileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.GetLoginProfileRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.GetLoginProfileRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.GetLoginProfileRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.GetLoginProfileRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.GetLoginProfileRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.GetLoginProfileRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.GetLoginProfileRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.GetLoginProfileRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A request message for retrieving the login profile information for a user.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.GetLoginProfileRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.GetLoginProfileRequest) + com.google.cloud.oslogin.v1beta.GetLoginProfileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_GetLoginProfileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_GetLoginProfileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest.class, + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.GetLoginProfileRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + projectId_ = ""; + systemId_ = ""; + view_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_GetLoginProfileRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.GetLoginProfileRequest getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.GetLoginProfileRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.GetLoginProfileRequest build() { + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.GetLoginProfileRequest buildPartial() { + com.google.cloud.oslogin.v1beta.GetLoginProfileRequest result = + new com.google.cloud.oslogin.v1beta.GetLoginProfileRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.GetLoginProfileRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.projectId_ = projectId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.systemId_ = systemId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.view_ = view_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.GetLoginProfileRequest) { + return mergeFrom((com.google.cloud.oslogin.v1beta.GetLoginProfileRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.GetLoginProfileRequest other) { + if (other == com.google.cloud.oslogin.v1beta.GetLoginProfileRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSystemId().isEmpty()) { + systemId_ = other.systemId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + projectId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + systemId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + view_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + 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 java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique ID for the user in format `users/{user}`.
+     * 
+ * + * + * 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. The unique ID for the user in format `users/{user}`.
+     * 
+ * + * + * 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. The unique ID for the user in format `users/{user}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique ID for the user in format `users/{user}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique ID for the user in format `users/{user}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + + /** + * + * + *
+     * The project ID of the Google Cloud Platform project.
+     * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the Google Cloud Platform project.
+     * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the Google Cloud Platform project.
+     * 
+ * + * string project_id = 2; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + projectId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the Google Cloud Platform project.
+     * 
+ * + * string project_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + projectId_ = getDefaultInstance().getProjectId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the Google Cloud Platform project.
+     * 
+ * + * string project_id = 2; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + projectId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object systemId_ = ""; + + /** + * + * + *
+     * A system ID for filtering the results of the request.
+     * 
+ * + * string system_id = 3; + * + * @return The systemId. + */ + public java.lang.String getSystemId() { + java.lang.Object ref = systemId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + systemId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A system ID for filtering the results of the request.
+     * 
+ * + * string system_id = 3; + * + * @return The bytes for systemId. + */ + public com.google.protobuf.ByteString getSystemIdBytes() { + java.lang.Object ref = systemId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + systemId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A system ID for filtering the results of the request.
+     * 
+ * + * string system_id = 3; + * + * @param value The systemId to set. + * @return This builder for chaining. + */ + public Builder setSystemId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + systemId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A system ID for filtering the results of the request.
+     * 
+ * + * string system_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearSystemId() { + systemId_ = getDefaultInstance().getSystemId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A system ID for filtering the results of the request.
+     * 
+ * + * string system_id = 3; + * + * @param value The bytes for systemId to set. + * @return This builder for chaining. + */ + public Builder setSystemIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + systemId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int view_ = 0; + + /** + * + * + *
+     * The view configures whether to retrieve security keys information.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+     * The view configures whether to retrieve security keys information.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The view configures whether to retrieve security keys information.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.LoginProfileView getView() { + com.google.cloud.oslogin.v1beta.LoginProfileView result = + com.google.cloud.oslogin.v1beta.LoginProfileView.forNumber(view_); + return result == null + ? com.google.cloud.oslogin.v1beta.LoginProfileView.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The view configures whether to retrieve security keys information.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.oslogin.v1beta.LoginProfileView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + view_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The view configures whether to retrieve security keys information.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000008); + view_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.GetLoginProfileRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.GetLoginProfileRequest) + private static final com.google.cloud.oslogin.v1beta.GetLoginProfileRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.GetLoginProfileRequest(); + } + + public static com.google.cloud.oslogin.v1beta.GetLoginProfileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetLoginProfileRequest 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.oslogin.v1beta.GetLoginProfileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetLoginProfileRequestOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetLoginProfileRequestOrBuilder.java new file mode 100644 index 000000000000..e1a9cebcdf83 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetLoginProfileRequestOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface GetLoginProfileRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.GetLoginProfileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique ID for the user in format `users/{user}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The unique ID for the user in format `users/{user}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The project ID of the Google Cloud Platform project.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + + /** + * + * + *
+   * The project ID of the Google Cloud Platform project.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * A system ID for filtering the results of the request.
+   * 
+ * + * string system_id = 3; + * + * @return The systemId. + */ + java.lang.String getSystemId(); + + /** + * + * + *
+   * A system ID for filtering the results of the request.
+   * 
+ * + * string system_id = 3; + * + * @return The bytes for systemId. + */ + com.google.protobuf.ByteString getSystemIdBytes(); + + /** + * + * + *
+   * The view configures whether to retrieve security keys information.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + + /** + * + * + *
+   * The view configures whether to retrieve security keys information.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The view. + */ + com.google.cloud.oslogin.v1beta.LoginProfileView getView(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetSshPublicKeyRequest.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetSshPublicKeyRequest.java new file mode 100644 index 000000000000..62b8ab613c56 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetSshPublicKeyRequest.java @@ -0,0 +1,625 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * A request message for retrieving an SSH public key.
+ * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.GetSshPublicKeyRequest} + */ +@com.google.protobuf.Generated +public final class GetSshPublicKeyRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.GetSshPublicKeyRequest) + GetSshPublicKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetSshPublicKeyRequest"); + } + + // Use GetSshPublicKeyRequest.newBuilder() to construct. + private GetSshPublicKeyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetSshPublicKeyRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_GetSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_GetSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The fingerprint of the public key to retrieve. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * 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. The fingerprint of the public key to retrieve. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + 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.oslogin.v1beta.GetSshPublicKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest other = + (com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest) obj; + + if (!getName().equals(other.getName())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest 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.oslogin.v1beta.GetSshPublicKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest 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.oslogin.v1beta.GetSshPublicKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.GetSshPublicKeyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A request message for retrieving an SSH public key.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.GetSshPublicKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.GetSshPublicKeyRequest) + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_GetSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_GetSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_GetSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest build() { + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest buildPartial() { + com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest result = + new com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest) { + return mergeFrom((com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest other) { + if (other == com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + 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 java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The fingerprint of the public key to retrieve. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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. The fingerprint of the public key to retrieve. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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. The fingerprint of the public key to retrieve. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The fingerprint of the public key to retrieve. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The fingerprint of the public key to retrieve. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.GetSshPublicKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.GetSshPublicKeyRequest) + private static final com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest(); + } + + public static com.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSshPublicKeyRequest 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.oslogin.v1beta.GetSshPublicKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetSshPublicKeyRequestOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetSshPublicKeyRequestOrBuilder.java new file mode 100644 index 000000000000..19e1be6641a7 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/GetSshPublicKeyRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface GetSshPublicKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.GetSshPublicKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The fingerprint of the public key to retrieve. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The fingerprint of the public key to retrieve. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyRequest.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyRequest.java new file mode 100644 index 000000000000..93a5c10f1747 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyRequest.java @@ -0,0 +1,1587 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * A request message for importing an SSH public key.
+ * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest} + */ +@com.google.protobuf.Generated +public final class ImportSshPublicKeyRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest) + ImportSshPublicKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ImportSshPublicKeyRequest"); + } + + // Use ImportSshPublicKeyRequest.newBuilder() to construct. + private ImportSshPublicKeyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ImportSshPublicKeyRequest() { + parent_ = ""; + projectId_ = ""; + view_ = 0; + regions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * The unique ID for the user in format `users/{user}`.
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * The unique ID for the user in format `users/{user}`.
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SSH_PUBLIC_KEY_FIELD_NUMBER = 2; + private com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey sshPublicKey_; + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sshPublicKey field is set. + */ + @java.lang.Override + public boolean hasSshPublicKey() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sshPublicKey. + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKey() { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder + getSshPublicKeyOrBuilder() { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } + + public static final int PROJECT_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object projectId_ = ""; + + /** + * + * + *
+   * The project ID of the Google Cloud Platform project.
+   * 
+ * + * string project_id = 3; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the Google Cloud Platform project.
+   * 
+ * + * string project_id = 3; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 4; + private int view_ = 0; + + /** + * + * + *
+   * The view configures whether to retrieve security keys information.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+   * The view configures whether to retrieve security keys information.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.LoginProfileView getView() { + com.google.cloud.oslogin.v1beta.LoginProfileView result = + com.google.cloud.oslogin.v1beta.LoginProfileView.forNumber(view_); + return result == null ? com.google.cloud.oslogin.v1beta.LoginProfileView.UNRECOGNIZED : result; + } + + public static final int REGIONS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList regions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. The regions to which to assert that the key was written.
+   * If unspecified, defaults to all regions.
+   * Regions are listed at https://cloud.google.com/about/locations#region.
+   * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the regions. + */ + public com.google.protobuf.ProtocolStringList getRegionsList() { + return regions_; + } + + /** + * + * + *
+   * Optional. The regions to which to assert that the key was written.
+   * If unspecified, defaults to all regions.
+   * Regions are listed at https://cloud.google.com/about/locations#region.
+   * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of regions. + */ + public int getRegionsCount() { + return regions_.size(); + } + + /** + * + * + *
+   * Optional. The regions to which to assert that the key was written.
+   * If unspecified, defaults to all regions.
+   * Regions are listed at https://cloud.google.com/about/locations#region.
+   * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The regions at the given index. + */ + public java.lang.String getRegions(int index) { + return regions_.get(index); + } + + /** + * + * + *
+   * Optional. The regions to which to assert that the key was written.
+   * If unspecified, defaults to all regions.
+   * Regions are listed at https://cloud.google.com/about/locations#region.
+   * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the regions at the given index. + */ + public com.google.protobuf.ByteString getRegionsBytes(int index) { + return regions_.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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSshPublicKey()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, projectId_); + } + if (view_ + != com.google.cloud.oslogin.v1beta.LoginProfileView.LOGIN_PROFILE_VIEW_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, view_); + } + for (int i = 0; i < regions_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, regions_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSshPublicKey()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, projectId_); + } + if (view_ + != com.google.cloud.oslogin.v1beta.LoginProfileView.LOGIN_PROFILE_VIEW_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, view_); + } + { + int dataSize = 0; + for (int i = 0; i < regions_.size(); i++) { + dataSize += computeStringSizeNoTag(regions_.getRaw(i)); + } + size += dataSize; + size += 1 * getRegionsList().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.oslogin.v1beta.ImportSshPublicKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest other = + (com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasSshPublicKey() != other.hasSshPublicKey()) return false; + if (hasSshPublicKey()) { + if (!getSshPublicKey().equals(other.getSshPublicKey())) return false; + } + if (!getProjectId().equals(other.getProjectId())) return false; + if (view_ != other.view_) return false; + if (!getRegionsList().equals(other.getRegionsList())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasSshPublicKey()) { + hash = (37 * hash) + SSH_PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getSshPublicKey().hashCode(); + } + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + if (getRegionsCount() > 0) { + hash = (37 * hash) + REGIONS_FIELD_NUMBER; + hash = (53 * hash) + getRegionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest 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.oslogin.v1beta.ImportSshPublicKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest 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.oslogin.v1beta.ImportSshPublicKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.ImportSshPublicKeyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A request message for importing an SSH public key.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest) + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSshPublicKeyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + sshPublicKey_ = null; + if (sshPublicKeyBuilder_ != null) { + sshPublicKeyBuilder_.dispose(); + sshPublicKeyBuilder_ = null; + } + projectId_ = ""; + view_ = 0; + regions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest build() { + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest buildPartial() { + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest result = + new com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sshPublicKey_ = + sshPublicKeyBuilder_ == null ? sshPublicKey_ : sshPublicKeyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.projectId_ = projectId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.view_ = view_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + regions_.makeImmutable(); + result.regions_ = regions_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest) { + return mergeFrom((com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest other) { + if (other == com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSshPublicKey()) { + mergeSshPublicKey(other.getSshPublicKey()); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + if (!other.regions_.isEmpty()) { + if (regions_.isEmpty()) { + regions_ = other.regions_; + bitField0_ |= 0x00000010; + } else { + ensureRegionsIsMutable(); + regions_.addAll(other.regions_); + } + 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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetSshPublicKeyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + projectId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + view_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRegionsIsMutable(); + regions_.add(s); + break; + } // case 42 + 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 java.lang.Object parent_ = ""; + + /** + * + * + *
+     * The unique ID for the user in format `users/{user}`.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The unique ID for the user in format `users/{user}`.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The unique ID for the user in format `users/{user}`.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique ID for the user in format `users/{user}`.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique ID for the user in format `users/{user}`.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey sshPublicKey_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder> + sshPublicKeyBuilder_; + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sshPublicKey field is set. + */ + public boolean hasSshPublicKey() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sshPublicKey. + */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKey() { + if (sshPublicKeyBuilder_ == null) { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } else { + return sshPublicKeyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSshPublicKey( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey value) { + if (sshPublicKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sshPublicKey_ = value; + } else { + sshPublicKeyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSshPublicKey( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder builderForValue) { + if (sshPublicKeyBuilder_ == null) { + sshPublicKey_ = builderForValue.build(); + } else { + sshPublicKeyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSshPublicKey( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey value) { + if (sshPublicKeyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && sshPublicKey_ != null + && sshPublicKey_ + != com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance()) { + getSshPublicKeyBuilder().mergeFrom(value); + } else { + sshPublicKey_ = value; + } + } else { + sshPublicKeyBuilder_.mergeFrom(value); + } + if (sshPublicKey_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSshPublicKey() { + bitField0_ = (bitField0_ & ~0x00000002); + sshPublicKey_ = null; + if (sshPublicKeyBuilder_ != null) { + sshPublicKeyBuilder_.dispose(); + sshPublicKeyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder + getSshPublicKeyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetSshPublicKeyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder + getSshPublicKeyOrBuilder() { + if (sshPublicKeyBuilder_ != null) { + return sshPublicKeyBuilder_.getMessageOrBuilder(); + } else { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder> + internalGetSshPublicKeyFieldBuilder() { + if (sshPublicKeyBuilder_ == null) { + sshPublicKeyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder>( + getSshPublicKey(), getParentForChildren(), isClean()); + sshPublicKey_ = null; + } + return sshPublicKeyBuilder_; + } + + private java.lang.Object projectId_ = ""; + + /** + * + * + *
+     * The project ID of the Google Cloud Platform project.
+     * 
+ * + * string project_id = 3; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the Google Cloud Platform project.
+     * 
+ * + * string project_id = 3; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the Google Cloud Platform project.
+     * 
+ * + * string project_id = 3; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + projectId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the Google Cloud Platform project.
+     * 
+ * + * string project_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + projectId_ = getDefaultInstance().getProjectId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the Google Cloud Platform project.
+     * 
+ * + * string project_id = 3; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + projectId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int view_ = 0; + + /** + * + * + *
+     * The view configures whether to retrieve security keys information.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+     * The view configures whether to retrieve security keys information.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The view configures whether to retrieve security keys information.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.LoginProfileView getView() { + com.google.cloud.oslogin.v1beta.LoginProfileView result = + com.google.cloud.oslogin.v1beta.LoginProfileView.forNumber(view_); + return result == null + ? com.google.cloud.oslogin.v1beta.LoginProfileView.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The view configures whether to retrieve security keys information.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.oslogin.v1beta.LoginProfileView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + view_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The view configures whether to retrieve security keys information.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000008); + view_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList regions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRegionsIsMutable() { + if (!regions_.isModifiable()) { + regions_ = new com.google.protobuf.LazyStringArrayList(regions_); + } + bitField0_ |= 0x00000010; + } + + /** + * + * + *
+     * Optional. The regions to which to assert that the key was written.
+     * If unspecified, defaults to all regions.
+     * Regions are listed at https://cloud.google.com/about/locations#region.
+     * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the regions. + */ + public com.google.protobuf.ProtocolStringList getRegionsList() { + regions_.makeImmutable(); + return regions_; + } + + /** + * + * + *
+     * Optional. The regions to which to assert that the key was written.
+     * If unspecified, defaults to all regions.
+     * Regions are listed at https://cloud.google.com/about/locations#region.
+     * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of regions. + */ + public int getRegionsCount() { + return regions_.size(); + } + + /** + * + * + *
+     * Optional. The regions to which to assert that the key was written.
+     * If unspecified, defaults to all regions.
+     * Regions are listed at https://cloud.google.com/about/locations#region.
+     * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The regions at the given index. + */ + public java.lang.String getRegions(int index) { + return regions_.get(index); + } + + /** + * + * + *
+     * Optional. The regions to which to assert that the key was written.
+     * If unspecified, defaults to all regions.
+     * Regions are listed at https://cloud.google.com/about/locations#region.
+     * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the regions at the given index. + */ + public com.google.protobuf.ByteString getRegionsBytes(int index) { + return regions_.getByteString(index); + } + + /** + * + * + *
+     * Optional. The regions to which to assert that the key was written.
+     * If unspecified, defaults to all regions.
+     * Regions are listed at https://cloud.google.com/about/locations#region.
+     * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The regions to set. + * @return This builder for chaining. + */ + public Builder setRegions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionsIsMutable(); + regions_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The regions to which to assert that the key was written.
+     * If unspecified, defaults to all regions.
+     * Regions are listed at https://cloud.google.com/about/locations#region.
+     * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The regions to add. + * @return This builder for chaining. + */ + public Builder addRegions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionsIsMutable(); + regions_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The regions to which to assert that the key was written.
+     * If unspecified, defaults to all regions.
+     * Regions are listed at https://cloud.google.com/about/locations#region.
+     * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The regions to add. + * @return This builder for chaining. + */ + public Builder addAllRegions(java.lang.Iterable values) { + ensureRegionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, regions_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The regions to which to assert that the key was written.
+     * If unspecified, defaults to all regions.
+     * Regions are listed at https://cloud.google.com/about/locations#region.
+     * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRegions() { + regions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The regions to which to assert that the key was written.
+     * If unspecified, defaults to all regions.
+     * Regions are listed at https://cloud.google.com/about/locations#region.
+     * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the regions to add. + * @return This builder for chaining. + */ + public Builder addRegionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRegionsIsMutable(); + regions_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest) + private static final com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest(); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportSshPublicKeyRequest 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.oslogin.v1beta.ImportSshPublicKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyRequestOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyRequestOrBuilder.java new file mode 100644 index 000000000000..cdf632715251 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyRequestOrBuilder.java @@ -0,0 +1,211 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface ImportSshPublicKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique ID for the user in format `users/{user}`.
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * The unique ID for the user in format `users/{user}`.
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sshPublicKey field is set. + */ + boolean hasSshPublicKey(); + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sshPublicKey. + */ + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKey(); + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder getSshPublicKeyOrBuilder(); + + /** + * + * + *
+   * The project ID of the Google Cloud Platform project.
+   * 
+ * + * string project_id = 3; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + + /** + * + * + *
+   * The project ID of the Google Cloud Platform project.
+   * 
+ * + * string project_id = 3; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * The view configures whether to retrieve security keys information.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + + /** + * + * + *
+   * The view configures whether to retrieve security keys information.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfileView view = 4; + * + * @return The view. + */ + com.google.cloud.oslogin.v1beta.LoginProfileView getView(); + + /** + * + * + *
+   * Optional. The regions to which to assert that the key was written.
+   * If unspecified, defaults to all regions.
+   * Regions are listed at https://cloud.google.com/about/locations#region.
+   * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the regions. + */ + java.util.List getRegionsList(); + + /** + * + * + *
+   * Optional. The regions to which to assert that the key was written.
+   * If unspecified, defaults to all regions.
+   * Regions are listed at https://cloud.google.com/about/locations#region.
+   * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of regions. + */ + int getRegionsCount(); + + /** + * + * + *
+   * Optional. The regions to which to assert that the key was written.
+   * If unspecified, defaults to all regions.
+   * Regions are listed at https://cloud.google.com/about/locations#region.
+   * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The regions at the given index. + */ + java.lang.String getRegions(int index); + + /** + * + * + *
+   * Optional. The regions to which to assert that the key was written.
+   * If unspecified, defaults to all regions.
+   * Regions are listed at https://cloud.google.com/about/locations#region.
+   * 
+ * + * repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the regions at the given index. + */ + com.google.protobuf.ByteString getRegionsBytes(int index); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyResponse.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyResponse.java new file mode 100644 index 000000000000..45133abaeeae --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyResponse.java @@ -0,0 +1,891 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * A response message for importing an SSH public key.
+ * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse} + */ +@com.google.protobuf.Generated +public final class ImportSshPublicKeyResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse) + ImportSshPublicKeyResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ImportSshPublicKeyResponse"); + } + + // Use ImportSshPublicKeyResponse.newBuilder() to construct. + private ImportSshPublicKeyResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ImportSshPublicKeyResponse() { + details_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.class, + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.Builder.class); + } + + private int bitField0_; + public static final int LOGIN_PROFILE_FIELD_NUMBER = 1; + private com.google.cloud.oslogin.v1beta.LoginProfile loginProfile_; + + /** + * + * + *
+   * The login profile information for the user.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + * + * @return Whether the loginProfile field is set. + */ + @java.lang.Override + public boolean hasLoginProfile() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The login profile information for the user.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + * + * @return The loginProfile. + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.LoginProfile getLoginProfile() { + return loginProfile_ == null + ? com.google.cloud.oslogin.v1beta.LoginProfile.getDefaultInstance() + : loginProfile_; + } + + /** + * + * + *
+   * The login profile information for the user.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.LoginProfileOrBuilder getLoginProfileOrBuilder() { + return loginProfile_ == null + ? com.google.cloud.oslogin.v1beta.LoginProfile.getDefaultInstance() + : loginProfile_; + } + + public static final int DETAILS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object details_ = ""; + + /** + * + * + *
+   * Detailed information about import results.
+   * 
+ * + * string details = 2; + * + * @return The details. + */ + @java.lang.Override + public java.lang.String getDetails() { + java.lang.Object ref = details_; + 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(); + details_ = s; + return s; + } + } + + /** + * + * + *
+   * Detailed information about import results.
+   * 
+ * + * string details = 2; + * + * @return The bytes for details. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDetailsBytes() { + java.lang.Object ref = details_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + details_ = 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getLoginProfile()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(details_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, details_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getLoginProfile()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(details_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, details_); + } + 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.oslogin.v1beta.ImportSshPublicKeyResponse)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse other = + (com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse) obj; + + if (hasLoginProfile() != other.hasLoginProfile()) return false; + if (hasLoginProfile()) { + if (!getLoginProfile().equals(other.getLoginProfile())) return false; + } + if (!getDetails().equals(other.getDetails())) 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 (hasLoginProfile()) { + hash = (37 * hash) + LOGIN_PROFILE_FIELD_NUMBER; + hash = (53 * hash) + getLoginProfile().hashCode(); + } + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse 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.oslogin.v1beta.ImportSshPublicKeyResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse 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.oslogin.v1beta.ImportSshPublicKeyResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.ImportSshPublicKeyResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A response message for importing an SSH public key.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse) + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.class, + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLoginProfileFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + loginProfile_ = null; + if (loginProfileBuilder_ != null) { + loginProfileBuilder_.dispose(); + loginProfileBuilder_ = null; + } + details_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse build() { + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse buildPartial() { + com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse result = + new com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.loginProfile_ = + loginProfileBuilder_ == null ? loginProfile_ : loginProfileBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.details_ = details_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse) { + return mergeFrom((com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse other) { + if (other == com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.getDefaultInstance()) + return this; + if (other.hasLoginProfile()) { + mergeLoginProfile(other.getLoginProfile()); + } + if (!other.getDetails().isEmpty()) { + details_ = other.details_; + bitField0_ |= 0x00000002; + 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( + internalGetLoginProfileFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + details_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 int bitField0_; + + private com.google.cloud.oslogin.v1beta.LoginProfile loginProfile_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.v1beta.LoginProfile, + com.google.cloud.oslogin.v1beta.LoginProfile.Builder, + com.google.cloud.oslogin.v1beta.LoginProfileOrBuilder> + loginProfileBuilder_; + + /** + * + * + *
+     * The login profile information for the user.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + * + * @return Whether the loginProfile field is set. + */ + public boolean hasLoginProfile() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The login profile information for the user.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + * + * @return The loginProfile. + */ + public com.google.cloud.oslogin.v1beta.LoginProfile getLoginProfile() { + if (loginProfileBuilder_ == null) { + return loginProfile_ == null + ? com.google.cloud.oslogin.v1beta.LoginProfile.getDefaultInstance() + : loginProfile_; + } else { + return loginProfileBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The login profile information for the user.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + */ + public Builder setLoginProfile(com.google.cloud.oslogin.v1beta.LoginProfile value) { + if (loginProfileBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + loginProfile_ = value; + } else { + loginProfileBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The login profile information for the user.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + */ + public Builder setLoginProfile( + com.google.cloud.oslogin.v1beta.LoginProfile.Builder builderForValue) { + if (loginProfileBuilder_ == null) { + loginProfile_ = builderForValue.build(); + } else { + loginProfileBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The login profile information for the user.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + */ + public Builder mergeLoginProfile(com.google.cloud.oslogin.v1beta.LoginProfile value) { + if (loginProfileBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && loginProfile_ != null + && loginProfile_ != com.google.cloud.oslogin.v1beta.LoginProfile.getDefaultInstance()) { + getLoginProfileBuilder().mergeFrom(value); + } else { + loginProfile_ = value; + } + } else { + loginProfileBuilder_.mergeFrom(value); + } + if (loginProfile_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The login profile information for the user.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + */ + public Builder clearLoginProfile() { + bitField0_ = (bitField0_ & ~0x00000001); + loginProfile_ = null; + if (loginProfileBuilder_ != null) { + loginProfileBuilder_.dispose(); + loginProfileBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The login profile information for the user.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + */ + public com.google.cloud.oslogin.v1beta.LoginProfile.Builder getLoginProfileBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetLoginProfileFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The login profile information for the user.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + */ + public com.google.cloud.oslogin.v1beta.LoginProfileOrBuilder getLoginProfileOrBuilder() { + if (loginProfileBuilder_ != null) { + return loginProfileBuilder_.getMessageOrBuilder(); + } else { + return loginProfile_ == null + ? com.google.cloud.oslogin.v1beta.LoginProfile.getDefaultInstance() + : loginProfile_; + } + } + + /** + * + * + *
+     * The login profile information for the user.
+     * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.v1beta.LoginProfile, + com.google.cloud.oslogin.v1beta.LoginProfile.Builder, + com.google.cloud.oslogin.v1beta.LoginProfileOrBuilder> + internalGetLoginProfileFieldBuilder() { + if (loginProfileBuilder_ == null) { + loginProfileBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.v1beta.LoginProfile, + com.google.cloud.oslogin.v1beta.LoginProfile.Builder, + com.google.cloud.oslogin.v1beta.LoginProfileOrBuilder>( + getLoginProfile(), getParentForChildren(), isClean()); + loginProfile_ = null; + } + return loginProfileBuilder_; + } + + private java.lang.Object details_ = ""; + + /** + * + * + *
+     * Detailed information about import results.
+     * 
+ * + * string details = 2; + * + * @return The details. + */ + public java.lang.String getDetails() { + java.lang.Object ref = details_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + details_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Detailed information about import results.
+     * 
+ * + * string details = 2; + * + * @return The bytes for details. + */ + public com.google.protobuf.ByteString getDetailsBytes() { + java.lang.Object ref = details_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + details_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Detailed information about import results.
+     * 
+ * + * string details = 2; + * + * @param value The details to set. + * @return This builder for chaining. + */ + public Builder setDetails(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Detailed information about import results.
+     * 
+ * + * string details = 2; + * + * @return This builder for chaining. + */ + public Builder clearDetails() { + details_ = getDefaultInstance().getDetails(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Detailed information about import results.
+     * 
+ * + * string details = 2; + * + * @param value The bytes for details to set. + * @return This builder for chaining. + */ + public Builder setDetailsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + details_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse) + private static final com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse(); + } + + public static com.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportSshPublicKeyResponse 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.oslogin.v1beta.ImportSshPublicKeyResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyResponseOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyResponseOrBuilder.java new file mode 100644 index 000000000000..1650ba2a591f --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/ImportSshPublicKeyResponseOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface ImportSshPublicKeyResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The login profile information for the user.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + * + * @return Whether the loginProfile field is set. + */ + boolean hasLoginProfile(); + + /** + * + * + *
+   * The login profile information for the user.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + * + * @return The loginProfile. + */ + com.google.cloud.oslogin.v1beta.LoginProfile getLoginProfile(); + + /** + * + * + *
+   * The login profile information for the user.
+   * 
+ * + * .google.cloud.oslogin.v1beta.LoginProfile login_profile = 1; + */ + com.google.cloud.oslogin.v1beta.LoginProfileOrBuilder getLoginProfileOrBuilder(); + + /** + * + * + *
+   * Detailed information about import results.
+   * 
+ * + * string details = 2; + * + * @return The details. + */ + java.lang.String getDetails(); + + /** + * + * + *
+   * Detailed information about import results.
+   * 
+ * + * string details = 2; + * + * @return The bytes for details. + */ + com.google.protobuf.ByteString getDetailsBytes(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfile.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfile.java new file mode 100644 index 000000000000..17979ab99906 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfile.java @@ -0,0 +1,2113 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * The user profile information used for logging in to a virtual machine on
+ * Google Compute Engine.
+ * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.LoginProfile} + */ +@com.google.protobuf.Generated +public final class LoginProfile extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.LoginProfile) + LoginProfileOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LoginProfile"); + } + + // Use LoginProfile.newBuilder() to construct. + private LoginProfile(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private LoginProfile() { + name_ = ""; + posixAccounts_ = java.util.Collections.emptyList(); + securityKeys_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_LoginProfile_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetSshPublicKeys(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_LoginProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.LoginProfile.class, + com.google.cloud.oslogin.v1beta.LoginProfile.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. A unique user 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. A unique user 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 POSIX_ACCOUNTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List posixAccounts_; + + /** + * + * + *
+   * The list of POSIX accounts associated with the user.
+   * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + @java.lang.Override + public java.util.List + getPosixAccountsList() { + return posixAccounts_; + } + + /** + * + * + *
+   * The list of POSIX accounts associated with the user.
+   * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.oslogin.common.OsLoginProto.PosixAccountOrBuilder> + getPosixAccountsOrBuilderList() { + return posixAccounts_; + } + + /** + * + * + *
+   * The list of POSIX accounts associated with the user.
+   * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + @java.lang.Override + public int getPosixAccountsCount() { + return posixAccounts_.size(); + } + + /** + * + * + *
+   * The list of POSIX accounts associated with the user.
+   * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.PosixAccount getPosixAccounts(int index) { + return posixAccounts_.get(index); + } + + /** + * + * + *
+   * The list of POSIX accounts associated with the user.
+   * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.PosixAccountOrBuilder + getPosixAccountsOrBuilder(int index) { + return posixAccounts_.get(index); + } + + public static final int SSH_PUBLIC_KEYS_FIELD_NUMBER = 3; + + private static final class SshPublicKeysDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_LoginProfile_SshPublicKeysEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + sshPublicKeys_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + internalGetSshPublicKeys() { + if (sshPublicKeys_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SshPublicKeysDefaultEntryHolder.defaultEntry); + } + return sshPublicKeys_; + } + + public int getSshPublicKeysCount() { + return internalGetSshPublicKeys().getMap().size(); + } + + /** + * + * + *
+   * A map from SSH public key fingerprint to the associated key object.
+   * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + */ + @java.lang.Override + public boolean containsSshPublicKeys(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetSshPublicKeys().getMap().containsKey(key); + } + + /** Use {@link #getSshPublicKeysMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getSshPublicKeys() { + return getSshPublicKeysMap(); + } + + /** + * + * + *
+   * A map from SSH public key fingerprint to the associated key object.
+   * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + */ + @java.lang.Override + public java.util.Map + getSshPublicKeysMap() { + return internalGetSshPublicKeys().getMap(); + } + + /** + * + * + *
+   * A map from SSH public key fingerprint to the associated key object.
+   * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + */ + @java.lang.Override + public /* nullable */ com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey + getSshPublicKeysOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetSshPublicKeys().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * A map from SSH public key fingerprint to the associated key object.
+   * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKeysOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetSshPublicKeys().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SECURITY_KEYS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List securityKeys_; + + /** + * + * + *
+   * The registered security key credentials for a user.
+   * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + @java.lang.Override + public java.util.List getSecurityKeysList() { + return securityKeys_; + } + + /** + * + * + *
+   * The registered security key credentials for a user.
+   * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + @java.lang.Override + public java.util.List + getSecurityKeysOrBuilderList() { + return securityKeys_; + } + + /** + * + * + *
+   * The registered security key credentials for a user.
+   * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + @java.lang.Override + public int getSecurityKeysCount() { + return securityKeys_.size(); + } + + /** + * + * + *
+   * The registered security key credentials for a user.
+   * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.SecurityKey getSecurityKeys(int index) { + return securityKeys_.get(index); + } + + /** + * + * + *
+   * The registered security key credentials for a user.
+   * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.SecurityKeyOrBuilder getSecurityKeysOrBuilder(int index) { + return securityKeys_.get(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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < posixAccounts_.size(); i++) { + output.writeMessage(2, posixAccounts_.get(i)); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetSshPublicKeys(), SshPublicKeysDefaultEntryHolder.defaultEntry, 3); + for (int i = 0; i < securityKeys_.size(); i++) { + output.writeMessage(5, securityKeys_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (int i = 0; i < posixAccounts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, posixAccounts_.get(i)); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + entry : internalGetSshPublicKeys().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + sshPublicKeys__ = + SshPublicKeysDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, sshPublicKeys__); + } + for (int i = 0; i < securityKeys_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, securityKeys_.get(i)); + } + 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.oslogin.v1beta.LoginProfile)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.LoginProfile other = + (com.google.cloud.oslogin.v1beta.LoginProfile) obj; + + if (!getName().equals(other.getName())) return false; + if (!getPosixAccountsList().equals(other.getPosixAccountsList())) return false; + if (!internalGetSshPublicKeys().equals(other.internalGetSshPublicKeys())) return false; + if (!getSecurityKeysList().equals(other.getSecurityKeysList())) 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 (getPosixAccountsCount() > 0) { + hash = (37 * hash) + POSIX_ACCOUNTS_FIELD_NUMBER; + hash = (53 * hash) + getPosixAccountsList().hashCode(); + } + if (!internalGetSshPublicKeys().getMap().isEmpty()) { + hash = (37 * hash) + SSH_PUBLIC_KEYS_FIELD_NUMBER; + hash = (53 * hash) + internalGetSshPublicKeys().hashCode(); + } + if (getSecurityKeysCount() > 0) { + hash = (37 * hash) + SECURITY_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getSecurityKeysList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.LoginProfile parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.LoginProfile 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.oslogin.v1beta.LoginProfile parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.LoginProfile 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.oslogin.v1beta.LoginProfile parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.LoginProfile parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.LoginProfile parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.LoginProfile parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.LoginProfile parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.LoginProfile parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.LoginProfile parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.LoginProfile parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.LoginProfile 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The user profile information used for logging in to a virtual machine on
+   * Google Compute Engine.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.LoginProfile} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.LoginProfile) + com.google.cloud.oslogin.v1beta.LoginProfileOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_LoginProfile_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetSshPublicKeys(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetMutableSshPublicKeys(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_LoginProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.LoginProfile.class, + com.google.cloud.oslogin.v1beta.LoginProfile.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.LoginProfile.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (posixAccountsBuilder_ == null) { + posixAccounts_ = java.util.Collections.emptyList(); + } else { + posixAccounts_ = null; + posixAccountsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableSshPublicKeys().clear(); + if (securityKeysBuilder_ == null) { + securityKeys_ = java.util.Collections.emptyList(); + } else { + securityKeys_ = null; + securityKeysBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_LoginProfile_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.LoginProfile getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.LoginProfile.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.LoginProfile build() { + com.google.cloud.oslogin.v1beta.LoginProfile result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.LoginProfile buildPartial() { + com.google.cloud.oslogin.v1beta.LoginProfile result = + new com.google.cloud.oslogin.v1beta.LoginProfile(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.oslogin.v1beta.LoginProfile result) { + if (posixAccountsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + posixAccounts_ = java.util.Collections.unmodifiableList(posixAccounts_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.posixAccounts_ = posixAccounts_; + } else { + result.posixAccounts_ = posixAccountsBuilder_.build(); + } + if (securityKeysBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + securityKeys_ = java.util.Collections.unmodifiableList(securityKeys_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.securityKeys_ = securityKeys_; + } else { + result.securityKeys_ = securityKeysBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.LoginProfile result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sshPublicKeys_ = + internalGetSshPublicKeys().build(SshPublicKeysDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.LoginProfile) { + return mergeFrom((com.google.cloud.oslogin.v1beta.LoginProfile) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.LoginProfile other) { + if (other == com.google.cloud.oslogin.v1beta.LoginProfile.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (posixAccountsBuilder_ == null) { + if (!other.posixAccounts_.isEmpty()) { + if (posixAccounts_.isEmpty()) { + posixAccounts_ = other.posixAccounts_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePosixAccountsIsMutable(); + posixAccounts_.addAll(other.posixAccounts_); + } + onChanged(); + } + } else { + if (!other.posixAccounts_.isEmpty()) { + if (posixAccountsBuilder_.isEmpty()) { + posixAccountsBuilder_.dispose(); + posixAccountsBuilder_ = null; + posixAccounts_ = other.posixAccounts_; + bitField0_ = (bitField0_ & ~0x00000002); + posixAccountsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPosixAccountsFieldBuilder() + : null; + } else { + posixAccountsBuilder_.addAllMessages(other.posixAccounts_); + } + } + } + internalGetMutableSshPublicKeys().mergeFrom(other.internalGetSshPublicKeys()); + bitField0_ |= 0x00000004; + if (securityKeysBuilder_ == null) { + if (!other.securityKeys_.isEmpty()) { + if (securityKeys_.isEmpty()) { + securityKeys_ = other.securityKeys_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSecurityKeysIsMutable(); + securityKeys_.addAll(other.securityKeys_); + } + onChanged(); + } + } else { + if (!other.securityKeys_.isEmpty()) { + if (securityKeysBuilder_.isEmpty()) { + securityKeysBuilder_.dispose(); + securityKeysBuilder_ = null; + securityKeys_ = other.securityKeys_; + bitField0_ = (bitField0_ & ~0x00000008); + securityKeysBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSecurityKeysFieldBuilder() + : null; + } else { + securityKeysBuilder_.addAllMessages(other.securityKeys_); + } + } + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount m = + input.readMessage( + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.parser(), + extensionRegistry); + if (posixAccountsBuilder_ == null) { + ensurePosixAccountsIsMutable(); + posixAccounts_.add(m); + } else { + posixAccountsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + sshPublicKeys__ = + input.readMessage( + SshPublicKeysDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableSshPublicKeys() + .ensureBuilderMap() + .put(sshPublicKeys__.getKey(), sshPublicKeys__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + com.google.cloud.oslogin.v1beta.SecurityKey m = + input.readMessage( + com.google.cloud.oslogin.v1beta.SecurityKey.parser(), extensionRegistry); + if (securityKeysBuilder_ == null) { + ensureSecurityKeysIsMutable(); + securityKeys_.add(m); + } else { + securityKeysBuilder_.addMessage(m); + } + break; + } // case 42 + 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 java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. A unique user 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. A unique user 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. A unique user 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A unique user ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A unique user 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List + posixAccounts_ = java.util.Collections.emptyList(); + + private void ensurePosixAccountsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + posixAccounts_ = + new java.util.ArrayList( + posixAccounts_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount, + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.Builder, + com.google.cloud.oslogin.common.OsLoginProto.PosixAccountOrBuilder> + posixAccountsBuilder_; + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public java.util.List + getPosixAccountsList() { + if (posixAccountsBuilder_ == null) { + return java.util.Collections.unmodifiableList(posixAccounts_); + } else { + return posixAccountsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public int getPosixAccountsCount() { + if (posixAccountsBuilder_ == null) { + return posixAccounts_.size(); + } else { + return posixAccountsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public com.google.cloud.oslogin.common.OsLoginProto.PosixAccount getPosixAccounts(int index) { + if (posixAccountsBuilder_ == null) { + return posixAccounts_.get(index); + } else { + return posixAccountsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public Builder setPosixAccounts( + int index, com.google.cloud.oslogin.common.OsLoginProto.PosixAccount value) { + if (posixAccountsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePosixAccountsIsMutable(); + posixAccounts_.set(index, value); + onChanged(); + } else { + posixAccountsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public Builder setPosixAccounts( + int index, + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.Builder builderForValue) { + if (posixAccountsBuilder_ == null) { + ensurePosixAccountsIsMutable(); + posixAccounts_.set(index, builderForValue.build()); + onChanged(); + } else { + posixAccountsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public Builder addPosixAccounts( + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount value) { + if (posixAccountsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePosixAccountsIsMutable(); + posixAccounts_.add(value); + onChanged(); + } else { + posixAccountsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public Builder addPosixAccounts( + int index, com.google.cloud.oslogin.common.OsLoginProto.PosixAccount value) { + if (posixAccountsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePosixAccountsIsMutable(); + posixAccounts_.add(index, value); + onChanged(); + } else { + posixAccountsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public Builder addPosixAccounts( + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.Builder builderForValue) { + if (posixAccountsBuilder_ == null) { + ensurePosixAccountsIsMutable(); + posixAccounts_.add(builderForValue.build()); + onChanged(); + } else { + posixAccountsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public Builder addPosixAccounts( + int index, + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.Builder builderForValue) { + if (posixAccountsBuilder_ == null) { + ensurePosixAccountsIsMutable(); + posixAccounts_.add(index, builderForValue.build()); + onChanged(); + } else { + posixAccountsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public Builder addAllPosixAccounts( + java.lang.Iterable + values) { + if (posixAccountsBuilder_ == null) { + ensurePosixAccountsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, posixAccounts_); + onChanged(); + } else { + posixAccountsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public Builder clearPosixAccounts() { + if (posixAccountsBuilder_ == null) { + posixAccounts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + posixAccountsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public Builder removePosixAccounts(int index) { + if (posixAccountsBuilder_ == null) { + ensurePosixAccountsIsMutable(); + posixAccounts_.remove(index); + onChanged(); + } else { + posixAccountsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.Builder + getPosixAccountsBuilder(int index) { + return internalGetPosixAccountsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public com.google.cloud.oslogin.common.OsLoginProto.PosixAccountOrBuilder + getPosixAccountsOrBuilder(int index) { + if (posixAccountsBuilder_ == null) { + return posixAccounts_.get(index); + } else { + return posixAccountsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public java.util.List< + ? extends com.google.cloud.oslogin.common.OsLoginProto.PosixAccountOrBuilder> + getPosixAccountsOrBuilderList() { + if (posixAccountsBuilder_ != null) { + return posixAccountsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(posixAccounts_); + } + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.Builder + addPosixAccountsBuilder() { + return internalGetPosixAccountsFieldBuilder() + .addBuilder( + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.Builder + addPosixAccountsBuilder(int index) { + return internalGetPosixAccountsFieldBuilder() + .addBuilder( + index, + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of POSIX accounts associated with the user.
+     * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + public java.util.List + getPosixAccountsBuilderList() { + return internalGetPosixAccountsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount, + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.Builder, + com.google.cloud.oslogin.common.OsLoginProto.PosixAccountOrBuilder> + internalGetPosixAccountsFieldBuilder() { + if (posixAccountsBuilder_ == null) { + posixAccountsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount, + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount.Builder, + com.google.cloud.oslogin.common.OsLoginProto.PosixAccountOrBuilder>( + posixAccounts_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + posixAccounts_ = null; + } + return posixAccountsBuilder_; + } + + private static final class SshPublicKeysConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> { + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey build( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder val) { + if (val instanceof com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey) { + return (com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey) val; + } + return ((com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + defaultEntry() { + return SshPublicKeysDefaultEntryHolder.defaultEntry; + } + } + ; + + private static final SshPublicKeysConverter sshPublicKeysConverter = + new SshPublicKeysConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder> + sshPublicKeys_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder> + internalGetSshPublicKeys() { + if (sshPublicKeys_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(sshPublicKeysConverter); + } + return sshPublicKeys_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder> + internalGetMutableSshPublicKeys() { + if (sshPublicKeys_ == null) { + sshPublicKeys_ = new com.google.protobuf.MapFieldBuilder<>(sshPublicKeysConverter); + } + bitField0_ |= 0x00000004; + onChanged(); + return sshPublicKeys_; + } + + public int getSshPublicKeysCount() { + return internalGetSshPublicKeys().ensureBuilderMap().size(); + } + + /** + * + * + *
+     * A map from SSH public key fingerprint to the associated key object.
+     * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + * + */ + @java.lang.Override + public boolean containsSshPublicKeys(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetSshPublicKeys().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getSshPublicKeysMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getSshPublicKeys() { + return getSshPublicKeysMap(); + } + + /** + * + * + *
+     * A map from SSH public key fingerprint to the associated key object.
+     * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getSshPublicKeysMap() { + return internalGetSshPublicKeys().getImmutableMap(); + } + + /** + * + * + *
+     * A map from SSH public key fingerprint to the associated key object.
+     * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey + getSshPublicKeysOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder> + map = internalGetMutableSshPublicKeys().ensureBuilderMap(); + return map.containsKey(key) ? sshPublicKeysConverter.build(map.get(key)) : defaultValue; + } + + /** + * + * + *
+     * A map from SSH public key fingerprint to the associated key object.
+     * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + * + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKeysOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder> + map = internalGetMutableSshPublicKeys().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return sshPublicKeysConverter.build(map.get(key)); + } + + public Builder clearSshPublicKeys() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableSshPublicKeys().clear(); + return this; + } + + /** + * + * + *
+     * A map from SSH public key fingerprint to the associated key object.
+     * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + * + */ + public Builder removeSshPublicKeys(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableSshPublicKeys().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + getMutableSshPublicKeys() { + bitField0_ |= 0x00000004; + return internalGetMutableSshPublicKeys().ensureMessageMap(); + } + + /** + * + * + *
+     * A map from SSH public key fingerprint to the associated key object.
+     * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + * + */ + public Builder putSshPublicKeys( + java.lang.String key, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableSshPublicKeys().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000004; + return this; + } + + /** + * + * + *
+     * A map from SSH public key fingerprint to the associated key object.
+     * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + * + */ + public Builder putAllSshPublicKeys( + java.util.Map + values) { + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey> + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableSshPublicKeys().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + /** + * + * + *
+     * A map from SSH public key fingerprint to the associated key object.
+     * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + * + */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder + putSshPublicKeysBuilderIfAbsent(java.lang.String key) { + java.util.Map< + java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder> + builderMap = internalGetMutableSshPublicKeys().ensureBuilderMap(); + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder entry = + builderMap.get(key); + if (entry == null) { + entry = com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey) { + entry = ((com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder) entry; + } + + private java.util.List securityKeys_ = + java.util.Collections.emptyList(); + + private void ensureSecurityKeysIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + securityKeys_ = + new java.util.ArrayList(securityKeys_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.oslogin.v1beta.SecurityKey, + com.google.cloud.oslogin.v1beta.SecurityKey.Builder, + com.google.cloud.oslogin.v1beta.SecurityKeyOrBuilder> + securityKeysBuilder_; + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public java.util.List getSecurityKeysList() { + if (securityKeysBuilder_ == null) { + return java.util.Collections.unmodifiableList(securityKeys_); + } else { + return securityKeysBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public int getSecurityKeysCount() { + if (securityKeysBuilder_ == null) { + return securityKeys_.size(); + } else { + return securityKeysBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public com.google.cloud.oslogin.v1beta.SecurityKey getSecurityKeys(int index) { + if (securityKeysBuilder_ == null) { + return securityKeys_.get(index); + } else { + return securityKeysBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public Builder setSecurityKeys(int index, com.google.cloud.oslogin.v1beta.SecurityKey value) { + if (securityKeysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecurityKeysIsMutable(); + securityKeys_.set(index, value); + onChanged(); + } else { + securityKeysBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public Builder setSecurityKeys( + int index, com.google.cloud.oslogin.v1beta.SecurityKey.Builder builderForValue) { + if (securityKeysBuilder_ == null) { + ensureSecurityKeysIsMutable(); + securityKeys_.set(index, builderForValue.build()); + onChanged(); + } else { + securityKeysBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public Builder addSecurityKeys(com.google.cloud.oslogin.v1beta.SecurityKey value) { + if (securityKeysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecurityKeysIsMutable(); + securityKeys_.add(value); + onChanged(); + } else { + securityKeysBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public Builder addSecurityKeys(int index, com.google.cloud.oslogin.v1beta.SecurityKey value) { + if (securityKeysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecurityKeysIsMutable(); + securityKeys_.add(index, value); + onChanged(); + } else { + securityKeysBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public Builder addSecurityKeys( + com.google.cloud.oslogin.v1beta.SecurityKey.Builder builderForValue) { + if (securityKeysBuilder_ == null) { + ensureSecurityKeysIsMutable(); + securityKeys_.add(builderForValue.build()); + onChanged(); + } else { + securityKeysBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public Builder addSecurityKeys( + int index, com.google.cloud.oslogin.v1beta.SecurityKey.Builder builderForValue) { + if (securityKeysBuilder_ == null) { + ensureSecurityKeysIsMutable(); + securityKeys_.add(index, builderForValue.build()); + onChanged(); + } else { + securityKeysBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public Builder addAllSecurityKeys( + java.lang.Iterable values) { + if (securityKeysBuilder_ == null) { + ensureSecurityKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, securityKeys_); + onChanged(); + } else { + securityKeysBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public Builder clearSecurityKeys() { + if (securityKeysBuilder_ == null) { + securityKeys_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + securityKeysBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public Builder removeSecurityKeys(int index) { + if (securityKeysBuilder_ == null) { + ensureSecurityKeysIsMutable(); + securityKeys_.remove(index); + onChanged(); + } else { + securityKeysBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public com.google.cloud.oslogin.v1beta.SecurityKey.Builder getSecurityKeysBuilder(int index) { + return internalGetSecurityKeysFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public com.google.cloud.oslogin.v1beta.SecurityKeyOrBuilder getSecurityKeysOrBuilder( + int index) { + if (securityKeysBuilder_ == null) { + return securityKeys_.get(index); + } else { + return securityKeysBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public java.util.List + getSecurityKeysOrBuilderList() { + if (securityKeysBuilder_ != null) { + return securityKeysBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(securityKeys_); + } + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public com.google.cloud.oslogin.v1beta.SecurityKey.Builder addSecurityKeysBuilder() { + return internalGetSecurityKeysFieldBuilder() + .addBuilder(com.google.cloud.oslogin.v1beta.SecurityKey.getDefaultInstance()); + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public com.google.cloud.oslogin.v1beta.SecurityKey.Builder addSecurityKeysBuilder(int index) { + return internalGetSecurityKeysFieldBuilder() + .addBuilder(index, com.google.cloud.oslogin.v1beta.SecurityKey.getDefaultInstance()); + } + + /** + * + * + *
+     * The registered security key credentials for a user.
+     * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + public java.util.List + getSecurityKeysBuilderList() { + return internalGetSecurityKeysFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.oslogin.v1beta.SecurityKey, + com.google.cloud.oslogin.v1beta.SecurityKey.Builder, + com.google.cloud.oslogin.v1beta.SecurityKeyOrBuilder> + internalGetSecurityKeysFieldBuilder() { + if (securityKeysBuilder_ == null) { + securityKeysBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.oslogin.v1beta.SecurityKey, + com.google.cloud.oslogin.v1beta.SecurityKey.Builder, + com.google.cloud.oslogin.v1beta.SecurityKeyOrBuilder>( + securityKeys_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + securityKeys_ = null; + } + return securityKeysBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.LoginProfile) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.LoginProfile) + private static final com.google.cloud.oslogin.v1beta.LoginProfile DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.LoginProfile(); + } + + public static com.google.cloud.oslogin.v1beta.LoginProfile getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LoginProfile 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.oslogin.v1beta.LoginProfile getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfileOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfileOrBuilder.java new file mode 100644 index 000000000000..a4a20f0e346e --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfileOrBuilder.java @@ -0,0 +1,233 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface LoginProfileOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.LoginProfile) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A unique user ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. A unique user ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The list of POSIX accounts associated with the user.
+   * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + java.util.List getPosixAccountsList(); + + /** + * + * + *
+   * The list of POSIX accounts associated with the user.
+   * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + com.google.cloud.oslogin.common.OsLoginProto.PosixAccount getPosixAccounts(int index); + + /** + * + * + *
+   * The list of POSIX accounts associated with the user.
+   * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + int getPosixAccountsCount(); + + /** + * + * + *
+   * The list of POSIX accounts associated with the user.
+   * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + java.util.List + getPosixAccountsOrBuilderList(); + + /** + * + * + *
+   * The list of POSIX accounts associated with the user.
+   * 
+ * + * repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + */ + com.google.cloud.oslogin.common.OsLoginProto.PosixAccountOrBuilder getPosixAccountsOrBuilder( + int index); + + /** + * + * + *
+   * A map from SSH public key fingerprint to the associated key object.
+   * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + */ + int getSshPublicKeysCount(); + + /** + * + * + *
+   * A map from SSH public key fingerprint to the associated key object.
+   * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + */ + boolean containsSshPublicKeys(java.lang.String key); + + /** Use {@link #getSshPublicKeysMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getSshPublicKeys(); + + /** + * + * + *
+   * A map from SSH public key fingerprint to the associated key object.
+   * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + */ + java.util.Map + getSshPublicKeysMap(); + + /** + * + * + *
+   * A map from SSH public key fingerprint to the associated key object.
+   * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + */ + /* nullable */ + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKeysOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey defaultValue); + + /** + * + * + *
+   * A map from SSH public key fingerprint to the associated key object.
+   * 
+ * + * map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3; + */ + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKeysOrThrow( + java.lang.String key); + + /** + * + * + *
+   * The registered security key credentials for a user.
+   * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + java.util.List getSecurityKeysList(); + + /** + * + * + *
+   * The registered security key credentials for a user.
+   * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + com.google.cloud.oslogin.v1beta.SecurityKey getSecurityKeys(int index); + + /** + * + * + *
+   * The registered security key credentials for a user.
+   * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + int getSecurityKeysCount(); + + /** + * + * + *
+   * The registered security key credentials for a user.
+   * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + java.util.List + getSecurityKeysOrBuilderList(); + + /** + * + * + *
+   * The registered security key credentials for a user.
+   * 
+ * + * repeated .google.cloud.oslogin.v1beta.SecurityKey security_keys = 5; + */ + com.google.cloud.oslogin.v1beta.SecurityKeyOrBuilder getSecurityKeysOrBuilder(int index); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfileView.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfileView.java new file mode 100644 index 000000000000..fcde3ba8e63f --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/LoginProfileView.java @@ -0,0 +1,191 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * The login profile view limits the user content retrieved.
+ * 
+ * + * Protobuf enum {@code google.cloud.oslogin.v1beta.LoginProfileView} + */ +@com.google.protobuf.Generated +public enum LoginProfileView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The default login profile view. The API defaults to the BASIC view.
+   * 
+ * + * LOGIN_PROFILE_VIEW_UNSPECIFIED = 0; + */ + LOGIN_PROFILE_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * Includes POSIX and SSH key information.
+   * 
+ * + * BASIC = 1; + */ + BASIC(1), + /** + * + * + *
+   * Include security key information for the user.
+   * 
+ * + * SECURITY_KEY = 2; + */ + SECURITY_KEY(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LoginProfileView"); + } + + /** + * + * + *
+   * The default login profile view. The API defaults to the BASIC view.
+   * 
+ * + * LOGIN_PROFILE_VIEW_UNSPECIFIED = 0; + */ + public static final int LOGIN_PROFILE_VIEW_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Includes POSIX and SSH key information.
+   * 
+ * + * BASIC = 1; + */ + public static final int BASIC_VALUE = 1; + + /** + * + * + *
+   * Include security key information for the user.
+   * 
+ * + * SECURITY_KEY = 2; + */ + public static final int SECURITY_KEY_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 LoginProfileView 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 LoginProfileView forNumber(int value) { + switch (value) { + case 0: + return LOGIN_PROFILE_VIEW_UNSPECIFIED; + case 1: + return BASIC; + case 2: + return SECURITY_KEY; + 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 LoginProfileView findValueByNumber(int number) { + return LoginProfileView.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto.getDescriptor().getEnumTypes().get(0); + } + + private static final LoginProfileView[] VALUES = values(); + + public static LoginProfileView 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 LoginProfileView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.oslogin.v1beta.LoginProfileView) +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginProto.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginProto.java new file mode 100644 index 000000000000..4d3c4af1f5da --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/OsLoginProto.java @@ -0,0 +1,384 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public final class OsLoginProto extends com.google.protobuf.GeneratedFile { + private OsLoginProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OsLoginProto"); + } + + 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_oslogin_v1beta_LoginProfile_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_LoginProfile_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_LoginProfile_SshPublicKeysEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_LoginProfile_SshPublicKeysEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_CreateSshPublicKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_CreateSshPublicKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_DeletePosixAccountRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_DeletePosixAccountRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_DeleteSshPublicKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_DeleteSshPublicKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_GetLoginProfileRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_GetLoginProfileRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_GetSshPublicKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_GetSshPublicKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_ImportSshPublicKeyResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_UpdateSshPublicKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_UpdateSshPublicKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_SecurityKey_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_SecurityKey_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_UniversalTwoFactor_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_UniversalTwoFactor_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_WebAuthn_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_WebAuthn_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n)google/cloud/oslogin/v1beta/oslogin.pr" + + "oto\022\033google.cloud.oslogin.v1beta\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032\037google/api/field_behavior.proto" + + "\032\031google/api/resource.proto\032(google/clou" + + "d/oslogin/common/common.proto\032\033google/pr" + + "otobuf/empty.proto\032 google/protobuf/fiel" + + "d_mask.proto\"\335\002\n\014LoginProfile\022\021\n\004name\030\001 " + + "\001(\tB\003\340A\002\022A\n\016posix_accounts\030\002 \003(\0132).googl" + + "e.cloud.oslogin.common.PosixAccount\022U\n\017s" + + "sh_public_keys\030\003 \003(\0132<.google.cloud.oslo" + + "gin.v1beta.LoginProfile.SshPublicKeysEnt" + + "ry\022?\n\rsecurity_keys\030\005 \003(\0132(.google.cloud" + + ".oslogin.v1beta.SecurityKey\032_\n\022SshPublic" + + "KeysEntry\022\013\n\003key\030\001 \001(\t\0228\n\005value\030\002 \001(\0132)." + + "google.cloud.oslogin.common.SshPublicKey" + + ":\0028\001\"\240\001\n\031CreateSshPublicKeyRequest\022;\n\006pa" + + "rent\030\001 \001(\tB+\340A\002\372A%\022#oslogin.googleapis.c" + + "om/SshPublicKey\022F\n\016ssh_public_key\030\002 \001(\0132" + + ").google.cloud.oslogin.common.SshPublicK" + + "eyB\003\340A\002\"V\n\031DeletePosixAccountRequest\0229\n\004" + + "name\030\001 \001(\tB+\340A\002\372A%\n#oslogin.googleapis.c" + + "om/PosixAccount\"V\n\031DeleteSshPublicKeyReq" + + "uest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#oslogin.goog" + + "leapis.com/SshPublicKey\"\257\001\n\026GetLoginProf" + + "ileRequest\0221\n\004name\030\001 \001(\tB#\340A\002\372A\035\n\033oslogi" + + "n.googleapis.com/User\022\022\n\nproject_id\030\002 \001(" + + "\t\022\021\n\tsystem_id\030\003 \001(\t\022;\n\004view\030\004 \001(\0162-.goo" + + "gle.cloud.oslogin.v1beta.LoginProfileVie" + + "w\"S\n\026GetSshPublicKeyRequest\0229\n\004name\030\001 \001(" + + "\tB+\340A\002\372A%\n#oslogin.googleapis.com/SshPub" + + "licKey\"\204\002\n\031ImportSshPublicKeyRequest\0228\n\006" + + "parent\030\001 \001(\tB(\372A%\022#oslogin.googleapis.co" + + "m/SshPublicKey\022F\n\016ssh_public_key\030\002 \001(\0132)" + + ".google.cloud.oslogin.common.SshPublicKe" + + "yB\003\340A\002\022\022\n\nproject_id\030\003 \001(\t\022;\n\004view\030\004 \001(\016" + + "2-.google.cloud.oslogin.v1beta.LoginProf" + + "ileView\022\024\n\007regions\030\005 \003(\tB\003\340A\001\"o\n\032ImportS" + + "shPublicKeyResponse\022@\n\rlogin_profile\030\001 \001" + + "(\0132).google.cloud.oslogin.v1beta.LoginPr" + + "ofile\022\017\n\007details\030\002 \001(\t\"\317\001\n\031UpdateSshPubl" + + "icKeyRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#oslo" + + "gin.googleapis.com/SshPublicKey\022F\n\016ssh_p" + + "ublic_key\030\002 \001(\0132).google.cloud.oslogin.c" + + "ommon.SshPublicKeyB\003\340A\002\022/\n\013update_mask\030\003" + + " \001(\0132\032.google.protobuf.FieldMask\"\206\002\n\013Sec" + + "urityKey\022\022\n\npublic_key\030\001 \001(\t\022\023\n\013private_" + + "key\030\002 \001(\t\022O\n\024universal_two_factor\030\003 \001(\0132" + + "/.google.cloud.oslogin.v1beta.UniversalT" + + "woFactorH\000\022:\n\tweb_authn\030\004 \001(\0132%.google.c" + + "loud.oslogin.v1beta.WebAuthnH\000\022\034\n\017device" + + "_nickname\030\005 \001(\tH\001\210\001\001B\017\n\rprotocol_typeB\022\n" + + "\020_device_nickname\"$\n\022UniversalTwoFactor\022" + + "\016\n\006app_id\030\001 \001(\t\"\031\n\010WebAuthn\022\r\n\005rp_id\030\001 \001" + + "(\t\"A\n\027SignSshPublicKeyRequest\022\026\n\016ssh_pub" + + "lic_key\030\001 \001(\t\022\016\n\006parent\030\002 \001(\t\"9\n\030SignSsh" + + "PublicKeyResponse\022\035\n\025signed_ssh_public_k" + + "ey\030\001 \001(\t*S\n\020LoginProfileView\022\"\n\036LOGIN_PR" + + "OFILE_VIEW_UNSPECIFIED\020\000\022\t\n\005BASIC\020\001\022\020\n\014S" + + "ECURITY_KEY\020\0022\362\016\n\016OsLoginService\022\317\001\n\022Cre" + + "ateSshPublicKey\0226.google.cloud.oslogin.v" + + "1beta.CreateSshPublicKeyRequest\032).google" + + ".cloud.oslogin.common.SshPublicKey\"V\332A\025p" + + "arent,ssh_public_key\202\323\344\223\0028\"&/v1beta/{par" + + "ent=users/*}/sshPublicKeys:\016ssh_public_k" + + "ey\022\226\001\n\022DeletePosixAccount\0226.google.cloud" + + ".oslogin.v1beta.DeletePosixAccountReques" + + "t\032\026.google.protobuf.Empty\"0\332A\004name\202\323\344\223\002#" + + "*!/v1beta/{name=users/*/projects/*}\022\233\001\n\022" + + "DeleteSshPublicKey\0226.google.cloud.oslogi" + + "n.v1beta.DeleteSshPublicKeyRequest\032\026.goo" + + "gle.protobuf.Empty\"5\332A\004name\202\323\344\223\002(*&/v1be" + + "ta/{name=users/*/sshPublicKeys/*}\022\245\001\n\017Ge" + + "tLoginProfile\0223.google.cloud.oslogin.v1b" + + "eta.GetLoginProfileRequest\032).google.clou" + + "d.oslogin.v1beta.LoginProfile\"2\332A\004name\202\323" + + "\344\223\002%\022#/v1beta/{name=users/*}/loginProfil" + + "e\022\250\001\n\017GetSshPublicKey\0223.google.cloud.osl" + + "ogin.v1beta.GetSshPublicKeyRequest\032).goo" + + "gle.cloud.oslogin.common.SshPublicKey\"5\332" + + "A\004name\202\323\344\223\002(\022&/v1beta/{name=users/*/sshP" + + "ublicKeys/*}\022\205\002\n\022ImportSshPublicKey\0226.go" + + "ogle.cloud.oslogin.v1beta.ImportSshPubli" + + "cKeyRequest\0327.google.cloud.oslogin.v1bet" + + "a.ImportSshPublicKeyResponse\"~\332A\025parent," + + "ssh_public_key\332A parent,ssh_public_key,p" + + "roject_id\202\323\344\223\002=\"+/v1beta/{parent=users/*" + + "}:importSshPublicKey:\016ssh_public_key\022\357\001\n" + + "\022UpdateSshPublicKey\0226.google.cloud.oslog" + + "in.v1beta.UpdateSshPublicKeyRequest\032).go" + + "ogle.cloud.oslogin.common.SshPublicKey\"v" + + "\332A\023name,ssh_public_key\332A\037name,ssh_public" + + "_key,update_mask\202\323\344\223\00282&/v1beta/{name=us" + + "ers/*/sshPublicKeys/*}:\016ssh_public_key\022\251" + + "\002\n\020SignSshPublicKey\0224.google.cloud.oslog" + + "in.v1beta.SignSshPublicKeyRequest\0325.goog" + + "le.cloud.oslogin.v1beta.SignSshPublicKey" + + "Response\"\247\001\332A\025parent,ssh_public_key\202\323\344\223\002" + + "\210\001\" + * The credential information for a Google registered security key. + * + * + * Protobuf type {@code google.cloud.oslogin.v1beta.SecurityKey} + */ +@com.google.protobuf.Generated +public final class SecurityKey extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.SecurityKey) + SecurityKeyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SecurityKey"); + } + + // Use SecurityKey.newBuilder() to construct. + private SecurityKey(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SecurityKey() { + publicKey_ = ""; + privateKey_ = ""; + deviceNickname_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SecurityKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SecurityKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.SecurityKey.class, + com.google.cloud.oslogin.v1beta.SecurityKey.Builder.class); + } + + private int bitField0_; + private int protocolTypeCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object protocolType_; + + public enum ProtocolTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + UNIVERSAL_TWO_FACTOR(3), + WEB_AUTHN(4), + PROTOCOLTYPE_NOT_SET(0); + private final int value; + + private ProtocolTypeCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ProtocolTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ProtocolTypeCase forNumber(int value) { + switch (value) { + case 3: + return UNIVERSAL_TWO_FACTOR; + case 4: + return WEB_AUTHN; + case 0: + return PROTOCOLTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ProtocolTypeCase getProtocolTypeCase() { + return ProtocolTypeCase.forNumber(protocolTypeCase_); + } + + public static final int PUBLIC_KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object publicKey_ = ""; + + /** + * + * + *
+   * Public key text in SSH format, defined by
+   * [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6.
+   * 
+ * + * string public_key = 1; + * + * @return The publicKey. + */ + @java.lang.Override + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + 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(); + publicKey_ = s; + return s; + } + } + + /** + * + * + *
+   * Public key text in SSH format, defined by
+   * [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6.
+   * 
+ * + * string public_key = 1; + * + * @return The bytes for publicKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_KEY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateKey_ = ""; + + /** + * + * + *
+   * Hardware-backed private key text in SSH format.
+   * 
+ * + * string private_key = 2; + * + * @return The privateKey. + */ + @java.lang.Override + public java.lang.String getPrivateKey() { + java.lang.Object ref = privateKey_; + 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(); + privateKey_ = s; + return s; + } + } + + /** + * + * + *
+   * Hardware-backed private key text in SSH format.
+   * 
+ * + * string private_key = 2; + * + * @return The bytes for privateKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateKeyBytes() { + java.lang.Object ref = privateKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNIVERSAL_TWO_FACTOR_FIELD_NUMBER = 3; + + /** + * + * + *
+   * The U2F protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + * + * @return Whether the universalTwoFactor field is set. + */ + @java.lang.Override + public boolean hasUniversalTwoFactor() { + return protocolTypeCase_ == 3; + } + + /** + * + * + *
+   * The U2F protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + * + * @return The universalTwoFactor. + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.UniversalTwoFactor getUniversalTwoFactor() { + if (protocolTypeCase_ == 3) { + return (com.google.cloud.oslogin.v1beta.UniversalTwoFactor) protocolType_; + } + return com.google.cloud.oslogin.v1beta.UniversalTwoFactor.getDefaultInstance(); + } + + /** + * + * + *
+   * The U2F protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.UniversalTwoFactorOrBuilder + getUniversalTwoFactorOrBuilder() { + if (protocolTypeCase_ == 3) { + return (com.google.cloud.oslogin.v1beta.UniversalTwoFactor) protocolType_; + } + return com.google.cloud.oslogin.v1beta.UniversalTwoFactor.getDefaultInstance(); + } + + public static final int WEB_AUTHN_FIELD_NUMBER = 4; + + /** + * + * + *
+   * The Web Authentication protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + * + * @return Whether the webAuthn field is set. + */ + @java.lang.Override + public boolean hasWebAuthn() { + return protocolTypeCase_ == 4; + } + + /** + * + * + *
+   * The Web Authentication protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + * + * @return The webAuthn. + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.WebAuthn getWebAuthn() { + if (protocolTypeCase_ == 4) { + return (com.google.cloud.oslogin.v1beta.WebAuthn) protocolType_; + } + return com.google.cloud.oslogin.v1beta.WebAuthn.getDefaultInstance(); + } + + /** + * + * + *
+   * The Web Authentication protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.WebAuthnOrBuilder getWebAuthnOrBuilder() { + if (protocolTypeCase_ == 4) { + return (com.google.cloud.oslogin.v1beta.WebAuthn) protocolType_; + } + return com.google.cloud.oslogin.v1beta.WebAuthn.getDefaultInstance(); + } + + public static final int DEVICE_NICKNAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object deviceNickname_ = ""; + + /** + * + * + *
+   * The security key nickname explicitly set by the user.
+   * 
+ * + * optional string device_nickname = 5; + * + * @return Whether the deviceNickname field is set. + */ + @java.lang.Override + public boolean hasDeviceNickname() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The security key nickname explicitly set by the user.
+   * 
+ * + * optional string device_nickname = 5; + * + * @return The deviceNickname. + */ + @java.lang.Override + public java.lang.String getDeviceNickname() { + java.lang.Object ref = deviceNickname_; + 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(); + deviceNickname_ = s; + return s; + } + } + + /** + * + * + *
+   * The security key nickname explicitly set by the user.
+   * 
+ * + * optional string device_nickname = 5; + * + * @return The bytes for deviceNickname. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeviceNicknameBytes() { + java.lang.Object ref = deviceNickname_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deviceNickname_ = 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.GeneratedMessage.isStringEmpty(publicKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, publicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, privateKey_); + } + if (protocolTypeCase_ == 3) { + output.writeMessage(3, (com.google.cloud.oslogin.v1beta.UniversalTwoFactor) protocolType_); + } + if (protocolTypeCase_ == 4) { + output.writeMessage(4, (com.google.cloud.oslogin.v1beta.WebAuthn) protocolType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, deviceNickname_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(publicKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, publicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, privateKey_); + } + if (protocolTypeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.oslogin.v1beta.UniversalTwoFactor) protocolType_); + } + if (protocolTypeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.oslogin.v1beta.WebAuthn) protocolType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, deviceNickname_); + } + 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.oslogin.v1beta.SecurityKey)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.SecurityKey other = + (com.google.cloud.oslogin.v1beta.SecurityKey) obj; + + if (!getPublicKey().equals(other.getPublicKey())) return false; + if (!getPrivateKey().equals(other.getPrivateKey())) return false; + if (hasDeviceNickname() != other.hasDeviceNickname()) return false; + if (hasDeviceNickname()) { + if (!getDeviceNickname().equals(other.getDeviceNickname())) return false; + } + if (!getProtocolTypeCase().equals(other.getProtocolTypeCase())) return false; + switch (protocolTypeCase_) { + case 3: + if (!getUniversalTwoFactor().equals(other.getUniversalTwoFactor())) return false; + break; + case 4: + if (!getWebAuthn().equals(other.getWebAuthn())) return false; + break; + case 0: + default: + } + 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) + PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getPublicKey().hashCode(); + hash = (37 * hash) + PRIVATE_KEY_FIELD_NUMBER; + hash = (53 * hash) + getPrivateKey().hashCode(); + if (hasDeviceNickname()) { + hash = (37 * hash) + DEVICE_NICKNAME_FIELD_NUMBER; + hash = (53 * hash) + getDeviceNickname().hashCode(); + } + switch (protocolTypeCase_) { + case 3: + hash = (37 * hash) + UNIVERSAL_TWO_FACTOR_FIELD_NUMBER; + hash = (53 * hash) + getUniversalTwoFactor().hashCode(); + break; + case 4: + hash = (37 * hash) + WEB_AUTHN_FIELD_NUMBER; + hash = (53 * hash) + getWebAuthn().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.SecurityKey parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.SecurityKey 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.oslogin.v1beta.SecurityKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.SecurityKey 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.oslogin.v1beta.SecurityKey parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.SecurityKey parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.SecurityKey parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.SecurityKey parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.SecurityKey parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.SecurityKey parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.SecurityKey parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.SecurityKey parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.SecurityKey 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The credential information for a Google registered security key.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.SecurityKey} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.SecurityKey) + com.google.cloud.oslogin.v1beta.SecurityKeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SecurityKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SecurityKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.SecurityKey.class, + com.google.cloud.oslogin.v1beta.SecurityKey.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.SecurityKey.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + publicKey_ = ""; + privateKey_ = ""; + if (universalTwoFactorBuilder_ != null) { + universalTwoFactorBuilder_.clear(); + } + if (webAuthnBuilder_ != null) { + webAuthnBuilder_.clear(); + } + deviceNickname_ = ""; + protocolTypeCase_ = 0; + protocolType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SecurityKey_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.SecurityKey getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.SecurityKey.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.SecurityKey build() { + com.google.cloud.oslogin.v1beta.SecurityKey result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.SecurityKey buildPartial() { + com.google.cloud.oslogin.v1beta.SecurityKey result = + new com.google.cloud.oslogin.v1beta.SecurityKey(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.SecurityKey result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.publicKey_ = publicKey_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.privateKey_ = privateKey_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.deviceNickname_ = deviceNickname_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.oslogin.v1beta.SecurityKey result) { + result.protocolTypeCase_ = protocolTypeCase_; + result.protocolType_ = this.protocolType_; + if (protocolTypeCase_ == 3 && universalTwoFactorBuilder_ != null) { + result.protocolType_ = universalTwoFactorBuilder_.build(); + } + if (protocolTypeCase_ == 4 && webAuthnBuilder_ != null) { + result.protocolType_ = webAuthnBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.SecurityKey) { + return mergeFrom((com.google.cloud.oslogin.v1beta.SecurityKey) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.SecurityKey other) { + if (other == com.google.cloud.oslogin.v1beta.SecurityKey.getDefaultInstance()) return this; + if (!other.getPublicKey().isEmpty()) { + publicKey_ = other.publicKey_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPrivateKey().isEmpty()) { + privateKey_ = other.privateKey_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDeviceNickname()) { + deviceNickname_ = other.deviceNickname_; + bitField0_ |= 0x00000010; + onChanged(); + } + switch (other.getProtocolTypeCase()) { + case UNIVERSAL_TWO_FACTOR: + { + mergeUniversalTwoFactor(other.getUniversalTwoFactor()); + break; + } + case WEB_AUTHN: + { + mergeWebAuthn(other.getWebAuthn()); + break; + } + case PROTOCOLTYPE_NOT_SET: + { + break; + } + } + 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: + { + publicKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + privateKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetUniversalTwoFactorFieldBuilder().getBuilder(), extensionRegistry); + protocolTypeCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetWebAuthnFieldBuilder().getBuilder(), extensionRegistry); + protocolTypeCase_ = 4; + break; + } // case 34 + case 42: + { + deviceNickname_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + 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 protocolTypeCase_ = 0; + private java.lang.Object protocolType_; + + public ProtocolTypeCase getProtocolTypeCase() { + return ProtocolTypeCase.forNumber(protocolTypeCase_); + } + + public Builder clearProtocolType() { + protocolTypeCase_ = 0; + protocolType_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object publicKey_ = ""; + + /** + * + * + *
+     * Public key text in SSH format, defined by
+     * [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6.
+     * 
+ * + * string public_key = 1; + * + * @return The publicKey. + */ + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Public key text in SSH format, defined by
+     * [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6.
+     * 
+ * + * string public_key = 1; + * + * @return The bytes for publicKey. + */ + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Public key text in SSH format, defined by
+     * [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6.
+     * 
+ * + * string public_key = 1; + * + * @param value The publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + publicKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Public key text in SSH format, defined by
+     * [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6.
+     * 
+ * + * string public_key = 1; + * + * @return This builder for chaining. + */ + public Builder clearPublicKey() { + publicKey_ = getDefaultInstance().getPublicKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Public key text in SSH format, defined by
+     * [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6.
+     * 
+ * + * string public_key = 1; + * + * @param value The bytes for publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + publicKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object privateKey_ = ""; + + /** + * + * + *
+     * Hardware-backed private key text in SSH format.
+     * 
+ * + * string private_key = 2; + * + * @return The privateKey. + */ + public java.lang.String getPrivateKey() { + java.lang.Object ref = privateKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Hardware-backed private key text in SSH format.
+     * 
+ * + * string private_key = 2; + * + * @return The bytes for privateKey. + */ + public com.google.protobuf.ByteString getPrivateKeyBytes() { + java.lang.Object ref = privateKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Hardware-backed private key text in SSH format.
+     * 
+ * + * string private_key = 2; + * + * @param value The privateKey to set. + * @return This builder for chaining. + */ + public Builder setPrivateKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Hardware-backed private key text in SSH format.
+     * 
+ * + * string private_key = 2; + * + * @return This builder for chaining. + */ + public Builder clearPrivateKey() { + privateKey_ = getDefaultInstance().getPrivateKey(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Hardware-backed private key text in SSH format.
+     * 
+ * + * string private_key = 2; + * + * @param value The bytes for privateKey to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.v1beta.UniversalTwoFactor, + com.google.cloud.oslogin.v1beta.UniversalTwoFactor.Builder, + com.google.cloud.oslogin.v1beta.UniversalTwoFactorOrBuilder> + universalTwoFactorBuilder_; + + /** + * + * + *
+     * The U2F protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + * + * @return Whether the universalTwoFactor field is set. + */ + @java.lang.Override + public boolean hasUniversalTwoFactor() { + return protocolTypeCase_ == 3; + } + + /** + * + * + *
+     * The U2F protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + * + * @return The universalTwoFactor. + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.UniversalTwoFactor getUniversalTwoFactor() { + if (universalTwoFactorBuilder_ == null) { + if (protocolTypeCase_ == 3) { + return (com.google.cloud.oslogin.v1beta.UniversalTwoFactor) protocolType_; + } + return com.google.cloud.oslogin.v1beta.UniversalTwoFactor.getDefaultInstance(); + } else { + if (protocolTypeCase_ == 3) { + return universalTwoFactorBuilder_.getMessage(); + } + return com.google.cloud.oslogin.v1beta.UniversalTwoFactor.getDefaultInstance(); + } + } + + /** + * + * + *
+     * The U2F protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + */ + public Builder setUniversalTwoFactor(com.google.cloud.oslogin.v1beta.UniversalTwoFactor value) { + if (universalTwoFactorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + protocolType_ = value; + onChanged(); + } else { + universalTwoFactorBuilder_.setMessage(value); + } + protocolTypeCase_ = 3; + return this; + } + + /** + * + * + *
+     * The U2F protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + */ + public Builder setUniversalTwoFactor( + com.google.cloud.oslogin.v1beta.UniversalTwoFactor.Builder builderForValue) { + if (universalTwoFactorBuilder_ == null) { + protocolType_ = builderForValue.build(); + onChanged(); + } else { + universalTwoFactorBuilder_.setMessage(builderForValue.build()); + } + protocolTypeCase_ = 3; + return this; + } + + /** + * + * + *
+     * The U2F protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + */ + public Builder mergeUniversalTwoFactor( + com.google.cloud.oslogin.v1beta.UniversalTwoFactor value) { + if (universalTwoFactorBuilder_ == null) { + if (protocolTypeCase_ == 3 + && protocolType_ + != com.google.cloud.oslogin.v1beta.UniversalTwoFactor.getDefaultInstance()) { + protocolType_ = + com.google.cloud.oslogin.v1beta.UniversalTwoFactor.newBuilder( + (com.google.cloud.oslogin.v1beta.UniversalTwoFactor) protocolType_) + .mergeFrom(value) + .buildPartial(); + } else { + protocolType_ = value; + } + onChanged(); + } else { + if (protocolTypeCase_ == 3) { + universalTwoFactorBuilder_.mergeFrom(value); + } else { + universalTwoFactorBuilder_.setMessage(value); + } + } + protocolTypeCase_ = 3; + return this; + } + + /** + * + * + *
+     * The U2F protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + */ + public Builder clearUniversalTwoFactor() { + if (universalTwoFactorBuilder_ == null) { + if (protocolTypeCase_ == 3) { + protocolTypeCase_ = 0; + protocolType_ = null; + onChanged(); + } + } else { + if (protocolTypeCase_ == 3) { + protocolTypeCase_ = 0; + protocolType_ = null; + } + universalTwoFactorBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The U2F protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + */ + public com.google.cloud.oslogin.v1beta.UniversalTwoFactor.Builder + getUniversalTwoFactorBuilder() { + return internalGetUniversalTwoFactorFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The U2F protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.UniversalTwoFactorOrBuilder + getUniversalTwoFactorOrBuilder() { + if ((protocolTypeCase_ == 3) && (universalTwoFactorBuilder_ != null)) { + return universalTwoFactorBuilder_.getMessageOrBuilder(); + } else { + if (protocolTypeCase_ == 3) { + return (com.google.cloud.oslogin.v1beta.UniversalTwoFactor) protocolType_; + } + return com.google.cloud.oslogin.v1beta.UniversalTwoFactor.getDefaultInstance(); + } + } + + /** + * + * + *
+     * The U2F protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.v1beta.UniversalTwoFactor, + com.google.cloud.oslogin.v1beta.UniversalTwoFactor.Builder, + com.google.cloud.oslogin.v1beta.UniversalTwoFactorOrBuilder> + internalGetUniversalTwoFactorFieldBuilder() { + if (universalTwoFactorBuilder_ == null) { + if (!(protocolTypeCase_ == 3)) { + protocolType_ = com.google.cloud.oslogin.v1beta.UniversalTwoFactor.getDefaultInstance(); + } + universalTwoFactorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.v1beta.UniversalTwoFactor, + com.google.cloud.oslogin.v1beta.UniversalTwoFactor.Builder, + com.google.cloud.oslogin.v1beta.UniversalTwoFactorOrBuilder>( + (com.google.cloud.oslogin.v1beta.UniversalTwoFactor) protocolType_, + getParentForChildren(), + isClean()); + protocolType_ = null; + } + protocolTypeCase_ = 3; + onChanged(); + return universalTwoFactorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.v1beta.WebAuthn, + com.google.cloud.oslogin.v1beta.WebAuthn.Builder, + com.google.cloud.oslogin.v1beta.WebAuthnOrBuilder> + webAuthnBuilder_; + + /** + * + * + *
+     * The Web Authentication protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + * + * @return Whether the webAuthn field is set. + */ + @java.lang.Override + public boolean hasWebAuthn() { + return protocolTypeCase_ == 4; + } + + /** + * + * + *
+     * The Web Authentication protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + * + * @return The webAuthn. + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.WebAuthn getWebAuthn() { + if (webAuthnBuilder_ == null) { + if (protocolTypeCase_ == 4) { + return (com.google.cloud.oslogin.v1beta.WebAuthn) protocolType_; + } + return com.google.cloud.oslogin.v1beta.WebAuthn.getDefaultInstance(); + } else { + if (protocolTypeCase_ == 4) { + return webAuthnBuilder_.getMessage(); + } + return com.google.cloud.oslogin.v1beta.WebAuthn.getDefaultInstance(); + } + } + + /** + * + * + *
+     * The Web Authentication protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + */ + public Builder setWebAuthn(com.google.cloud.oslogin.v1beta.WebAuthn value) { + if (webAuthnBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + protocolType_ = value; + onChanged(); + } else { + webAuthnBuilder_.setMessage(value); + } + protocolTypeCase_ = 4; + return this; + } + + /** + * + * + *
+     * The Web Authentication protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + */ + public Builder setWebAuthn(com.google.cloud.oslogin.v1beta.WebAuthn.Builder builderForValue) { + if (webAuthnBuilder_ == null) { + protocolType_ = builderForValue.build(); + onChanged(); + } else { + webAuthnBuilder_.setMessage(builderForValue.build()); + } + protocolTypeCase_ = 4; + return this; + } + + /** + * + * + *
+     * The Web Authentication protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + */ + public Builder mergeWebAuthn(com.google.cloud.oslogin.v1beta.WebAuthn value) { + if (webAuthnBuilder_ == null) { + if (protocolTypeCase_ == 4 + && protocolType_ != com.google.cloud.oslogin.v1beta.WebAuthn.getDefaultInstance()) { + protocolType_ = + com.google.cloud.oslogin.v1beta.WebAuthn.newBuilder( + (com.google.cloud.oslogin.v1beta.WebAuthn) protocolType_) + .mergeFrom(value) + .buildPartial(); + } else { + protocolType_ = value; + } + onChanged(); + } else { + if (protocolTypeCase_ == 4) { + webAuthnBuilder_.mergeFrom(value); + } else { + webAuthnBuilder_.setMessage(value); + } + } + protocolTypeCase_ = 4; + return this; + } + + /** + * + * + *
+     * The Web Authentication protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + */ + public Builder clearWebAuthn() { + if (webAuthnBuilder_ == null) { + if (protocolTypeCase_ == 4) { + protocolTypeCase_ = 0; + protocolType_ = null; + onChanged(); + } + } else { + if (protocolTypeCase_ == 4) { + protocolTypeCase_ = 0; + protocolType_ = null; + } + webAuthnBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The Web Authentication protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + */ + public com.google.cloud.oslogin.v1beta.WebAuthn.Builder getWebAuthnBuilder() { + return internalGetWebAuthnFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The Web Authentication protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + */ + @java.lang.Override + public com.google.cloud.oslogin.v1beta.WebAuthnOrBuilder getWebAuthnOrBuilder() { + if ((protocolTypeCase_ == 4) && (webAuthnBuilder_ != null)) { + return webAuthnBuilder_.getMessageOrBuilder(); + } else { + if (protocolTypeCase_ == 4) { + return (com.google.cloud.oslogin.v1beta.WebAuthn) protocolType_; + } + return com.google.cloud.oslogin.v1beta.WebAuthn.getDefaultInstance(); + } + } + + /** + * + * + *
+     * The Web Authentication protocol type.
+     * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.v1beta.WebAuthn, + com.google.cloud.oslogin.v1beta.WebAuthn.Builder, + com.google.cloud.oslogin.v1beta.WebAuthnOrBuilder> + internalGetWebAuthnFieldBuilder() { + if (webAuthnBuilder_ == null) { + if (!(protocolTypeCase_ == 4)) { + protocolType_ = com.google.cloud.oslogin.v1beta.WebAuthn.getDefaultInstance(); + } + webAuthnBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.v1beta.WebAuthn, + com.google.cloud.oslogin.v1beta.WebAuthn.Builder, + com.google.cloud.oslogin.v1beta.WebAuthnOrBuilder>( + (com.google.cloud.oslogin.v1beta.WebAuthn) protocolType_, + getParentForChildren(), + isClean()); + protocolType_ = null; + } + protocolTypeCase_ = 4; + onChanged(); + return webAuthnBuilder_; + } + + private java.lang.Object deviceNickname_ = ""; + + /** + * + * + *
+     * The security key nickname explicitly set by the user.
+     * 
+ * + * optional string device_nickname = 5; + * + * @return Whether the deviceNickname field is set. + */ + public boolean hasDeviceNickname() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The security key nickname explicitly set by the user.
+     * 
+ * + * optional string device_nickname = 5; + * + * @return The deviceNickname. + */ + public java.lang.String getDeviceNickname() { + java.lang.Object ref = deviceNickname_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceNickname_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The security key nickname explicitly set by the user.
+     * 
+ * + * optional string device_nickname = 5; + * + * @return The bytes for deviceNickname. + */ + public com.google.protobuf.ByteString getDeviceNicknameBytes() { + java.lang.Object ref = deviceNickname_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deviceNickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The security key nickname explicitly set by the user.
+     * 
+ * + * optional string device_nickname = 5; + * + * @param value The deviceNickname to set. + * @return This builder for chaining. + */ + public Builder setDeviceNickname(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + deviceNickname_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The security key nickname explicitly set by the user.
+     * 
+ * + * optional string device_nickname = 5; + * + * @return This builder for chaining. + */ + public Builder clearDeviceNickname() { + deviceNickname_ = getDefaultInstance().getDeviceNickname(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * The security key nickname explicitly set by the user.
+     * 
+ * + * optional string device_nickname = 5; + * + * @param value The bytes for deviceNickname to set. + * @return This builder for chaining. + */ + public Builder setDeviceNicknameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + deviceNickname_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.SecurityKey) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.SecurityKey) + private static final com.google.cloud.oslogin.v1beta.SecurityKey DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.SecurityKey(); + } + + public static com.google.cloud.oslogin.v1beta.SecurityKey getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityKey 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.oslogin.v1beta.SecurityKey getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SecurityKeyOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SecurityKeyOrBuilder.java new file mode 100644 index 000000000000..6bcac4b560e4 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SecurityKeyOrBuilder.java @@ -0,0 +1,197 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface SecurityKeyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.SecurityKey) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Public key text in SSH format, defined by
+   * [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6.
+   * 
+ * + * string public_key = 1; + * + * @return The publicKey. + */ + java.lang.String getPublicKey(); + + /** + * + * + *
+   * Public key text in SSH format, defined by
+   * [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6.
+   * 
+ * + * string public_key = 1; + * + * @return The bytes for publicKey. + */ + com.google.protobuf.ByteString getPublicKeyBytes(); + + /** + * + * + *
+   * Hardware-backed private key text in SSH format.
+   * 
+ * + * string private_key = 2; + * + * @return The privateKey. + */ + java.lang.String getPrivateKey(); + + /** + * + * + *
+   * Hardware-backed private key text in SSH format.
+   * 
+ * + * string private_key = 2; + * + * @return The bytes for privateKey. + */ + com.google.protobuf.ByteString getPrivateKeyBytes(); + + /** + * + * + *
+   * The U2F protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + * + * @return Whether the universalTwoFactor field is set. + */ + boolean hasUniversalTwoFactor(); + + /** + * + * + *
+   * The U2F protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + * + * @return The universalTwoFactor. + */ + com.google.cloud.oslogin.v1beta.UniversalTwoFactor getUniversalTwoFactor(); + + /** + * + * + *
+   * The U2F protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.UniversalTwoFactor universal_two_factor = 3; + */ + com.google.cloud.oslogin.v1beta.UniversalTwoFactorOrBuilder getUniversalTwoFactorOrBuilder(); + + /** + * + * + *
+   * The Web Authentication protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + * + * @return Whether the webAuthn field is set. + */ + boolean hasWebAuthn(); + + /** + * + * + *
+   * The Web Authentication protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + * + * @return The webAuthn. + */ + com.google.cloud.oslogin.v1beta.WebAuthn getWebAuthn(); + + /** + * + * + *
+   * The Web Authentication protocol type.
+   * 
+ * + * .google.cloud.oslogin.v1beta.WebAuthn web_authn = 4; + */ + com.google.cloud.oslogin.v1beta.WebAuthnOrBuilder getWebAuthnOrBuilder(); + + /** + * + * + *
+   * The security key nickname explicitly set by the user.
+   * 
+ * + * optional string device_nickname = 5; + * + * @return Whether the deviceNickname field is set. + */ + boolean hasDeviceNickname(); + + /** + * + * + *
+   * The security key nickname explicitly set by the user.
+   * 
+ * + * optional string device_nickname = 5; + * + * @return The deviceNickname. + */ + java.lang.String getDeviceNickname(); + + /** + * + * + *
+   * The security key nickname explicitly set by the user.
+   * 
+ * + * optional string device_nickname = 5; + * + * @return The bytes for deviceNickname. + */ + com.google.protobuf.ByteString getDeviceNicknameBytes(); + + com.google.cloud.oslogin.v1beta.SecurityKey.ProtocolTypeCase getProtocolTypeCase(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyRequest.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyRequest.java new file mode 100644 index 000000000000..22f02b0e8e0a --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyRequest.java @@ -0,0 +1,770 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** Protobuf type {@code google.cloud.oslogin.v1beta.SignSshPublicKeyRequest} */ +@com.google.protobuf.Generated +public final class SignSshPublicKeyRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.SignSshPublicKeyRequest) + SignSshPublicKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SignSshPublicKeyRequest"); + } + + // Use SignSshPublicKeyRequest.newBuilder() to construct. + private SignSshPublicKeyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SignSshPublicKeyRequest() { + sshPublicKey_ = ""; + parent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest.Builder.class); + } + + public static final int SSH_PUBLIC_KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object sshPublicKey_ = ""; + + /** + * + * + *
+   * The SSH public key to sign.
+   * 
+ * + * string ssh_public_key = 1; + * + * @return The sshPublicKey. + */ + @java.lang.Override + public java.lang.String getSshPublicKey() { + java.lang.Object ref = sshPublicKey_; + 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(); + sshPublicKey_ = s; + return s; + } + } + + /** + * + * + *
+   * The SSH public key to sign.
+   * 
+ * + * string ssh_public_key = 1; + * + * @return The bytes for sshPublicKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSshPublicKeyBytes() { + java.lang.Object ref = sshPublicKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sshPublicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * The parent project and region for the signing request.
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * The parent project and region for the signing request.
+   * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = 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.GeneratedMessage.isStringEmpty(sshPublicKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, sshPublicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, parent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sshPublicKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, sshPublicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, parent_); + } + 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.oslogin.v1beta.SignSshPublicKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest other = + (com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest) obj; + + if (!getSshPublicKey().equals(other.getSshPublicKey())) return false; + if (!getParent().equals(other.getParent())) 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) + SSH_PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getSshPublicKey().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest 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.oslogin.v1beta.SignSshPublicKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest 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.oslogin.v1beta.SignSshPublicKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.SignSshPublicKeyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.oslogin.v1beta.SignSshPublicKeyRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.SignSshPublicKeyRequest) + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sshPublicKey_ = ""; + parent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest build() { + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest buildPartial() { + com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest result = + new com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sshPublicKey_ = sshPublicKey_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.parent_ = parent_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest) { + return mergeFrom((com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest other) { + if (other == com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest.getDefaultInstance()) + return this; + if (!other.getSshPublicKey().isEmpty()) { + sshPublicKey_ = other.sshPublicKey_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000002; + 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: + { + sshPublicKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 int bitField0_; + + private java.lang.Object sshPublicKey_ = ""; + + /** + * + * + *
+     * The SSH public key to sign.
+     * 
+ * + * string ssh_public_key = 1; + * + * @return The sshPublicKey. + */ + public java.lang.String getSshPublicKey() { + java.lang.Object ref = sshPublicKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sshPublicKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The SSH public key to sign.
+     * 
+ * + * string ssh_public_key = 1; + * + * @return The bytes for sshPublicKey. + */ + public com.google.protobuf.ByteString getSshPublicKeyBytes() { + java.lang.Object ref = sshPublicKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sshPublicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The SSH public key to sign.
+     * 
+ * + * string ssh_public_key = 1; + * + * @param value The sshPublicKey to set. + * @return This builder for chaining. + */ + public Builder setSshPublicKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sshPublicKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The SSH public key to sign.
+     * 
+ * + * string ssh_public_key = 1; + * + * @return This builder for chaining. + */ + public Builder clearSshPublicKey() { + sshPublicKey_ = getDefaultInstance().getSshPublicKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The SSH public key to sign.
+     * 
+ * + * string ssh_public_key = 1; + * + * @param value The bytes for sshPublicKey to set. + * @return This builder for chaining. + */ + public Builder setSshPublicKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sshPublicKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * The parent project and region for the signing request.
+     * 
+ * + * string parent = 2; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The parent project and region for the signing request.
+     * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The parent project and region for the signing request.
+     * 
+ * + * string parent = 2; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The parent project and region for the signing request.
+     * 
+ * + * string parent = 2; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The parent project and region for the signing request.
+     * 
+ * + * string parent = 2; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.SignSshPublicKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.SignSshPublicKeyRequest) + private static final com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest(); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SignSshPublicKeyRequest 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.oslogin.v1beta.SignSshPublicKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyRequestOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyRequestOrBuilder.java new file mode 100644 index 000000000000..a28ee84613f1 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface SignSshPublicKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.SignSshPublicKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The SSH public key to sign.
+   * 
+ * + * string ssh_public_key = 1; + * + * @return The sshPublicKey. + */ + java.lang.String getSshPublicKey(); + + /** + * + * + *
+   * The SSH public key to sign.
+   * 
+ * + * string ssh_public_key = 1; + * + * @return The bytes for sshPublicKey. + */ + com.google.protobuf.ByteString getSshPublicKeyBytes(); + + /** + * + * + *
+   * The parent project and region for the signing request.
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * The parent project and region for the signing request.
+   * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyResponse.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyResponse.java new file mode 100644 index 000000000000..80a002649839 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyResponse.java @@ -0,0 +1,581 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** Protobuf type {@code google.cloud.oslogin.v1beta.SignSshPublicKeyResponse} */ +@com.google.protobuf.Generated +public final class SignSshPublicKeyResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.SignSshPublicKeyResponse) + SignSshPublicKeyResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SignSshPublicKeyResponse"); + } + + // Use SignSshPublicKeyResponse.newBuilder() to construct. + private SignSshPublicKeyResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SignSshPublicKeyResponse() { + signedSshPublicKey_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse.class, + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse.Builder.class); + } + + public static final int SIGNED_SSH_PUBLIC_KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object signedSshPublicKey_ = ""; + + /** + * + * + *
+   * The signed SSH public key to use in the SSH handshake.
+   * 
+ * + * string signed_ssh_public_key = 1; + * + * @return The signedSshPublicKey. + */ + @java.lang.Override + public java.lang.String getSignedSshPublicKey() { + java.lang.Object ref = signedSshPublicKey_; + 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(); + signedSshPublicKey_ = s; + return s; + } + } + + /** + * + * + *
+   * The signed SSH public key to use in the SSH handshake.
+   * 
+ * + * string signed_ssh_public_key = 1; + * + * @return The bytes for signedSshPublicKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignedSshPublicKeyBytes() { + java.lang.Object ref = signedSshPublicKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + signedSshPublicKey_ = 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.GeneratedMessage.isStringEmpty(signedSshPublicKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, signedSshPublicKey_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(signedSshPublicKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, signedSshPublicKey_); + } + 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.oslogin.v1beta.SignSshPublicKeyResponse)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse other = + (com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse) obj; + + if (!getSignedSshPublicKey().equals(other.getSignedSshPublicKey())) 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) + SIGNED_SSH_PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getSignedSshPublicKey().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse 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.oslogin.v1beta.SignSshPublicKeyResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse 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.oslogin.v1beta.SignSshPublicKeyResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.SignSshPublicKeyResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.oslogin.v1beta.SignSshPublicKeyResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.SignSshPublicKeyResponse) + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse.class, + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + signedSshPublicKey_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_SignSshPublicKeyResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse build() { + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse buildPartial() { + com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse result = + new com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.signedSshPublicKey_ = signedSshPublicKey_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse) { + return mergeFrom((com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse other) { + if (other == com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse.getDefaultInstance()) + return this; + if (!other.getSignedSshPublicKey().isEmpty()) { + signedSshPublicKey_ = other.signedSshPublicKey_; + bitField0_ |= 0x00000001; + 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: + { + signedSshPublicKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + 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 java.lang.Object signedSshPublicKey_ = ""; + + /** + * + * + *
+     * The signed SSH public key to use in the SSH handshake.
+     * 
+ * + * string signed_ssh_public_key = 1; + * + * @return The signedSshPublicKey. + */ + public java.lang.String getSignedSshPublicKey() { + java.lang.Object ref = signedSshPublicKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + signedSshPublicKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The signed SSH public key to use in the SSH handshake.
+     * 
+ * + * string signed_ssh_public_key = 1; + * + * @return The bytes for signedSshPublicKey. + */ + public com.google.protobuf.ByteString getSignedSshPublicKeyBytes() { + java.lang.Object ref = signedSshPublicKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + signedSshPublicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The signed SSH public key to use in the SSH handshake.
+     * 
+ * + * string signed_ssh_public_key = 1; + * + * @param value The signedSshPublicKey to set. + * @return This builder for chaining. + */ + public Builder setSignedSshPublicKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + signedSshPublicKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The signed SSH public key to use in the SSH handshake.
+     * 
+ * + * string signed_ssh_public_key = 1; + * + * @return This builder for chaining. + */ + public Builder clearSignedSshPublicKey() { + signedSshPublicKey_ = getDefaultInstance().getSignedSshPublicKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The signed SSH public key to use in the SSH handshake.
+     * 
+ * + * string signed_ssh_public_key = 1; + * + * @param value The bytes for signedSshPublicKey to set. + * @return This builder for chaining. + */ + public Builder setSignedSshPublicKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + signedSshPublicKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.SignSshPublicKeyResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.SignSshPublicKeyResponse) + private static final com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse(); + } + + public static com.google.cloud.oslogin.v1beta.SignSshPublicKeyResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SignSshPublicKeyResponse 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.oslogin.v1beta.SignSshPublicKeyResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyResponseOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyResponseOrBuilder.java new file mode 100644 index 000000000000..f579ae3f0e84 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/SignSshPublicKeyResponseOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface SignSshPublicKeyResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.SignSshPublicKeyResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The signed SSH public key to use in the SSH handshake.
+   * 
+ * + * string signed_ssh_public_key = 1; + * + * @return The signedSshPublicKey. + */ + java.lang.String getSignedSshPublicKey(); + + /** + * + * + *
+   * The signed SSH public key to use in the SSH handshake.
+   * 
+ * + * string signed_ssh_public_key = 1; + * + * @return The bytes for signedSshPublicKey. + */ + com.google.protobuf.ByteString getSignedSshPublicKeyBytes(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UniversalTwoFactor.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UniversalTwoFactor.java new file mode 100644 index 000000000000..416b9c2c1811 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UniversalTwoFactor.java @@ -0,0 +1,596 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * Security key information specific to the U2F protocol.
+ * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.UniversalTwoFactor} + */ +@com.google.protobuf.Generated +public final class UniversalTwoFactor extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.UniversalTwoFactor) + UniversalTwoFactorOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UniversalTwoFactor"); + } + + // Use UniversalTwoFactor.newBuilder() to construct. + private UniversalTwoFactor(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UniversalTwoFactor() { + appId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_UniversalTwoFactor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_UniversalTwoFactor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.UniversalTwoFactor.class, + com.google.cloud.oslogin.v1beta.UniversalTwoFactor.Builder.class); + } + + public static final int APP_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object appId_ = ""; + + /** + * + * + *
+   * Application ID for the U2F protocol.
+   * 
+ * + * string app_id = 1; + * + * @return The appId. + */ + @java.lang.Override + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + 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(); + appId_ = s; + return s; + } + } + + /** + * + * + *
+   * Application ID for the U2F protocol.
+   * 
+ * + * string app_id = 1; + * + * @return The bytes for appId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appId_ = 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.GeneratedMessage.isStringEmpty(appId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, appId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, appId_); + } + 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.oslogin.v1beta.UniversalTwoFactor)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.UniversalTwoFactor other = + (com.google.cloud.oslogin.v1beta.UniversalTwoFactor) obj; + + if (!getAppId().equals(other.getAppId())) 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) + APP_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.UniversalTwoFactor parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.UniversalTwoFactor 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.oslogin.v1beta.UniversalTwoFactor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.UniversalTwoFactor 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.oslogin.v1beta.UniversalTwoFactor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.UniversalTwoFactor parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.UniversalTwoFactor parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.UniversalTwoFactor parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.UniversalTwoFactor parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.UniversalTwoFactor parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.UniversalTwoFactor parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.UniversalTwoFactor parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.UniversalTwoFactor 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Security key information specific to the U2F protocol.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.UniversalTwoFactor} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.UniversalTwoFactor) + com.google.cloud.oslogin.v1beta.UniversalTwoFactorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_UniversalTwoFactor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_UniversalTwoFactor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.UniversalTwoFactor.class, + com.google.cloud.oslogin.v1beta.UniversalTwoFactor.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.UniversalTwoFactor.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + appId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_UniversalTwoFactor_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.UniversalTwoFactor getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.UniversalTwoFactor.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.UniversalTwoFactor build() { + com.google.cloud.oslogin.v1beta.UniversalTwoFactor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.UniversalTwoFactor buildPartial() { + com.google.cloud.oslogin.v1beta.UniversalTwoFactor result = + new com.google.cloud.oslogin.v1beta.UniversalTwoFactor(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.UniversalTwoFactor result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.appId_ = appId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.UniversalTwoFactor) { + return mergeFrom((com.google.cloud.oslogin.v1beta.UniversalTwoFactor) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.UniversalTwoFactor other) { + if (other == com.google.cloud.oslogin.v1beta.UniversalTwoFactor.getDefaultInstance()) + return this; + if (!other.getAppId().isEmpty()) { + appId_ = other.appId_; + bitField0_ |= 0x00000001; + 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: + { + appId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + 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 java.lang.Object appId_ = ""; + + /** + * + * + *
+     * Application ID for the U2F protocol.
+     * 
+ * + * string app_id = 1; + * + * @return The appId. + */ + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Application ID for the U2F protocol.
+     * 
+ * + * string app_id = 1; + * + * @return The bytes for appId. + */ + public com.google.protobuf.ByteString getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Application ID for the U2F protocol.
+     * 
+ * + * string app_id = 1; + * + * @param value The appId to set. + * @return This builder for chaining. + */ + public Builder setAppId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + appId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Application ID for the U2F protocol.
+     * 
+ * + * string app_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearAppId() { + appId_ = getDefaultInstance().getAppId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Application ID for the U2F protocol.
+     * 
+ * + * string app_id = 1; + * + * @param value The bytes for appId to set. + * @return This builder for chaining. + */ + public Builder setAppIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + appId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.UniversalTwoFactor) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.UniversalTwoFactor) + private static final com.google.cloud.oslogin.v1beta.UniversalTwoFactor DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.UniversalTwoFactor(); + } + + public static com.google.cloud.oslogin.v1beta.UniversalTwoFactor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UniversalTwoFactor 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.oslogin.v1beta.UniversalTwoFactor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UniversalTwoFactorOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UniversalTwoFactorOrBuilder.java new file mode 100644 index 000000000000..1e7ddcbc7740 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UniversalTwoFactorOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface UniversalTwoFactorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.UniversalTwoFactor) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Application ID for the U2F protocol.
+   * 
+ * + * string app_id = 1; + * + * @return The appId. + */ + java.lang.String getAppId(); + + /** + * + * + *
+   * Application ID for the U2F protocol.
+   * 
+ * + * string app_id = 1; + * + * @return The bytes for appId. + */ + com.google.protobuf.ByteString getAppIdBytes(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UpdateSshPublicKeyRequest.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UpdateSshPublicKeyRequest.java new file mode 100644 index 000000000000..d243ad510290 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UpdateSshPublicKeyRequest.java @@ -0,0 +1,1226 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * A request message for updating an SSH public key.
+ * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest} + */ +@com.google.protobuf.Generated +public final class UpdateSshPublicKeyRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest) + UpdateSshPublicKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateSshPublicKeyRequest"); + } + + // Use UpdateSshPublicKeyRequest.newBuilder() to construct. + private UpdateSshPublicKeyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateSshPublicKeyRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_UpdateSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_UpdateSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The fingerprint of the public key to update. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * 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. The fingerprint of the public key to update. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * 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 SSH_PUBLIC_KEY_FIELD_NUMBER = 2; + private com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey sshPublicKey_; + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sshPublicKey field is set. + */ + @java.lang.Override + public boolean hasSshPublicKey() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sshPublicKey. + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKey() { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder + getSshPublicKeyOrBuilder() { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Mask to control which fields get updated. Updates all if not present.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Mask to control which fields get updated. Updates all if not present.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Mask to control which fields get updated. Updates all if not present.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSshPublicKey()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSshPublicKey()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); + } + 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.oslogin.v1beta.UpdateSshPublicKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest other = + (com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasSshPublicKey() != other.hasSshPublicKey()) return false; + if (hasSshPublicKey()) { + if (!getSshPublicKey().equals(other.getSshPublicKey())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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 (hasSshPublicKey()) { + hash = (37 * hash) + SSH_PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getSshPublicKey().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest 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.oslogin.v1beta.UpdateSshPublicKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest 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.oslogin.v1beta.UpdateSshPublicKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.UpdateSshPublicKeyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A request message for updating an SSH public key.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest) + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_UpdateSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_UpdateSshPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.class, + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSshPublicKeyFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + sshPublicKey_ = null; + if (sshPublicKeyBuilder_ != null) { + sshPublicKeyBuilder_.dispose(); + sshPublicKeyBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_UpdateSshPublicKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest build() { + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest buildPartial() { + com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest result = + new com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sshPublicKey_ = + sshPublicKeyBuilder_ == null ? sshPublicKey_ : sshPublicKeyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest) { + return mergeFrom((com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest other) { + if (other == com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSshPublicKey()) { + mergeSshPublicKey(other.getSshPublicKey()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetSshPublicKeyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + 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 java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The fingerprint of the public key to update. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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. The fingerprint of the public key to update. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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. The fingerprint of the public key to update. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The fingerprint of the public key to update. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The fingerprint of the public key to update. Public keys are
+     * identified by their SHA-256 fingerprint. The fingerprint of the public key
+     * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey sshPublicKey_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder> + sshPublicKeyBuilder_; + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sshPublicKey field is set. + */ + public boolean hasSshPublicKey() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sshPublicKey. + */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKey() { + if (sshPublicKeyBuilder_ == null) { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } else { + return sshPublicKeyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSshPublicKey( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey value) { + if (sshPublicKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sshPublicKey_ = value; + } else { + sshPublicKeyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSshPublicKey( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder builderForValue) { + if (sshPublicKeyBuilder_ == null) { + sshPublicKey_ = builderForValue.build(); + } else { + sshPublicKeyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSshPublicKey( + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey value) { + if (sshPublicKeyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && sshPublicKey_ != null + && sshPublicKey_ + != com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance()) { + getSshPublicKeyBuilder().mergeFrom(value); + } else { + sshPublicKey_ = value; + } + } else { + sshPublicKeyBuilder_.mergeFrom(value); + } + if (sshPublicKey_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSshPublicKey() { + bitField0_ = (bitField0_ & ~0x00000002); + sshPublicKey_ = null; + if (sshPublicKeyBuilder_ != null) { + sshPublicKeyBuilder_.dispose(); + sshPublicKeyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder + getSshPublicKeyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetSshPublicKeyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder + getSshPublicKeyOrBuilder() { + if (sshPublicKeyBuilder_ != null) { + return sshPublicKeyBuilder_.getMessageOrBuilder(); + } else { + return sshPublicKey_ == null + ? com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.getDefaultInstance() + : sshPublicKey_; + } + } + + /** + * + * + *
+     * Required. The SSH public key and expiration time.
+     * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder> + internalGetSshPublicKeyFieldBuilder() { + if (sshPublicKeyBuilder_ == null) { + sshPublicKeyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey.Builder, + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder>( + getSshPublicKey(), getParentForChildren(), isClean()); + sshPublicKey_ = null; + } + return sshPublicKeyBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Mask to control which fields get updated. Updates all if not present.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Mask to control which fields get updated. Updates all if not present.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @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(); + } + } + + /** + * + * + *
+     * Mask to control which fields get updated. Updates all if not present.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Mask to control which fields get updated. Updates all if not present.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Mask to control which fields get updated. Updates all if not present.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Mask to control which fields get updated. Updates all if not present.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000004); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Mask to control which fields get updated. Updates all if not present.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Mask to control which fields get updated. Updates all if not present.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Mask to control which fields get updated. Updates all if not present.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest) + private static final com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest(); + } + + public static com.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSshPublicKeyRequest 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.oslogin.v1beta.UpdateSshPublicKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UpdateSshPublicKeyRequestOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UpdateSshPublicKeyRequestOrBuilder.java new file mode 100644 index 000000000000..22836003243e --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/UpdateSshPublicKeyRequestOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface UpdateSshPublicKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The fingerprint of the public key to update. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The fingerprint of the public key to update. Public keys are
+   * identified by their SHA-256 fingerprint. The fingerprint of the public key
+   * is in format `users/{user}/sshPublicKeys/{fingerprint}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sshPublicKey field is set. + */ + boolean hasSshPublicKey(); + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sshPublicKey. + */ + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey getSshPublicKey(); + + /** + * + * + *
+   * Required. The SSH public key and expiration time.
+   * 
+ * + * + * .google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.oslogin.common.OsLoginProto.SshPublicKeyOrBuilder getSshPublicKeyOrBuilder(); + + /** + * + * + *
+   * Mask to control which fields get updated. Updates all if not present.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Mask to control which fields get updated. Updates all if not present.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Mask to control which fields get updated. Updates all if not present.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/WebAuthn.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/WebAuthn.java new file mode 100644 index 000000000000..d1281b90ff41 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/WebAuthn.java @@ -0,0 +1,594 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +/** + * + * + *
+ * Security key information specific to the Web Authentication protocol.
+ * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.WebAuthn} + */ +@com.google.protobuf.Generated +public final class WebAuthn extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.oslogin.v1beta.WebAuthn) + WebAuthnOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "WebAuthn"); + } + + // Use WebAuthn.newBuilder() to construct. + private WebAuthn(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private WebAuthn() { + rpId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_WebAuthn_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_WebAuthn_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.WebAuthn.class, + com.google.cloud.oslogin.v1beta.WebAuthn.Builder.class); + } + + public static final int RP_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object rpId_ = ""; + + /** + * + * + *
+   * Relying party ID for Web Authentication.
+   * 
+ * + * string rp_id = 1; + * + * @return The rpId. + */ + @java.lang.Override + public java.lang.String getRpId() { + java.lang.Object ref = rpId_; + 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(); + rpId_ = s; + return s; + } + } + + /** + * + * + *
+   * Relying party ID for Web Authentication.
+   * 
+ * + * string rp_id = 1; + * + * @return The bytes for rpId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRpIdBytes() { + java.lang.Object ref = rpId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rpId_ = 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.GeneratedMessage.isStringEmpty(rpId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, rpId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(rpId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, rpId_); + } + 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.oslogin.v1beta.WebAuthn)) { + return super.equals(obj); + } + com.google.cloud.oslogin.v1beta.WebAuthn other = (com.google.cloud.oslogin.v1beta.WebAuthn) obj; + + if (!getRpId().equals(other.getRpId())) 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) + RP_ID_FIELD_NUMBER; + hash = (53 * hash) + getRpId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.oslogin.v1beta.WebAuthn parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.WebAuthn 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.oslogin.v1beta.WebAuthn parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.WebAuthn 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.oslogin.v1beta.WebAuthn parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.oslogin.v1beta.WebAuthn parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.WebAuthn parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.WebAuthn parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.WebAuthn parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.WebAuthn parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.oslogin.v1beta.WebAuthn parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.oslogin.v1beta.WebAuthn parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.oslogin.v1beta.WebAuthn 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Security key information specific to the Web Authentication protocol.
+   * 
+ * + * Protobuf type {@code google.cloud.oslogin.v1beta.WebAuthn} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.oslogin.v1beta.WebAuthn) + com.google.cloud.oslogin.v1beta.WebAuthnOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_WebAuthn_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_WebAuthn_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.oslogin.v1beta.WebAuthn.class, + com.google.cloud.oslogin.v1beta.WebAuthn.Builder.class); + } + + // Construct using com.google.cloud.oslogin.v1beta.WebAuthn.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rpId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.oslogin.v1beta.OsLoginProto + .internal_static_google_cloud_oslogin_v1beta_WebAuthn_descriptor; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.WebAuthn getDefaultInstanceForType() { + return com.google.cloud.oslogin.v1beta.WebAuthn.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.WebAuthn build() { + com.google.cloud.oslogin.v1beta.WebAuthn result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.oslogin.v1beta.WebAuthn buildPartial() { + com.google.cloud.oslogin.v1beta.WebAuthn result = + new com.google.cloud.oslogin.v1beta.WebAuthn(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.oslogin.v1beta.WebAuthn result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rpId_ = rpId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.oslogin.v1beta.WebAuthn) { + return mergeFrom((com.google.cloud.oslogin.v1beta.WebAuthn) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.oslogin.v1beta.WebAuthn other) { + if (other == com.google.cloud.oslogin.v1beta.WebAuthn.getDefaultInstance()) return this; + if (!other.getRpId().isEmpty()) { + rpId_ = other.rpId_; + bitField0_ |= 0x00000001; + 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: + { + rpId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + 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 java.lang.Object rpId_ = ""; + + /** + * + * + *
+     * Relying party ID for Web Authentication.
+     * 
+ * + * string rp_id = 1; + * + * @return The rpId. + */ + public java.lang.String getRpId() { + java.lang.Object ref = rpId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rpId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Relying party ID for Web Authentication.
+     * 
+ * + * string rp_id = 1; + * + * @return The bytes for rpId. + */ + public com.google.protobuf.ByteString getRpIdBytes() { + java.lang.Object ref = rpId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rpId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Relying party ID for Web Authentication.
+     * 
+ * + * string rp_id = 1; + * + * @param value The rpId to set. + * @return This builder for chaining. + */ + public Builder setRpId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + rpId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Relying party ID for Web Authentication.
+     * 
+ * + * string rp_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearRpId() { + rpId_ = getDefaultInstance().getRpId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Relying party ID for Web Authentication.
+     * 
+ * + * string rp_id = 1; + * + * @param value The bytes for rpId to set. + * @return This builder for chaining. + */ + public Builder setRpIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + rpId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.oslogin.v1beta.WebAuthn) + } + + // @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1beta.WebAuthn) + private static final com.google.cloud.oslogin.v1beta.WebAuthn DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.oslogin.v1beta.WebAuthn(); + } + + public static com.google.cloud.oslogin.v1beta.WebAuthn getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebAuthn 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.oslogin.v1beta.WebAuthn getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/WebAuthnOrBuilder.java b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/WebAuthnOrBuilder.java new file mode 100644 index 000000000000..61abdd0a86ce --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/java/com/google/cloud/oslogin/v1beta/WebAuthnOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/oslogin/v1beta/oslogin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.oslogin.v1beta; + +@com.google.protobuf.Generated +public interface WebAuthnOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.oslogin.v1beta.WebAuthn) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Relying party ID for Web Authentication.
+   * 
+ * + * string rp_id = 1; + * + * @return The rpId. + */ + java.lang.String getRpId(); + + /** + * + * + *
+   * Relying party ID for Web Authentication.
+   * 
+ * + * string rp_id = 1; + * + * @return The bytes for rpId. + */ + com.google.protobuf.ByteString getRpIdBytes(); +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/proto/google/cloud/oslogin/common/common.proto b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/proto/google/cloud/oslogin/common/common.proto new file mode 100644 index 000000000000..afa92ed6b70e --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/proto/google/cloud/oslogin/common/common.proto @@ -0,0 +1,107 @@ +// Copyright 2025 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.oslogin.common; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.OsLogin.Common"; +option go_package = "cloud.google.com/go/oslogin/common/commonpb;commonpb"; +option java_outer_classname = "OsLoginProto"; +option java_package = "com.google.cloud.oslogin.common"; +option php_namespace = "Google\\Cloud\\OsLogin\\Common"; +option ruby_package = "Google::Cloud::OsLogin::Common"; +option (google.api.resource_definition) = { + type: "oslogin.googleapis.com/User" + pattern: "users/{user}" +}; + +// The operating system options for account entries. +enum OperatingSystemType { + // The operating system type associated with the user account information is + // unspecified. + OPERATING_SYSTEM_TYPE_UNSPECIFIED = 0; + + // Linux user account information. + LINUX = 1; + + // Windows user account information. + WINDOWS = 2; +} + +// The POSIX account information associated with a Google account. +message PosixAccount { + option (google.api.resource) = { + type: "oslogin.googleapis.com/PosixAccount" + pattern: "users/{user}/projects/{project}" + }; + + // Only one POSIX account can be marked as primary. + bool primary = 1; + + // The username of the POSIX account. + string username = 2; + + // The user ID. + int64 uid = 3; + + // The default group ID. + int64 gid = 4; + + // The path to the home directory for this account. + string home_directory = 5; + + // The path to the logic shell for this account. + string shell = 6; + + // The GECOS (user information) entry for this account. + string gecos = 7; + + // System identifier for which account the username or uid applies to. + // By default, the empty value is used. + string system_id = 8; + + // Output only. A POSIX account identifier. + string account_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The operating system type where this account applies. + OperatingSystemType operating_system_type = 10; + + // Output only. The canonical resource name. + string name = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The SSH public key information associated with a Google account. +message SshPublicKey { + option (google.api.resource) = { + type: "oslogin.googleapis.com/SshPublicKey" + pattern: "users/{user}/sshPublicKeys/{fingerprint}" + }; + + // Public key text in SSH format, defined by + // [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6. + string key = 1; + + // An expiration time in microseconds since epoch. + int64 expiration_time_usec = 2; + + // Output only. The SHA-256 fingerprint of the SSH public key. + string fingerprint = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The canonical resource name. + string name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-os-login/proto-google-cloud-os-login-v1beta/src/main/proto/google/cloud/oslogin/v1beta/oslogin.proto b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/proto/google/cloud/oslogin/v1beta/oslogin.proto new file mode 100644 index 000000000000..80dce90d7d97 --- /dev/null +++ b/java-os-login/proto-google-cloud-os-login-v1beta/src/main/proto/google/cloud/oslogin/v1beta/oslogin.proto @@ -0,0 +1,330 @@ +// Copyright 2025 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.oslogin.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/oslogin/common/common.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.OsLogin.V1Beta"; +option go_package = "cloud.google.com/go/oslogin/apiv1beta/osloginpb;osloginpb"; +option java_multiple_files = true; +option java_outer_classname = "OsLoginProto"; +option java_package = "com.google.cloud.oslogin.v1beta"; +option php_namespace = "Google\\Cloud\\OsLogin\\V1beta"; +option ruby_package = "Google::Cloud::OsLogin::V1beta"; + +// Cloud OS Login API +// +// The Cloud OS Login API allows you to manage users and their associated SSH +// public keys for logging into virtual machines on Google Cloud Platform. +service OsLoginService { + option (google.api.default_host) = "oslogin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/compute.readonly"; + + // Create an SSH public key + rpc CreateSshPublicKey(CreateSshPublicKeyRequest) + returns (google.cloud.oslogin.common.SshPublicKey) { + option (google.api.http) = { + post: "/v1beta/{parent=users/*}/sshPublicKeys" + body: "ssh_public_key" + }; + option (google.api.method_signature) = "parent,ssh_public_key"; + } + + // Deletes a POSIX account. + rpc DeletePosixAccount(DeletePosixAccountRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=users/*/projects/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes an SSH public key. + rpc DeleteSshPublicKey(DeleteSshPublicKeyRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=users/*/sshPublicKeys/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves the profile information used for logging in to a virtual machine + // on Google Compute Engine. + rpc GetLoginProfile(GetLoginProfileRequest) returns (LoginProfile) { + option (google.api.http) = { + get: "/v1beta/{name=users/*}/loginProfile" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves an SSH public key. + rpc GetSshPublicKey(GetSshPublicKeyRequest) + returns (google.cloud.oslogin.common.SshPublicKey) { + option (google.api.http) = { + get: "/v1beta/{name=users/*/sshPublicKeys/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Adds an SSH public key and returns the profile information. Default POSIX + // account information is set when no username and UID exist as part of the + // login profile. + rpc ImportSshPublicKey(ImportSshPublicKeyRequest) + returns (ImportSshPublicKeyResponse) { + option (google.api.http) = { + post: "/v1beta/{parent=users/*}:importSshPublicKey" + body: "ssh_public_key" + }; + option (google.api.method_signature) = "parent,ssh_public_key"; + option (google.api.method_signature) = "parent,ssh_public_key,project_id"; + } + + // Updates an SSH public key and returns the profile information. This method + // supports patch semantics. + rpc UpdateSshPublicKey(UpdateSshPublicKeyRequest) + returns (google.cloud.oslogin.common.SshPublicKey) { + option (google.api.http) = { + patch: "/v1beta/{name=users/*/sshPublicKeys/*}" + body: "ssh_public_key" + }; + option (google.api.method_signature) = "name,ssh_public_key"; + option (google.api.method_signature) = "name,ssh_public_key,update_mask"; + } + + // Signs an SSH public key for a user to authenticate to an instance. + rpc SignSshPublicKey(SignSshPublicKeyRequest) + returns (SignSshPublicKeyResponse) { + option (google.api.http) = { + post: "/v1beta/{parent=users/*/projects/*/zones/*}:signSshPublicKey" + body: "*" + additional_bindings { + post: "/v1beta/{parent=users/*/projects/*/locations/*}:signSshPublicKey" + body: "*" + } + }; + option (google.api.method_signature) = "parent,ssh_public_key"; + } +} + +// The user profile information used for logging in to a virtual machine on +// Google Compute Engine. +message LoginProfile { + // Required. A unique user ID. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of POSIX accounts associated with the user. + repeated google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + + // A map from SSH public key fingerprint to the associated key object. + map ssh_public_keys = 3; + + // The registered security key credentials for a user. + repeated SecurityKey security_keys = 5; +} + +// A request message for creating an SSH public key. +message CreateSshPublicKeyRequest { + // Required. The unique ID for the user in format `users/{user}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "oslogin.googleapis.com/SshPublicKey" + } + ]; + + // Required. The SSH public key and expiration time. + google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// A request message for deleting a POSIX account entry. +message DeletePosixAccountRequest { + // Required. A reference to the POSIX account to update. POSIX accounts are + // identified by the project ID they are associated with. A reference to the + // POSIX account is in format `users/{user}/projects/{project}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/PosixAccount" + } + ]; +} + +// A request message for deleting an SSH public key. +message DeleteSshPublicKeyRequest { + // Required. The fingerprint of the public key to update. Public keys are + // identified by their SHA-256 fingerprint. The fingerprint of the public key + // is in format `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; +} + +// A request message for retrieving the login profile information for a user. +message GetLoginProfileRequest { + // Required. The unique ID for the user in format `users/{user}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "oslogin.googleapis.com/User" } + ]; + + // The project ID of the Google Cloud Platform project. + string project_id = 2; + + // A system ID for filtering the results of the request. + string system_id = 3; + + // The view configures whether to retrieve security keys information. + LoginProfileView view = 4; +} + +// A request message for retrieving an SSH public key. +message GetSshPublicKeyRequest { + // Required. The fingerprint of the public key to retrieve. Public keys are + // identified by their SHA-256 fingerprint. The fingerprint of the public key + // is in format `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; +} + +// A request message for importing an SSH public key. +message ImportSshPublicKeyRequest { + // The unique ID for the user in format `users/{user}`. + string parent = 1 [(google.api.resource_reference) = { + child_type: "oslogin.googleapis.com/SshPublicKey" + }]; + + // Required. The SSH public key and expiration time. + google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 + [(google.api.field_behavior) = REQUIRED]; + + // The project ID of the Google Cloud Platform project. + string project_id = 3; + + // The view configures whether to retrieve security keys information. + LoginProfileView view = 4; + + // Optional. The regions to which to assert that the key was written. + // If unspecified, defaults to all regions. + // Regions are listed at https://cloud.google.com/about/locations#region. + repeated string regions = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for importing an SSH public key. +message ImportSshPublicKeyResponse { + // The login profile information for the user. + LoginProfile login_profile = 1; + + // Detailed information about import results. + string details = 2; +} + +// A request message for updating an SSH public key. +message UpdateSshPublicKeyRequest { + // Required. The fingerprint of the public key to update. Public keys are + // identified by their SHA-256 fingerprint. The fingerprint of the public key + // is in format `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; + + // Required. The SSH public key and expiration time. + google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Mask to control which fields get updated. Updates all if not present. + google.protobuf.FieldMask update_mask = 3; +} + +// The credential information for a Google registered security key. +message SecurityKey { + // Public key text in SSH format, defined by + // [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6. + string public_key = 1; + + // Hardware-backed private key text in SSH format. + string private_key = 2; + + // The FIDO protocol type used to register this credential. + oneof protocol_type { + // The U2F protocol type. + UniversalTwoFactor universal_two_factor = 3; + + // The Web Authentication protocol type. + WebAuthn web_authn = 4; + } + + // The security key nickname explicitly set by the user. + optional string device_nickname = 5; +} + +// Security key information specific to the U2F protocol. +message UniversalTwoFactor { + // Application ID for the U2F protocol. + string app_id = 1; +} + +// Security key information specific to the Web Authentication protocol. +message WebAuthn { + // Relying party ID for Web Authentication. + string rp_id = 1; +} + +message SignSshPublicKeyRequest { + // The SSH public key to sign. + string ssh_public_key = 1; + + // The parent project and region for the signing request. + string parent = 2; +} + +message SignSshPublicKeyResponse { + // The signed SSH public key to use in the SSH handshake. + string signed_ssh_public_key = 1; +} + +// The login profile view limits the user content retrieved. +enum LoginProfileView { + // The default login profile view. The API defaults to the BASIC view. + LOGIN_PROFILE_VIEW_UNSPECIFIED = 0; + + // Includes POSIX and SSH key information. + BASIC = 1; + + // Include security key information for the user. + SECURITY_KEY = 2; +} diff --git a/versions.txt b/versions.txt index 5ea4fc255e12..712f49e92331 100644 --- a/versions.txt +++ b/versions.txt @@ -1029,3 +1029,5 @@ google-cloud-nio:0.131.0:0.131.0 google-cloud-appoptimize:0.1.0:0.1.0 proto-google-cloud-appoptimize-v1beta:0.1.0:0.1.0 grpc-google-cloud-appoptimize-v1beta:0.1.0:0.1.0 +proto-google-cloud-os-login-v1beta:2.90.0:2.90.0 +grpc-google-cloud-os-login-v1beta:2.90.0:2.90.0 From 855fb84ee86e7bcca96a8eea684f650a3f76756e Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Fri, 17 Apr 2026 11:56:30 -0400 Subject: [PATCH 4/4] Revert "temp: attempt to force generation to run for oslogin" This reverts commit 13b4b6ad19133b3d02eca49fdd61d299e4a2cf62. --- .../.github/scripts/hermetic_library_generation.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sdk-platform-java/.github/scripts/hermetic_library_generation.sh b/sdk-platform-java/.github/scripts/hermetic_library_generation.sh index 534df6ab1795..fc991aa3e94d 100755 --- a/sdk-platform-java/.github/scripts/hermetic_library_generation.sh +++ b/sdk-platform-java/.github/scripts/hermetic_library_generation.sh @@ -120,14 +120,6 @@ python hermetic_build/common/cli/get_changed_libraries.py create \ --current-generation-config-path="${generation_config}"\ --force-regenerate-all="${force_regenerate_all}" | tee "${changed_libraries_file}" changed_libraries="$(cat "${changed_libraries_file}")" -# Force run for os-login -if [[ -z "${changed_libraries}" ]]; then - changed_libraries="os-login" -else - if [[ ! "${changed_libraries}" =~ "os-login" ]]; then - changed_libraries="os-login,${changed_libraries}" - fi -fi echo "Changed libraries are: ${changed_libraries:-"No changed library"}." # run hermetic code generation docker image.