# Google Cloud Gke Hub V1 Client - Class ConfigSync (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 ConfigSync.

Configuration for Config Sync

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

## Namespace

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

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ git` | `https://docs.cloud.google.com/php/docs/reference/cloud-gke-hub/latest/ConfigManagement.V1.GitConfig` Git repo configuration for the cluster. |
| `↳ source_format` | `string` Specifies whether the Config Sync Repo is in "hierarchical" or "unstructured" mode. |
| `↳ enabled` | `bool` Enables the installation of ConfigSync. If set to true, ConfigSync resources will be created and the other ConfigSync fields will be applied if exist. If set to false, all other ConfigSync fields will be ignored, ConfigSync resources will be deleted. If omitted, ConfigSync resources will be managed depends on the presence of the git or oci field. |
| `↳ prevent_drift` | `bool` Set to true to enable the Config Sync admission webhook to prevent drifts. If set to `false`, disables the Config Sync admission webhook and does not prevent drifts. |
| `↳ oci` | `https://docs.cloud.google.com/php/docs/reference/cloud-gke-hub/latest/ConfigManagement.V1.OciConfig` OCI repo configuration for the cluster |
| `↳ metrics_gcp_service_account_email` | `string` The Email of the Google Cloud Service Account (GSA) used for exporting Config Sync metrics to Cloud Monitoring when Workload Identity is enabled. The GSA should have the Monitoring Metric Writer (roles/monitoring.metricWriter) IAM role. The Kubernetes ServiceAccount `default` in the namespace `config-management-monitoring` should be bound to the GSA. |

### getGit

Git repo configuration for the cluster.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-gke-hub/latest/ConfigManagement.V1.GitConfig|null` |   |

### hasGit

### clearGit

### setGit

Git repo configuration for the cluster.

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

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

### getSourceFormat

Specifies whether the Config Sync Repo is
in "hierarchical" or "unstructured" mode.

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

### setSourceFormat

Specifies whether the Config Sync Repo is
in "hierarchical" or "unstructured" mode.

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

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

### getEnabled

Enables the installation of ConfigSync.

If set to true, ConfigSync resources will be created and the other
ConfigSync fields will be applied if exist.
If set to false, all other ConfigSync fields will be ignored, ConfigSync
resources will be deleted.
If omitted, ConfigSync resources will be managed depends on the presence
of the git or oci field.

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

### hasEnabled

### clearEnabled

### setEnabled

Enables the installation of ConfigSync.

If set to true, ConfigSync resources will be created and the other
ConfigSync fields will be applied if exist.
If set to false, all other ConfigSync fields will be ignored, ConfigSync
resources will be deleted.
If omitted, ConfigSync resources will be managed depends on the presence
of the git or oci field.

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

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

### getPreventDrift

Set to true to enable the Config Sync admission webhook to prevent drifts.

If set to `false`, disables the Config Sync admission webhook and does not
prevent drifts.

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

### setPreventDrift

Set to true to enable the Config Sync admission webhook to prevent drifts.

If set to `false`, disables the Config Sync admission webhook and does not
prevent drifts.

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

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

### getOci

OCI repo configuration for the cluster

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-gke-hub/latest/ConfigManagement.V1.OciConfig|null` |   |

### hasOci

### clearOci

### setOci

OCI repo configuration for the cluster

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

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

### getMetricsGcpServiceAccountEmail

The Email of the Google Cloud Service Account (GSA) used for exporting
Config Sync metrics to Cloud Monitoring when Workload Identity is enabled.

The GSA should have the Monitoring Metric Writer
(roles/monitoring.metricWriter) IAM role.
The Kubernetes ServiceAccount `default` in the namespace
`config-management-monitoring` should be bound to the GSA.

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

### setMetricsGcpServiceAccountEmail

The Email of the Google Cloud Service Account (GSA) used for exporting
Config Sync metrics to Cloud Monitoring when Workload Identity is enabled.

The GSA should have the Monitoring Metric Writer
(roles/monitoring.metricWriter) IAM role.
The Kubernetes ServiceAccount `default` in the namespace
`config-management-monitoring` should be bound to the GSA.

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

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