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

The `CreateGroup` request.

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

## 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) in which to create the group. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `↳ group` | `https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.Group` Required. A group definition. It is an error to define the `name` field because the system assigns the name. |
| `↳ validate_only` | `bool` If true, validate this request but do not create the group. |

### getName

Required. The
[project](https://cloud.google.com/monitoring/api/v3#project_name) in which
to create the group. 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) in which
to create the group. The format is:
projects/\[PROJECT_ID_OR_NUMBER\]

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

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

### getGroup

Required. A group definition. It is an error to define the `name` field
because the system assigns the name.

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

### hasGroup

### clearGroup

### setGroup

Required. A group definition. It is an error to define the `name` field
because the system assigns the name.

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

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

### getValidateOnly

If true, validate this request but do not create the group.

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

### setValidateOnly

If true, validate this request but do not create the group.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `string` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in which to create the group. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `group` | `https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.Group` Required. A group definition. It is an error to define the `name` field because the system assigns the name. |

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