# Stackdriver Monitoring V3 Client - Class CreateTimeSeriesRequest (2.2.2)

2.2.2 (latest) 2.2.1 2.1.2 2.0.1 1.12.1 1.11.1 1.10.3 1.9.0 1.8.0 1.7.1 1.6.0 1.5.1 1.4.0 1.3.2 1.2.2 Reference documentation and code samples for the Stackdriver Monitoring V3 Client class CreateTimeSeriesRequest.

The `CreateTimeSeries` request.

Generated from protobuf message `google.monitoring.v3.CreateTimeSeriesRequest`

## Namespace

Google \\ Cloud \\ Monitoring \\ V3

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `↳ time_series` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.TimeSeries>` Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each `TimeSeries` value must fully specify a unique time series by supplying all label values for the metric and the monitored resource. The maximum number of `TimeSeries` objects per `Create` request is 200. |

### getName

Required. The
[project](https://cloud.google.com/monitoring/api/v3#project_name) on which
to execute the request. The format is:
projects/\[PROJECT_ID_OR_NUMBER\]

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

### setName

Required. The
[project](https://cloud.google.com/monitoring/api/v3#project_name) on which
to execute the request. The format is:
projects/\[PROJECT_ID_OR_NUMBER\]

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

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

### getTimeSeries

Required. The new data to be added to a list of time series.

Adds at most one data point to each of several time series. The new data
point must be more recent than any other point in its time series. Each
`TimeSeries` value must fully specify a unique time series by supplying
all label values for the metric and the monitored resource.
The maximum number of `TimeSeries` objects per `Create` request is 200.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.TimeSeries>` |   |

### setTimeSeries

Required. The new data to be added to a list of time series.

Adds at most one data point to each of several time series. The new data
point must be more recent than any other point in its time series. Each
`TimeSeries` value must fully specify a unique time series by supplying
all label values for the metric and the monitored resource.
The maximum number of `TimeSeries` objects per `Create` request is 200.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.TimeSeries>` |

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `string` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\] Please see MetricServiceClient::projectName() for help formatting this field. |
| `timeSeries` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.TimeSeries>` Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each `TimeSeries` value must fully specify a unique time series by supplying all label values for the metric and the monitored resource. The maximum number of `TimeSeries` objects per `Create` request is 200. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.CreateTimeSeriesRequest` |   |