# Google Cloud Network Connectivity V1 Client - Class ServiceConnectionPolicy (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.0 2.2.2 2.1.2 2.0.2 1.5.5 1.4.2 1.3.0 1.2.0 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud Network Connectivity V1 Client class ServiceConnectionPolicy.

The ServiceConnectionPolicy resource.

Generated from protobuf message `google.cloud.networkconnectivity.v1.ServiceConnectionPolicy`

## Namespace

Google \\ Cloud \\ NetworkConnectivity \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Immutable. The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: <https://google.aip.dev/122#fields-representing-resource-names> |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Time when the ServiceConnectionPolicy was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Time when the ServiceConnectionPolicy was updated. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` User-defined labels. |
| `↳ description` | `string` A description of this resource. |
| `↳ network` | `string` The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}. |
| `↳ service_class` | `string` The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or google-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. |
| `↳ infrastructure` | `int` Output only. The type of underlying resources used to create the connection. |
| `↳ psc_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.ServiceConnectionPolicy.PscConfig` Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. |
| `↳ psc_connections` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.ServiceConnectionPolicy.PscConnection>` Output only. \[Output only\] Information about each Private Service Connect connection. |
| `↳ etag` | `string` Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. |

### getName

Immutable. The name of a ServiceConnectionPolicy.

Format:
projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
See: <https://google.aip.dev/122#fields-representing-resource-names>

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

### setName

Immutable. The name of a ServiceConnectionPolicy.

Format:
projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
See: <https://google.aip.dev/122#fields-representing-resource-names>

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

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

### getCreateTime

Output only. Time when the ServiceConnectionPolicy was created.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. Time when the ServiceConnectionPolicy was created.

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

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

### getUpdateTime

Output only. Time when the ServiceConnectionPolicy was updated.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. Time when the ServiceConnectionPolicy was updated.

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

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

### getLabels

User-defined labels.

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

### setLabels

User-defined labels.

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

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

### getDescription

A description of this resource.

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

### setDescription

A description of this resource.

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

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

### getNetwork

The resource path of the consumer network.

Example:

- projects/{projectNumOrId}/global/networks/{resourceId}.

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

### setNetwork

The resource path of the consumer network.

Example:

- projects/{projectNumOrId}/global/networks/{resourceId}.

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

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

### getServiceClass

The service class identifier for which this ServiceConnectionPolicy is for.

The service class identifier is a unique, symbolic representation of a
ServiceClass. It is provided by the Service Producer. Google services have
a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
google-cloud-sql. 3rd party services do not. For example,
test-service-a3dfcx.

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

### setServiceClass

The service class identifier for which this ServiceConnectionPolicy is for.

The service class identifier is a unique, symbolic representation of a
ServiceClass. It is provided by the Service Producer. Google services have
a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
google-cloud-sql. 3rd party services do not. For example,
test-service-a3dfcx.

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

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

### getInfrastructure

Output only. The type of underlying resources used to create the
connection.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Infrastructure](https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.Infrastructure). |

### setInfrastructure

Output only. The type of underlying resources used to create the
connection.

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

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

### getPscConfig

Configuration used for Private Service Connect connections. Used when
Infrastructure is PSC.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.ServiceConnectionPolicy.PscConfig|null` |   |

### hasPscConfig

### clearPscConfig

### setPscConfig

Configuration used for Private Service Connect connections. Used when
Infrastructure is PSC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.ServiceConnectionPolicy.PscConfig` |

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

### getPscConnections

Output only. \[Output only\] Information about each Private Service Connect
connection.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.ServiceConnectionPolicy.PscConnection>` |   |

### setPscConnections

Output only. \[Output only\] Information about each Private Service Connect
connection.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.ServiceConnectionPolicy.PscConnection>` |

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

### getEtag

Optional. The etag is computed by the server, and may be sent on update and
delete requests to ensure the client has an up-to-date value before
proceeding.

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

### hasEtag

### clearEtag

### setEtag

Optional. The etag is computed by the server, and may be sent on update and
delete requests to ensure the client has an up-to-date value before
proceeding.

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

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