# Google Cloud BigQuery Migration V2 Client - Class TimeSeries (1.3.0)

1.3.0 (latest) 1.2.3 1.1.5 1.0.0 0.4.5 0.3.3 0.2.2 0.1.4 Reference documentation and code samples for the Google Cloud BigQuery Migration V2 Client class TimeSeries.

The metrics object for a SubTask.

Generated from protobuf message `google.cloud.bigquery.migration.v2.TimeSeries`

## Namespace

Google \\ Cloud \\ BigQuery \\ Migration \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ metric` | `string` Required. The name of the metric. If the metric is not known by the service yet, it will be auto-created. |
| `↳ value_type` | `int` Required. The value type of the time series. |
| `↳ metric_kind` | `int` Optional. The metric kind of the time series. If present, it must be the same as the metric kind of the associated metric. If the associated metric's descriptor must be auto-created, then this field specifies the metric kind of the new descriptor and must be either `GAUGE` (the default) or `CUMULATIVE`. |
| `↳ points` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest/V2.Point>` Required. The data points of this time series. When listing time series, points are returned in reverse time order. When creating a time series, this field must contain exactly one point and the point's type must be the same as the value type of the associated metric. If the associated metric's descriptor must be auto-created, then the value type of the descriptor is determined by the point's type, which must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. |

### getMetric

Required. The name of the metric.

If the metric is not known by the service yet, it will be auto-created.

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

### setMetric

Required. The name of the metric.

If the metric is not known by the service yet, it will be auto-created.

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

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

### getValueType

Required. The value type of the time series.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ValueType](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.MetricDescriptor.ValueType.html). |

### setValueType

Required. The value type of the time series.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ValueType](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.MetricDescriptor.ValueType.html). |

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

### getMetricKind

Optional. The metric kind of the time series.

If present, it must be the same as the metric kind of the associated
metric. If the associated metric's descriptor must be auto-created, then
this field specifies the metric kind of the new descriptor and must be
either `GAUGE` (the default) or `CUMULATIVE`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [MetricKind](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.MetricDescriptor.MetricKind.html). |

### setMetricKind

Optional. The metric kind of the time series.

If present, it must be the same as the metric kind of the associated
metric. If the associated metric's descriptor must be auto-created, then
this field specifies the metric kind of the new descriptor and must be
either `GAUGE` (the default) or `CUMULATIVE`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [MetricKind](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.MetricDescriptor.MetricKind.html). |

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

### getPoints

Required. The data points of this time series. When listing time series,
points are returned in reverse time order.

When creating a time series, this field must contain exactly one point and
the point's type must be the same as the value type of the associated
metric. If the associated metric's descriptor must be auto-created, then
the value type of the descriptor is determined by the point's type, which
must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest/V2.Point>` |   |

### setPoints

Required. The data points of this time series. When listing time series,
points are returned in reverse time order.

When creating a time series, this field must contain exactly one point and
the point's type must be the same as the value type of the associated
metric. If the associated metric's descriptor must be auto-created, then
the value type of the descriptor is determined by the point's type, which
must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest/V2.Point>` |

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