# Google Cloud Bare Metal Solution V2 Client - Class CreateSSHKeyRequest (1.1.3)

1.1.3 (latest) 1.1.2 1.0.5 0.6.5 0.5.2 0.4.0 0.3.2 0.2.8 Reference documentation and code samples for the Google Cloud Bare Metal Solution V2 Client class CreateSSHKeyRequest.

Message for registering a public SSH key in a project.

Generated from protobuf message `google.cloud.baremetalsolution.v2.CreateSSHKeyRequest`

## Namespace

Google \\ Cloud \\ BareMetalSolution \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The parent containing the SSH keys. |
| `↳ ssh_key` | `https://docs.cloud.google.com/php/docs/reference/cloud-bare-metal-solution/latest/V2.SSHKey` Required. The SSH key to register. |
| `↳ ssh_key_id` | `string` Required. The ID to use for the key, which will become the final component of the key's resource name. This value must match the regex: \[a-zA-Z0-9@.-_\]{1,64} |

### getParent

Required. The parent containing the SSH keys.

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

### setParent

Required. The parent containing the SSH keys.

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

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

### getSshKey

Required. The SSH key to register.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bare-metal-solution/latest/V2.SSHKey|null` |   |

### hasSshKey

### clearSshKey

### setSshKey

Required. The SSH key to register.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-bare-metal-solution/latest/V2.SSHKey` |

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

### getSshKeyId

Required. The ID to use for the key, which will become the final component
of the key's resource name.

This value must match the regex:
\[a-zA-Z0-9@.-_\]{1,64}

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

### setSshKeyId

Required. The ID to use for the key, which will become the final component
of the key's resource name.

This value must match the regex:
\[a-zA-Z0-9@.-_\]{1,64}

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The parent containing the SSH keys. Please see BareMetalSolutionClient::locationName() for help formatting this field. |
| `sshKey` | `https://docs.cloud.google.com/php/docs/reference/cloud-bare-metal-solution/latest/V2.SSHKey` Required. The SSH key to register. |
| `sshKeyId` | `string` Required. The ID to use for the key, which will become the final component of the key's resource name. This value must match the regex: \[a-zA-Z0-9@.-_\]{1,64} |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bare-metal-solution/latest/V2.CreateSSHKeyRequest` |   |