# Google Cloud Capacity Planner V1beta Client - Class QueryForecastsRequest (0.1.2)

0.1.2 (latest) 0.1.1

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Cloud Capacity Planner V1beta Client class QueryForecastsRequest.

The `QueryForecasts` request.

Next : 14

Generated from protobuf message `google.cloud.capacityplanner.v1beta.QueryForecastsRequest`

## Namespace

Google \\ Cloud \\ CapacityPlanner \\ V1beta

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The compute engine resource and location for the time series values to return. The format is: projects/{project}/locations/{location} or organizations/{organization}/locations/{location} or folders/{folder}/locations/{location} |
| `↳ machine_family` | `string` The machine family to use to select the `Forecast` values to return. Possible values include "n1", and "n2d". Empty machine_family will return results matching all machine families. |
| `↳ machine_shape` | `https://docs.cloud.google.com/php/docs/reference/cloud-capacityplanner/latest/V1beta.MachineShape` Optional. The machine shape for the time series values to return. |
| `↳ disk_type` | `string` Optional. The disk_type for the `Forecast` values to return with request persistent-disk cloud_resource_type. Empty disk_type will return results matching all disk types. |
| `↳ confidential_mode` | `bool` Optional. Whether the persistent disk is in confidential mode. |
| `↳ gpu_type` | `string` Optional. The GPU type for the `Forecast` values to return. Sample values are "nvidia-tesla-t4", and "nvidia-tesla-a100". See <https://cloud.google.com/compute/docs/gpus> for a list. Empty gpu_type will return results matching all GPUs. |
| `↳ tpu_type` | `string` Optional. The TPU type for the `Forecast` values to return. Empty tpu_type will return results matching all TPUs. |
| `↳ cloud_resource_type` | `string` Required. The resource for the `Forecast` values to return. Possible values include "gce-vcpus", "gce-ram", "gce-local-ssd", "gce-persistent-disk", "gce-gpu" and "gce-tpu". Empty cloud_resource_type will return results matching all resources. |
| `↳ forecast_type` | `int` The type of forecast to use to select the `Forecast` values to return. FORECAST_TYPE_UNSPECIFIED will return results matching all the forecast types. |
| `↳ prediction_interval` | `int` The prediction interval to use to select the `Forecast` values to return. PREDICTION_INTERVAL_UNSPECIFIED will return results matching all prediction intervals. |
| `↳ aggregation_method` | `int` Aggregation Method of the historical usage for which the forecast is generated |

### getParent

Required. The compute engine resource and location for the time series
values to return. The format is:
projects/{project}/locations/{location} or
organizations/{organization}/locations/{location} or
folders/{folder}/locations/{location}

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

### setParent

Required. The compute engine resource and location for the time series
values to return. The format is:
projects/{project}/locations/{location} or
organizations/{organization}/locations/{location} or
folders/{folder}/locations/{location}

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

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

### getMachineFamily

The machine family to use to select the `Forecast` values to return.

Possible values include "n1", and "n2d".
Empty machine_family will return results matching all machine families.

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

### setMachineFamily

The machine family to use to select the `Forecast` values to return.

Possible values include "n1", and "n2d".
Empty machine_family will return results matching all machine families.

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

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

### getMachineShape

Optional. The machine shape for the time series values to return.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-capacityplanner/latest/V1beta.MachineShape|null` |   |

### hasMachineShape

### clearMachineShape

### setMachineShape

Optional. The machine shape for the time series values to return.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-capacityplanner/latest/V1beta.MachineShape` |

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

### getDiskType

Optional. The disk_type for the `Forecast` values to return with request
persistent-disk cloud_resource_type.

Empty disk_type will return results matching all disk types.

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

### setDiskType

Optional. The disk_type for the `Forecast` values to return with request
persistent-disk cloud_resource_type.

Empty disk_type will return results matching all disk types.

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

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

### getConfidentialMode

Optional. Whether the persistent disk is in confidential mode.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setConfidentialMode

Optional. Whether the persistent disk is in confidential mode.

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

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

### getGpuType

Optional. The GPU type for the `Forecast` values to return. Sample values
are "nvidia-tesla-t4", and "nvidia-tesla-a100". See
<https://cloud.google.com/compute/docs/gpus> for a list. Empty gpu_type
will return results matching all GPUs.

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

### setGpuType

Optional. The GPU type for the `Forecast` values to return. Sample values
are "nvidia-tesla-t4", and "nvidia-tesla-a100". See
<https://cloud.google.com/compute/docs/gpus> for a list. Empty gpu_type
will return results matching all GPUs.

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

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

### getTpuType

Optional. The TPU type for the `Forecast` values to return. Empty tpu_type
will return results matching all TPUs.

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

### setTpuType

Optional. The TPU type for the `Forecast` values to return. Empty tpu_type
will return results matching all TPUs.

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

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

### getCloudResourceType

Required. The resource for the `Forecast` values to return. Possible values
include "gce-vcpus", "gce-ram", "gce-local-ssd", "gce-persistent-disk",
"gce-gpu" and "gce-tpu". Empty cloud_resource_type will return results
matching all resources.

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

### setCloudResourceType

Required. The resource for the `Forecast` values to return. Possible values
include "gce-vcpus", "gce-ram", "gce-local-ssd", "gce-persistent-disk",
"gce-gpu" and "gce-tpu". Empty cloud_resource_type will return results
matching all resources.

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

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

### getForecastType

The type of forecast to use to select the `Forecast` values to return.

FORECAST_TYPE_UNSPECIFIED will return results matching all the forecast
types.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ForecastType](https://docs.cloud.google.com/php/docs/reference/cloud-capacityplanner/latest/V1beta.Forecast.ForecastType). |

### setForecastType

The type of forecast to use to select the `Forecast` values to return.

FORECAST_TYPE_UNSPECIFIED will return results matching all the forecast
types.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ForecastType](https://docs.cloud.google.com/php/docs/reference/cloud-capacityplanner/latest/V1beta.Forecast.ForecastType). |

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

### getPredictionInterval

The prediction interval to use to select the `Forecast` values to return.

PREDICTION_INTERVAL_UNSPECIFIED will return results matching all prediction
intervals.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [PredictionInterval](https://docs.cloud.google.com/php/docs/reference/cloud-capacityplanner/latest/V1beta.Forecast.PredictionInterval). |

### setPredictionInterval

The prediction interval to use to select the `Forecast` values to return.

PREDICTION_INTERVAL_UNSPECIFIED will return results matching all prediction
intervals.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [PredictionInterval](https://docs.cloud.google.com/php/docs/reference/cloud-capacityplanner/latest/V1beta.Forecast.PredictionInterval). |

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

### getAggregationMethod

Aggregation Method of the historical usage for which the forecast is
generated

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [AggregationMethod](https://docs.cloud.google.com/php/docs/reference/cloud-capacityplanner/latest/V1beta.UsageHistory.AggregationMethod). |

### setAggregationMethod

Aggregation Method of the historical usage for which the forecast is
generated

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [AggregationMethod](https://docs.cloud.google.com/php/docs/reference/cloud-capacityplanner/latest/V1beta.UsageHistory.AggregationMethod). |

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