# Google Cloud Batch V1 Client - Class Environment (1.4.1)

1.4.1 (latest) 1.4.0 1.3.1 1.2.2 1.1.7 1.0.3 0.17.0 0.16.10 0.15.0 0.14.0 0.13.1 0.12.1 0.11.3 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.2 0.4.0 0.3.0 0.2.2 Reference documentation and code samples for the Google Cloud Batch V1 Client class Environment.

An Environment describes a collection of environment variables to set when
executing Tasks.

Generated from protobuf message `google.cloud.batch.v1.Environment`

## Namespace

Google \\ Cloud \\ Batch \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ variables` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` A map of environment variable names to values. |
| `↳ secret_variables` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` A map of environment variable names to Secret Manager secret names. The VM will access the named secrets to set the value of each environment variable. |
| `↳ encrypted_variables` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.Environment.KMSEnvMap` An encrypted JSON dictionary where the key/value pairs correspond to environment variable names and their values. |

### getVariables

A map of environment variable names to values.

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

### setVariables

A map of environment variable names to values.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getSecretVariables

A map of environment variable names to Secret Manager secret names.

The VM will access the named secrets to set the value of each environment
variable.

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

### setSecretVariables

A map of environment variable names to Secret Manager secret names.

The VM will access the named secrets to set the value of each environment
variable.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getEncryptedVariables

An encrypted JSON dictionary where the key/value pairs correspond to
environment variable names and their values.

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

### hasEncryptedVariables

### clearEncryptedVariables

### setEncryptedVariables

An encrypted JSON dictionary where the key/value pairs correspond to
environment variable names and their values.

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

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