4.3.0 (latest) 4.2.0 4.1.3 4.0.0 3.14.0 3.13.4 3.12.0 3.11.0 3.10.1 3.9.0 3.8.1 3.7.1 3.6.1 3.5.1 3.4.0 3.3.0 3.2.2 2.12.0 2.11.0 2.10.0 2.9.1 2.8.2 2.7.0 2.6.1 2.5.0 2.3.0 2.2.3 2.1.0 2.0.0 Reference documentation and code samples for the Google Cloud Dataproc V1 Client class Session.

A representation of a session.

Generated from protobuf message `google.cloud.dataproc.v1.Session`

## Namespace

Google \\ Cloud \\ Dataproc \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Identifier. The resource name of the session. |
| `↳ uuid` | `string` Output only. A session UUID (Unique Universal Identifier). The service generates this value when it creates the session. |
| `↳ create_time` | `Google\Protobuf\Timestamp` Output only. The time when the session was created. |
| `↳ jupyter_session` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.JupyterConfig` Optional. Jupyter session config. |
| `↳ spark_connect_session` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.SparkConnectConfig` Optional. Spark connect session config. |
| `↳ runtime_info` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.RuntimeInfo` Output only. Runtime information about session execution. |
| `↳ state` | `int` Output only. A state of the session. |
| `↳ state_message` | `string` Output only. Session state details, such as the failure description if the state is `FAILED`. |
| `↳ state_time` | `Google\Protobuf\Timestamp` Output only. The time when the session entered the current state. |
| `↳ creator` | `string` Output only. The email address of the user who created the session. |
| `↳ labels` | `array|Google\Protobuf\Internal\MapField` Optional. The labels to associate with the session. Label **keys** must contain 1 to 63 characters, and must conform to [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). Label **values** may be empty, but, if present, must contain 1 to 63 characters, and must conform to [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a session. |
| `↳ runtime_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.RuntimeConfig` Optional. Runtime configuration for the session execution. |
| `↳ environment_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.EnvironmentConfig` Optional. Environment configuration for the session execution. |
| `↳ user` | `string` Optional. The email address of the user who owns the session. |
| `↳ state_history` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.Session.SessionStateHistory>` Output only. Historical state information for the session. |
| `↳ session_template` | `string` Optional. The session template used by the session. Only resource names, including project ID and location, are valid. Example: \* \* `https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` \* \* `projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` The template must be in the same project and Dataproc region as the session. |

### getName

Identifier. The resource name of the session.

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

### setName

Identifier. The resource name of the session.

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

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

### getUuid

Output only. A session UUID (Unique Universal Identifier). The service
generates this value when it creates the session.

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

### setUuid

Output only. A session UUID (Unique Universal Identifier). The service
generates this value when it creates the session.

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

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

### getCreateTime

Output only. The time when the session was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time when the session was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

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

### getJupyterSession

Optional. Jupyter session config.

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

### hasJupyterSession

### setJupyterSession

Optional. Jupyter session config.

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

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

### getSparkConnectSession

Optional. Spark connect session config.

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

### hasSparkConnectSession

### setSparkConnectSession

Optional. Spark connect session config.

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

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

### getRuntimeInfo

Output only. Runtime information about session execution.

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

### hasRuntimeInfo

### clearRuntimeInfo

### setRuntimeInfo

Output only. Runtime information about session execution.

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

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

### getState

Output only. A state of the session.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.Session.State). |

### setState

Output only. A state of the session.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.Session.State). |

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

### getStateMessage

Output only. Session state details, such as the failure
description if the state is `FAILED`.

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

### setStateMessage

Output only. Session state details, such as the failure
description if the state is `FAILED`.

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

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

### getStateTime

Output only. The time when the session entered the current state.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasStateTime

### clearStateTime

### setStateTime

Output only. The time when the session entered the current state.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

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

### getCreator

Output only. The email address of the user who created the session.

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

### setCreator

Output only. The email address of the user who created the session.

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

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

### getLabels

Optional. The labels to associate with the session.

Label **keys** must contain 1 to 63 characters, and must conform to
[RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
Label **values** may be empty, but, if present, must contain 1 to 63
characters, and must conform to [RFC
1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
associated with a session.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Internal\MapField` |   |

### setLabels

Optional. The labels to associate with the session.

Label **keys** must contain 1 to 63 characters, and must conform to
[RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
Label **values** may be empty, but, if present, must contain 1 to 63
characters, and must conform to [RFC
1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
associated with a session.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|Google\Protobuf\Internal\MapField` |

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

### getRuntimeConfig

Optional. Runtime configuration for the session execution.

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

### hasRuntimeConfig

### clearRuntimeConfig

### setRuntimeConfig

Optional. Runtime configuration for the session execution.

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

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

### getEnvironmentConfig

Optional. Environment configuration for the session execution.

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

### hasEnvironmentConfig

### clearEnvironmentConfig

### setEnvironmentConfig

Optional. Environment configuration for the session execution.

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

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

### getUser

Optional. The email address of the user who owns the session.

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

### setUser

Optional. The email address of the user who owns the session.

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

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

### getStateHistory

Output only. Historical state information for the session.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.Session.SessionStateHistory>` |   |

### setStateHistory

Output only. Historical state information for the session.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.Session.SessionStateHistory>` |

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

### getSessionTemplate

Optional. The session template used by the session.

Only resource names, including project ID and location, are valid.
Example:

- `https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]`
- `projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` The template must be in the same project and Dataproc region as the session.

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

### setSessionTemplate

Optional. The session template used by the session.

Only resource names, including project ID and location, are valid.
Example:

- `https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]`
- `projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` The template must be in the same project and Dataproc region as the session.

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

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

### getSessionConfig

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