# Google Cloud Gke Hub V1 Client - Class SyncState (1.3.1)

1.3.1 (latest) 1.3.0 1.2.2 1.1.0 1.0.6 0.10.0 0.9.5 0.8.2 0.7.1 0.6.3 0.5.6 Reference documentation and code samples for the Google Cloud Gke Hub V1 Client class SyncState.

State indicating an ACM's progress syncing configurations to a cluster

Generated from protobuf message `google.cloud.gkehub.configmanagement.v1.SyncState`

## Namespace

Google \\ Cloud \\ GkeHub \\ ConfigManagement \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ source_token` | `string` Token indicating the state of the repo. |
| `↳ import_token` | `string` Token indicating the state of the importer. |
| `↳ sync_token` | `string` Token indicating the state of the syncer. |
| `↳ last_sync` | `string` Deprecated: use last_sync_time instead. Timestamp of when ACM last successfully synced the repo The time format is specified in <https://golang.org/pkg/time/#Time.String> |
| `↳ last_sync_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Timestamp type of when ACM last successfully synced the repo |
| `↳ code` | `int` Sync status code |
| `↳ errors` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-gke-hub/latest/ConfigManagement.V1.SyncError>` A list of errors resulting from problematic configs. This list will be truncated after 100 errors, although it is unlikely for that many errors to simultaneously exist. |

### getSourceToken

Token indicating the state of the repo.

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

### setSourceToken

Token indicating the state of the repo.

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

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

### getImportToken

Token indicating the state of the importer.

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

### setImportToken

Token indicating the state of the importer.

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

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

### getSyncToken

Token indicating the state of the syncer.

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

### setSyncToken

Token indicating the state of the syncer.

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

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

### getLastSync

Deprecated: use last_sync_time instead.

Timestamp of when ACM last successfully synced the repo
The time format is specified in <https://golang.org/pkg/time/#Time.String>

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

### setLastSync

Deprecated: use last_sync_time instead.

Timestamp of when ACM last successfully synced the repo
The time format is specified in <https://golang.org/pkg/time/#Time.String>

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

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

### getLastSyncTime

Timestamp type of when ACM last successfully synced the repo

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasLastSyncTime

### clearLastSyncTime

### setLastSyncTime

Timestamp type of when ACM last successfully synced the repo

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getCode

Sync status code

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [SyncCode](https://docs.cloud.google.com/php/docs/reference/cloud-gke-hub/latest/ConfigManagement.V1.SyncState.SyncCode). |

### setCode

Sync status code

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [SyncCode](https://docs.cloud.google.com/php/docs/reference/cloud-gke-hub/latest/ConfigManagement.V1.SyncState.SyncCode). |

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

### getErrors

A list of errors resulting from problematic configs.

This list will be truncated after 100 errors, although it is
unlikely for that many errors to simultaneously exist.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-gke-hub/latest/ConfigManagement.V1.SyncError>` |   |

### setErrors

A list of errors resulting from problematic configs.

This list will be truncated after 100 errors, although it is
unlikely for that many errors to simultaneously exist.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-gke-hub/latest/ConfigManagement.V1.SyncError>` |

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