# Google Cloud Migration Center V1 Client - Class Aggregation (1.2.3)

1.2.3 (latest) 1.2.2 1.1.2 1.0.3 0.4.5 0.3.1 0.2.0 0.1.0 Reference documentation and code samples for the Google Cloud Migration Center V1 Client class Aggregation.

Message describing an aggregation. The message includes the aggregation type,
parameters, and the field on which to perform the aggregation.

Generated from protobuf message `google.cloud.migrationcenter.v1.Aggregation`

## Namespace

Google \\ Cloud \\ MigrationCenter \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ field` | `string` The name of the field on which to aggregate. |
| `↳ count` | `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Count` Count the number of matching objects. |
| `↳ sum` | `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Sum` Sum over a numeric field. |
| `↳ histogram` | `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Histogram` Creates a bucketed histogram of field values. |
| `↳ frequency` | `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Frequency` Creates a frequency distribution of all field values. |

### getField

The name of the field on which to aggregate.

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

### setField

The name of the field on which to aggregate.

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

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

### getCount

Count the number of matching objects.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Count|null` |   |

### hasCount

### setCount

Count the number of matching objects.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Count` |

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

### getSum

Sum over a numeric field.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Sum|null` |   |

### hasSum

### setSum

Sum over a numeric field.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Sum` |

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

### getHistogram

Creates a bucketed histogram of field values.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Histogram|null` |   |

### hasHistogram

### setHistogram

Creates a bucketed histogram of field values.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Histogram` |

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

### getFrequency

Creates a frequency distribution of all field values.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Frequency|null` |   |

### hasFrequency

### setFrequency

Creates a frequency distribution of all field values.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-migrationcenter/latest/V1.Aggregation.Frequency` |

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

### getAggregationFunction

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