1.1.2 (latest) 1.1.1 1.0.4 0.8.5 0.7.5 0.6.0 0.5.8 Reference documentation and code samples for the Google Cloud Datastore Admin V1 Client class Index.

Datastore composite index definition.

Generated from protobuf message `google.datastore.admin.v1.Index`

## Namespace

Google \\ Cloud \\ Datastore \\ Admin \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ project_id` | `string` Output only. Project ID. |
| `↳ index_id` | `string` Output only. The resource ID of the index. |
| `↳ kind` | `string` Required. The entity kind to which this index applies. |
| `↳ ancestor` | `int` Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED. |
| `↳ properties` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-datastore-admin/latest/V1.Index.IndexedProperty>` Required. An ordered sequence of property names and their index attributes. Requires: \* \* A maximum of 100 properties. |
| `↳ state` | `int` Output only. The state of the index. |

### getProjectId

Output only. Project ID.

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

### setProjectId

Output only. Project ID.

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

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

### getIndexId

Output only. The resource ID of the index.

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

### setIndexId

Output only. The resource ID of the index.

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

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

### getKind

Required. The entity kind to which this index applies.

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

### setKind

Required. The entity kind to which this index applies.

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

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

### getAncestor

Required. The index's ancestor mode. Must not be
ANCESTOR_MODE_UNSPECIFIED.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [AncestorMode](https://docs.cloud.google.com/php/docs/reference/cloud-datastore-admin/latest/V1.Index.AncestorMode). |

### setAncestor

Required. The index's ancestor mode. Must not be
ANCESTOR_MODE_UNSPECIFIED.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [AncestorMode](https://docs.cloud.google.com/php/docs/reference/cloud-datastore-admin/latest/V1.Index.AncestorMode). |

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

### getProperties

Required. An ordered sequence of property names and their index attributes.

Requires:

- A maximum of 100 properties.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-datastore-admin/latest/V1.Index.IndexedProperty>` |   |

### setProperties

Required. An ordered sequence of property names and their index attributes.

Requires:

- A maximum of 100 properties.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-datastore-admin/latest/V1.Index.IndexedProperty>` |

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

### getState

Output only. The state of the index.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-datastore-admin/latest/V1.Index.State). |

### setState

Output only. The state of the index.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-datastore-admin/latest/V1.Index.State). |

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