3.14.0-rc 3.13.0 (latest) 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 2.48.0-rc 2.47.1 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.37.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.25.1 2.24.0 2.23.0 2.22.1 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.1 2.14.0 2.13.0 2.12.0 2.11.0 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.

###### Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal `std::shared_ptr<*Connection>` objects compare equal. Objects that compare equal share the same underlying resources.

###### Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

###### Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

## Constructors

### OsLoginServiceClient(OsLoginServiceClient const \&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `OsLoginServiceClient const &` |

### OsLoginServiceClient(OsLoginServiceClient \&\&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `OsLoginServiceClient &&` |

### OsLoginServiceClient(std::shared_ptr\< OsLoginServiceConnection \>, Options)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `connection` | `std::shared_ptr< OsLoginServiceConnection >` |
| `opts` | `Options` |

## Operators

### operator=(OsLoginServiceClient const \&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `OsLoginServiceClient const &` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `OsLoginServiceClient &` |   |

### operator=(OsLoginServiceClient \&\&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `OsLoginServiceClient &&` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `OsLoginServiceClient &` |   |

## Functions

### CreateSshPublicKey(std::string const \&, google::cloud::oslogin::common::SshPublicKey const \&, Options)

Create an SSH public key.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `std::string const &` Required. The unique ID for the user in format `users/{user}`. |
| `ssh_public_key` | `google::cloud::oslogin::common::SshPublicKey const &` Required. The SSH public key and expiration time. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::common::SshPublicKey >` | the result of the RPC. The response message type ([google.cloud.oslogin.common.SshPublicKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/common/common.proto#L89)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### CreateSshPublicKey(google::cloud::oslogin::v1::CreateSshPublicKeyRequest const \&, Options)

Create an SSH public key.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::oslogin::v1::CreateSshPublicKeyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.oslogin.v1.CreateSshPublicKeyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L133). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::common::SshPublicKey >` | the result of the RPC. The response message type ([google.cloud.oslogin.common.SshPublicKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/common/common.proto#L89)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### DeletePosixAccount(std::string const \&, Options)

Deletes a POSIX account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` 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}`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### DeletePosixAccount(google::cloud::oslogin::v1::DeletePosixAccountRequest const \&, Options)

Deletes a POSIX account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::oslogin::v1::DeletePosixAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.oslogin.v1.DeletePosixAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L148). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### DeleteSshPublicKey(std::string const \&, Options)

Deletes an SSH public key.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` 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}`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### DeleteSshPublicKey(google::cloud::oslogin::v1::DeleteSshPublicKeyRequest const \&, Options)

Deletes an SSH public key.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::oslogin::v1::DeleteSshPublicKeyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.oslogin.v1.DeleteSshPublicKeyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L161). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### GetLoginProfile(std::string const \&, Options)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The unique ID for the user in format `users/{user}`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::v1::LoginProfile >` | the result of the RPC. The response message type ([google.cloud.oslogin.v1.LoginProfile](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L121)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetLoginProfile(google::cloud::oslogin::v1::GetLoginProfileRequest const \&, Options)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::oslogin::v1::GetLoginProfileRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.oslogin.v1.GetLoginProfileRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L174). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::v1::LoginProfile >` | the result of the RPC. The response message type ([google.cloud.oslogin.v1.LoginProfile](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L121)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetSshPublicKey(std::string const \&, Options)

Retrieves an SSH public key.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` 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}`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::common::SshPublicKey >` | the result of the RPC. The response message type ([google.cloud.oslogin.common.SshPublicKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/common/common.proto#L89)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetSshPublicKey(google::cloud::oslogin::v1::GetSshPublicKeyRequest const \&, Options)

Retrieves an SSH public key.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::oslogin::v1::GetSshPublicKeyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.oslogin.v1.GetSshPublicKeyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L191). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::common::SshPublicKey >` | the result of the RPC. The response message type ([google.cloud.oslogin.common.SshPublicKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/common/common.proto#L89)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### ImportSshPublicKey(std::string const \&, google::cloud::oslogin::common::SshPublicKey const \&, Options)

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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `std::string const &` Required. The unique ID for the user in format `users/{user}`. |
| `ssh_public_key` | `google::cloud::oslogin::common::SshPublicKey const &` Optional. The SSH public key and expiration time. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::v1::ImportSshPublicKeyResponse >` | the result of the RPC. The response message type ([google.cloud.oslogin.v1.ImportSshPublicKeyResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L227)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### ImportSshPublicKey(std::string const \&, google::cloud::oslogin::common::SshPublicKey const \&, std::string const \&, Options)

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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `std::string const &` Required. The unique ID for the user in format `users/{user}`. |
| `ssh_public_key` | `google::cloud::oslogin::common::SshPublicKey const &` Optional. The SSH public key and expiration time. |
| `project_id` | `std::string const &` The project ID of the Google Cloud Platform project. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::v1::ImportSshPublicKeyResponse >` | the result of the RPC. The response message type ([google.cloud.oslogin.v1.ImportSshPublicKeyResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L227)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### ImportSshPublicKey(google::cloud::oslogin::v1::ImportSshPublicKeyRequest const \&, Options)

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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::oslogin::v1::ImportSshPublicKeyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.oslogin.v1.ImportSshPublicKeyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L204). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::v1::ImportSshPublicKeyResponse >` | the result of the RPC. The response message type ([google.cloud.oslogin.v1.ImportSshPublicKeyResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L227)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UpdateSshPublicKey(std::string const \&, google::cloud::oslogin::common::SshPublicKey const \&, Options)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` 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}`. |
| `ssh_public_key` | `google::cloud::oslogin::common::SshPublicKey const &` Required. The SSH public key and expiration time. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::common::SshPublicKey >` | the result of the RPC. The response message type ([google.cloud.oslogin.common.SshPublicKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/common/common.proto#L89)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UpdateSshPublicKey(std::string const \&, google::cloud::oslogin::common::SshPublicKey const \&, google::protobuf::FieldMask const \&, Options)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` 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}`. |
| `ssh_public_key` | `google::cloud::oslogin::common::SshPublicKey const &` Required. The SSH public key and expiration time. |
| `update_mask` | `google::protobuf::FieldMask const &` Mask to control which fields get updated. Updates all if not present. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::common::SshPublicKey >` | the result of the RPC. The response message type ([google.cloud.oslogin.common.SshPublicKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/common/common.proto#L89)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UpdateSshPublicKey(google::cloud::oslogin::v1::UpdateSshPublicKeyRequest const \&, Options)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::oslogin::v1::UpdateSshPublicKeyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.oslogin.v1.UpdateSshPublicKeyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/v1/oslogin.proto#L236). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::oslogin::common::SshPublicKey >` | the result of the RPC. The response message type ([google.cloud.oslogin.common.SshPublicKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/oslogin/common/common.proto#L89)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |