# Stackdriver Monitoring V3 Client - Class CreateServiceLevelObjectiveRequest (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 CreateServiceLevelObjectiveRequest.

The `CreateServiceLevelObjective` request.

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

## Namespace

Google \\ Cloud \\ Monitoring \\ V3

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. Resource name of the parent `Service`. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\] |
| `↳ service_level_objective_id` | `string` Optional. The ServiceLevelObjective id to use for this ServiceLevelObjective. If omitted, an id will be generated instead. Must match the pattern `^[a-zA-Z0-9-_:.]+$` |
| `↳ service_level_objective` | `https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.ServiceLevelObjective` Required. The `ServiceLevelObjective` to create. The provided `name` will be respected if no `ServiceLevelObjective` exists with this name. |

### getParent

Required. Resource name of the parent `Service`. The format is:
projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\]

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

### setParent

Required. Resource name of the parent `Service`. The format is:
projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\]

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

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

### getServiceLevelObjectiveId

Optional. The ServiceLevelObjective id to use for this
ServiceLevelObjective. If omitted, an id will be generated instead. Must
match the pattern `^[a-zA-Z0-9-_:.]+$`

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

### setServiceLevelObjectiveId

Optional. The ServiceLevelObjective id to use for this
ServiceLevelObjective. If omitted, an id will be generated instead. Must
match the pattern `^[a-zA-Z0-9-_:.]+$`

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

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

### getServiceLevelObjective

Required. The `ServiceLevelObjective` to create.

The provided `name` will be respected if no `ServiceLevelObjective` exists
with this name.

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

### hasServiceLevelObjective

### clearServiceLevelObjective

### setServiceLevelObjective

Required. The `ServiceLevelObjective` to create.

The provided `name` will be respected if no `ServiceLevelObjective` exists
with this name.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. Resource name of the parent `Service`. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/services/\[SERVICE_ID\] Please see ServiceMonitoringServiceClient::serviceName() for help formatting this field. |
| `serviceLevelObjective` | `https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.ServiceLevelObjective` Required. The `ServiceLevelObjective` to create. The provided `name` will be respected if no `ServiceLevelObjective` exists with this name. |

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