# Recommender V1 Client - Class SustainabilityProjection (2.2.0)

2.2.0 (latest) 2.1.3 2.0.5 1.11.5 1.10.0 1.9.1 1.8.2 1.7.8 Reference documentation and code samples for the Recommender V1 Client class SustainabilityProjection.

Contains metadata about how much sustainability a recommendation can save or
incur.

Generated from protobuf message `google.cloud.recommender.v1.SustainabilityProjection`

## Namespace

Google \\ Cloud \\ Recommender \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ kg_c_o2e` | `float` Carbon Footprint generated in kg of CO2 equivalent. Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). |
| `↳ duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Duration for which this sustainability applies. |

### getKgCO2E

Carbon Footprint generated in kg of CO2 equivalent.

Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setKgCO2E

Carbon Footprint generated in kg of CO2 equivalent.

Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e).

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

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

### getDuration

Duration for which this sustainability applies.

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

### hasDuration

### clearDuration

### setDuration

Duration for which this sustainability applies.

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

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