# Recommender V1 Client - Class CostProjection (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 CostProjection.

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

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

## Namespace

Google \\ Cloud \\ Recommender \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ cost` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Money.html` An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. A user's permissions may affect whether the cost is computed using list prices or custom contract prices. |
| `↳ duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Duration for which this cost applies. |
| `↳ cost_in_local_currency` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Money.html` The approximate cost savings in the billing account's local currency. |

### getCost

An approximate projection on amount saved or amount incurred. Negative cost
units indicate cost savings and positive cost units indicate increase.

See google.type.Money documentation for positive/negative units.
A user's permissions may affect whether the cost is computed using list
prices or custom contract prices.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Money.html|null` |   |

### hasCost

### clearCost

### setCost

An approximate projection on amount saved or amount incurred. Negative cost
units indicate cost savings and positive cost units indicate increase.

See google.type.Money documentation for positive/negative units.
A user's permissions may affect whether the cost is computed using list
prices or custom contract prices.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Money.html` |

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

### getDuration

Duration for which this cost applies.

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

### hasDuration

### clearDuration

### setDuration

Duration for which this cost applies.

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

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

### getCostInLocalCurrency

The approximate cost savings in the billing account's local currency.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Money.html|null` |   |

### hasCostInLocalCurrency

### clearCostInLocalCurrency

### setCostInLocalCurrency

The approximate cost savings in the billing account's local currency.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Money.html` |

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