# Google Cloud OsLogin V1 Client - Class ImportSshPublicKeyRequest (2.1.3)

2.1.3 (latest) 2.1.2 2.0.5 1.9.6 1.8.0 1.7.0 1.6.0 1.5.2 1.4.6 Reference documentation and code samples for the Google Cloud OsLogin V1 Client class ImportSshPublicKeyRequest.

A request message for importing an SSH public key.

Generated from protobuf message `google.cloud.oslogin.v1.ImportSshPublicKeyRequest`

## Namespace

Google \\ Cloud \\ OsLogin \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The unique ID for the user in format `users/{user}`. |
| `↳ ssh_public_key` | `https://docs.cloud.google.com/php/docs/reference/cloud-oslogin/latest/Common.SshPublicKey` Optional. The SSH public key and expiration time. |
| `↳ project_id` | `string` The project ID of the Google Cloud Platform project. |
| `↳ regions` | `array` 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>. |

### getParent

Required. The unique ID for the user in format `users/{user}`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setParent

Required. The unique ID for the user in format `users/{user}`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSshPublicKey

Optional. The SSH public key and expiration time.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-oslogin/latest/Common.SshPublicKey|null` |   |

### hasSshPublicKey

### clearSshPublicKey

### setSshPublicKey

Optional. The SSH public key and expiration time.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-oslogin/latest/Common.SshPublicKey` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getProjectId

The project ID of the Google Cloud Platform project.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setProjectId

The project ID of the Google Cloud Platform project.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRegions

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/RepeatedField` |   |

### setRegions

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The unique ID for the user in format `users/{user}`. Please see OsLoginServiceClient::userName() for help formatting this field. |
| `sshPublicKey` | `https://docs.cloud.google.com/php/docs/reference/cloud-oslogin/latest/Common.SshPublicKey` Optional. The SSH public key and expiration time. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-oslogin/latest/V1.ImportSshPublicKeyRequest` |   |

### static::buildFromParentSshPublicKeyProjectId

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The unique ID for the user in format `users/{user}`. Please see OsLoginServiceClient::userName() for help formatting this field. |
| `sshPublicKey` | `https://docs.cloud.google.com/php/docs/reference/cloud-oslogin/latest/Common.SshPublicKey` Optional. The SSH public key and expiration time. |
| `projectId` | `string` The project ID of the Google Cloud Platform project. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-oslogin/latest/V1.ImportSshPublicKeyRequest` |   |