# Google Cloud Device Streaming V1 Client - Class CreateDeviceSessionRequest (0.2.4)

0.2.4 (latest) 0.2.3 0.1.1 Reference documentation and code samples for the Google Cloud Device Streaming V1 Client class CreateDeviceSessionRequest.

Request message for DirectAccessService.CreateDeviceSession.

Generated from protobuf message `google.cloud.devicestreaming.v1.CreateDeviceSessionRequest`

## Namespace

Google \\ Cloud \\ DeviceStreaming \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The Compute Engine project under which this device will be allocated. "projects/{project_id}" |
| `↳ device_session` | `https://docs.cloud.google.com/php/docs/reference/cloud-devicestreaming/latest/V1.DeviceSession` Required. A DeviceSession to create. |
| `↳ device_session_id` | `string` Optional. The ID to use for the DeviceSession, which will become the final component of the DeviceSession's resource name. This value should be 4-63 characters, and valid characters are /\[a-z\]\[0-9\]-/. |

### getParent

Required. The Compute Engine project under which this device will be
allocated. "projects/{project_id}"

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

### setParent

Required. The Compute Engine project under which this device will be
allocated. "projects/{project_id}"

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

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

### getDeviceSession

Required. A DeviceSession to create.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-devicestreaming/latest/V1.DeviceSession|null` |   |

### hasDeviceSession

### clearDeviceSession

### setDeviceSession

Required. A DeviceSession to create.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-devicestreaming/latest/V1.DeviceSession` |

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

### getDeviceSessionId

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

This value should be 4-63 characters, and valid characters
are /\[a-z\]\[0-9\]-/.

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

### setDeviceSessionId

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

This value should be 4-63 characters, and valid characters
are /\[a-z\]\[0-9\]-/.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The Compute Engine project under which this device will be allocated. "projects/{project_id}" Please see DirectAccessServiceClient::projectName() for help formatting this field. |
| `deviceSession` | `https://docs.cloud.google.com/php/docs/reference/cloud-devicestreaming/latest/V1.DeviceSession` Required. A DeviceSession to create. |
| `deviceSessionId` | `string` Optional. The ID to use for the DeviceSession, which will become the final component of the DeviceSession's resource name. This value should be 4-63 characters, and valid characters are /\[a-z\]\[0-9\]-/. |

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