# Class OsLoginServiceClient (2.92.0)

2.92.0 (latest) 2.90.0 2.87.0 2.86.0 2.84.0 2.82.0 2.81.0 2.79.0 2.77.0 2.75.0 2.74.0 2.73.0 2.72.0 2.71.0 2.69.0 2.67.0 2.66.0 2.63.0 2.62.0 2.61.0 2.59.0 2.58.0 2.57.0 2.56.0 2.55.0 2.54.0 2.53.0 2.52.0 2.51.0 2.50.0 2.48.0 2.47.0 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.39.0 2.38.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.23.0 2.22.0 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.7 2.0.15

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-os-login/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java) | [Product Reference](https://cloud.google.com/compute/docs/oslogin/) |

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:


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

| Method | Description | Method 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() |
[Methods]

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:


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


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


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

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> OsLoginServiceClient

## Static Methods

### create()

    public static final OsLoginServiceClient create()

Constructs an instance of OsLoginServiceClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.OsLoginServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(OsLoginServiceSettings settings)

    public static final OsLoginServiceClient create(OsLoginServiceSettings settings)

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.OsLoginServiceSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.OsLoginServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(OsLoginServiceStub stub)

    public static final OsLoginServiceClient create(OsLoginServiceStub stub)

Constructs an instance of OsLoginServiceClient, using the given stub for making calls. This is
for advanced usage - prefer using create(OsLoginServiceSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.stub.OsLoginServiceStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.OsLoginServiceClient` |   |

## Constructors

### OsLoginServiceClient(OsLoginServiceSettings settings)

    protected OsLoginServiceClient(OsLoginServiceSettings settings)

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.OsLoginServiceSettings` |

### OsLoginServiceClient(OsLoginServiceStub stub)

    protected OsLoginServiceClient(OsLoginServiceStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.stub.OsLoginServiceStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### close()

    public final void close()

### createSshPublicKey(CreateSshPublicKeyRequest request)

    public final OsLoginProto.SshPublicKey createSshPublicKey(CreateSshPublicKeyRequest request)

Create an SSH public key

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.CreateSshPublicKeyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` |   |

### createSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey)

    public final OsLoginProto.SshPublicKey createSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey)

Create an SSH public key

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       UserName parent = UserName.of("[USER]");
       OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
       OsLoginProto.SshPublicKey response =
           osLoginServiceClient.createSshPublicKey(parent, sshPublicKey);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.UserName` Required. The unique ID for the user in format `users/{user}`. |
| `sshPublicKey` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` Required. The SSH public key and expiration time. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` |   |

### createSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey)

    public final OsLoginProto.SshPublicKey createSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey)

Create an SSH public key

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       String parent = UserName.of("[USER]").toString();
       OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
       OsLoginProto.SshPublicKey response =
           osLoginServiceClient.createSshPublicKey(parent, sshPublicKey);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The unique ID for the user in format `users/{user}`. |
| `sshPublicKey` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` Required. The SSH public key and expiration time. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` |   |

### createSshPublicKeyCallable()

    public final UnaryCallable<CreateSshPublicKeyRequest,OsLoginProto.SshPublicKey> createSshPublicKeyCallable()

Create an SSH public key

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       CreateSshPublicKeyRequest request =
           CreateSshPublicKeyRequest.newBuilder()
               .setParent(UserName.of("[USER]").toString())
               .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build())
               .build();
       ApiFuture<OsLoginProto.SshPublicKey> future =
           osLoginServiceClient.createSshPublicKeyCallable().futureCall(request);
       // Do something.
       OsLoginProto.SshPublicKey response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.CreateSshPublicKeyRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey>` |   |

### deletePosixAccount(DeletePosixAccountRequest request)

    public final void deletePosixAccount(DeletePosixAccountRequest request)

Deletes a POSIX account.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       DeletePosixAccountRequest request =
           DeletePosixAccountRequest.newBuilder()
               .setName(ProjectName.of("[USER]", "[PROJECT]").toString())
               .build();
       osLoginServiceClient.deletePosixAccount(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.DeletePosixAccountRequest` The request object containing all of the parameters for the API call. |

### deletePosixAccount(ProjectName name)

    public final void deletePosixAccount(ProjectName name)

Deletes a POSIX account.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       ProjectName name = ProjectName.of("[USER]", "[PROJECT]");
       osLoginServiceClient.deletePosixAccount(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.ProjectName` 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}`. |

### deletePosixAccount(String name)

    public final void deletePosixAccount(String name)

Deletes a POSIX account.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       String name = ProjectName.of("[USER]", "[PROJECT]").toString();
       osLoginServiceClient.deletePosixAccount(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` 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}`. |

### deletePosixAccountCallable()

    public final UnaryCallable<DeletePosixAccountRequest,Empty> deletePosixAccountCallable()

Deletes a POSIX account.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       DeletePosixAccountRequest request =
           DeletePosixAccountRequest.newBuilder()
               .setName(ProjectName.of("[USER]", "[PROJECT]").toString())
               .build();
       ApiFuture<Empty> future =
           osLoginServiceClient.deletePosixAccountCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.DeletePosixAccountRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### deleteSshPublicKey(DeleteSshPublicKeyRequest request)

    public final void deleteSshPublicKey(DeleteSshPublicKeyRequest request)

Deletes an SSH public key.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       DeleteSshPublicKeyRequest request =
           DeleteSshPublicKeyRequest.newBuilder()
               .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString())
               .build();
       osLoginServiceClient.deleteSshPublicKey(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest` The request object containing all of the parameters for the API call. |

### deleteSshPublicKey(FingerprintName name)

    public final void deleteSshPublicKey(FingerprintName name)

Deletes an SSH public key.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]");
       osLoginServiceClient.deleteSshPublicKey(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.FingerprintName` 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}`. |

### deleteSshPublicKey(String name)

    public final void deleteSshPublicKey(String name)

Deletes an SSH public key.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       String name = FingerprintName.of("[USER]", "[FINGERPRINT]").toString();
       osLoginServiceClient.deleteSshPublicKey(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` 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}`. |

### deleteSshPublicKeyCallable()

    public final UnaryCallable<DeleteSshPublicKeyRequest,Empty> deleteSshPublicKeyCallable()

Deletes an SSH public key.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       DeleteSshPublicKeyRequest request =
           DeleteSshPublicKeyRequest.newBuilder()
               .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString())
               .build();
       ApiFuture<Empty> future =
           osLoginServiceClient.deleteSshPublicKeyCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### getLoginProfile(GetLoginProfileRequest request)

    public final LoginProfile getLoginProfile(GetLoginProfileRequest request)

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       GetLoginProfileRequest request =
           GetLoginProfileRequest.newBuilder()
               .setName(UserName.of("[USER]").toString())
               .setProjectId("projectId-894832108")
               .setSystemId("systemId1976085418")
               .build();
       LoginProfile response = osLoginServiceClient.getLoginProfile(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.GetLoginProfileRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.LoginProfile` |   |

### getLoginProfile(UserName name)

    public final LoginProfile getLoginProfile(UserName name)

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       UserName name = UserName.of("[USER]");
       LoginProfile response = osLoginServiceClient.getLoginProfile(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.UserName` Required. The unique ID for the user in format `users/{user}`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.LoginProfile` |   |

### getLoginProfile(String name)

    public final LoginProfile getLoginProfile(String name)

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       String name = UserName.of("[USER]").toString();
       LoginProfile response = osLoginServiceClient.getLoginProfile(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The unique ID for the user in format `users/{user}`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.LoginProfile` |   |

### getLoginProfileCallable()

    public final UnaryCallable<GetLoginProfileRequest,LoginProfile> getLoginProfileCallable()

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       GetLoginProfileRequest request =
           GetLoginProfileRequest.newBuilder()
               .setName(UserName.of("[USER]").toString())
               .setProjectId("projectId-894832108")
               .setSystemId("systemId1976085418")
               .build();
       ApiFuture<LoginProfile> future =
           osLoginServiceClient.getLoginProfileCallable().futureCall(request);
       // Do something.
       LoginProfile response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.GetLoginProfileRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.LoginProfile>` |   |

### getSettings()

    public final OsLoginServiceSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.OsLoginServiceSettings` |   |

### getSshPublicKey(FingerprintName name)

    public final OsLoginProto.SshPublicKey getSshPublicKey(FingerprintName name)

Retrieves an SSH public key.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]");
       OsLoginProto.SshPublicKey response = osLoginServiceClient.getSshPublicKey(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.FingerprintName` 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}`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` |   |

### getSshPublicKey(GetSshPublicKeyRequest request)

    public final OsLoginProto.SshPublicKey getSshPublicKey(GetSshPublicKeyRequest request)

Retrieves an SSH public key.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       GetSshPublicKeyRequest request =
           GetSshPublicKeyRequest.newBuilder()
               .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString())
               .build();
       OsLoginProto.SshPublicKey response = osLoginServiceClient.getSshPublicKey(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.GetSshPublicKeyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` |   |

### getSshPublicKey(String name)

    public final OsLoginProto.SshPublicKey getSshPublicKey(String name)

Retrieves an SSH public key.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       String name = FingerprintName.of("[USER]", "[FINGERPRINT]").toString();
       OsLoginProto.SshPublicKey response = osLoginServiceClient.getSshPublicKey(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` 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}`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` |   |

### getSshPublicKeyCallable()

    public final UnaryCallable<GetSshPublicKeyRequest,OsLoginProto.SshPublicKey> getSshPublicKeyCallable()

Retrieves an SSH public key.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       GetSshPublicKeyRequest request =
           GetSshPublicKeyRequest.newBuilder()
               .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString())
               .build();
       ApiFuture<OsLoginProto.SshPublicKey> future =
           osLoginServiceClient.getSshPublicKeyCallable().futureCall(request);
       // Do something.
       OsLoginProto.SshPublicKey response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.GetSshPublicKeyRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey>` |   |

### getStub()

    public OsLoginServiceStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.stub.OsLoginServiceStub` |   |

### importSshPublicKey(ImportSshPublicKeyRequest request)

    public final ImportSshPublicKeyResponse importSshPublicKey(ImportSshPublicKeyRequest 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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       ImportSshPublicKeyRequest request =
           ImportSshPublicKeyRequest.newBuilder()
               .setParent(UserName.of("[USER]").toString())
               .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build())
               .setProjectId("projectId-894832108")
               .addAllRegions(new ArrayList<String>())
               .build();
       ImportSshPublicKeyResponse response = osLoginServiceClient.importSshPublicKey(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.ImportSshPublicKeyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.ImportSshPublicKeyResponse` |   |

### importSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey)

    public final ImportSshPublicKeyResponse importSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey)

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:


     // 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);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.UserName` Required. The unique ID for the user in format `users/{user}`. |
| `sshPublicKey` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` Optional. The SSH public key and expiration time. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.ImportSshPublicKeyResponse` |   |

### importSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey, String projectId)

    public final ImportSshPublicKeyResponse importSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey, String projectId)

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:


     // 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);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.UserName` Required. The unique ID for the user in format `users/{user}`. |
| `sshPublicKey` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` Optional. The SSH public key and expiration time. |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The project ID of the Google Cloud Platform project. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.ImportSshPublicKeyResponse` |   |

### importSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey)

    public final ImportSshPublicKeyResponse importSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey)

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:


     // 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);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The unique ID for the user in format `users/{user}`. |
| `sshPublicKey` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` Optional. The SSH public key and expiration time. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.ImportSshPublicKeyResponse` |   |

### importSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey, String projectId)

    public final ImportSshPublicKeyResponse importSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey, String projectId)

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:


     // 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);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The unique ID for the user in format `users/{user}`. |
| `sshPublicKey` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` Optional. The SSH public key and expiration time. |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The project ID of the Google Cloud Platform project. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.ImportSshPublicKeyResponse` |   |

### importSshPublicKeyCallable()

    public final UnaryCallable<ImportSshPublicKeyRequest,ImportSshPublicKeyResponse> importSshPublicKeyCallable()

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:


     // 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")
               .addAllRegions(new ArrayList<String>())
               .build();
       ApiFuture<ImportSshPublicKeyResponse> future =
           osLoginServiceClient.importSshPublicKeyCallable().futureCall(request);
       // Do something.
       ImportSshPublicKeyResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.ImportSshPublicKeyRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.ImportSshPublicKeyResponse>` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### updateSshPublicKey(FingerprintName name, OsLoginProto.SshPublicKey sshPublicKey)

    public final OsLoginProto.SshPublicKey updateSshPublicKey(FingerprintName name, OsLoginProto.SshPublicKey sshPublicKey)

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
       FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]");
       OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
       OsLoginProto.SshPublicKey response =
           osLoginServiceClient.updateSshPublicKey(name, sshPublicKey);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.FingerprintName` 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}`. |
| `sshPublicKey` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` Required. The SSH public key and expiration time. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` |   |

### updateSshPublicKey(FingerprintName name, OsLoginProto.SshPublicKey sshPublicKey, FieldMask updateMask)

    public final OsLoginProto.SshPublicKey updateSshPublicKey(FingerprintName name, OsLoginProto.SshPublicKey sshPublicKey, FieldMask updateMask)

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (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);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.FingerprintName` 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}`. |
| `sshPublicKey` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` Required. The SSH public key and expiration time. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` Mask to control which fields get updated. Updates all if not present. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` |   |

### updateSshPublicKey(UpdateSshPublicKeyRequest request)

    public final OsLoginProto.SshPublicKey updateSshPublicKey(UpdateSshPublicKeyRequest request)

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` |   |

### updateSshPublicKey(String name, OsLoginProto.SshPublicKey sshPublicKey)

    public final OsLoginProto.SshPublicKey updateSshPublicKey(String name, OsLoginProto.SshPublicKey sshPublicKey)

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (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);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` 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}`. |
| `sshPublicKey` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` Required. The SSH public key and expiration time. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` |   |

### updateSshPublicKey(String name, OsLoginProto.SshPublicKey sshPublicKey, FieldMask updateMask)

    public final OsLoginProto.SshPublicKey updateSshPublicKey(String name, OsLoginProto.SshPublicKey sshPublicKey, FieldMask updateMask)

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (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);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` 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}`. |
| `sshPublicKey` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` Required. The SSH public key and expiration time. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` Mask to control which fields get updated. Updates all if not present. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey` |   |

### updateSshPublicKeyCallable()

    public final UnaryCallable<UpdateSshPublicKeyRequest,OsLoginProto.SshPublicKey> updateSshPublicKeyCallable()

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (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<OsLoginProto.SshPublicKey> future =
           osLoginServiceClient.updateSshPublicKeyCallable().futureCall(request);
       // Do something.
       OsLoginProto.SshPublicKey response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-os-login/latest/com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey>` |   |