# Interface ServiceConnectionPolicyOrBuilder (1.92.0)

1.92.0 (latest) 1.90.0 1.87.0 1.86.0 1.84.0 1.82.0 1.81.0 1.79.0 1.77.0 1.75.0 1.74.0 1.73.0 1.72.0 1.71.0 1.69.0 1.67.0 1.66.0 1.63.0 1.62.0 1.61.0 1.59.0 1.58.0 1.57.0 1.56.0 1.55.0 1.54.0 1.53.0 1.52.0 1.51.0 1.50.0 1.48.0 1.47.0 1.46.0 1.45.0 1.44.0 1.43.0 1.42.0 1.41.0 1.40.0 1.39.0 1.38.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.23.0 1.22.0 1.21.0 1.20.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.0 1.14.0 1.13.0 1.12.0 1.11.0 1.10.0 1.8.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.9 1.1.1 1.0.0 0.5.0

    public interface ServiceConnectionPolicyOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### containsLabels(String key)

    public abstract boolean containsLabels(String key)

User-defined labels.

`map<string, string> labels = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getCreateTime()

    public abstract Timestamp getCreateTime()

Output only. Time when the ServiceConnectionPolicy was created.

`.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The createTime. |

### getCreateTimeOrBuilder()

    public abstract TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Time when the ServiceConnectionPolicy was created.

`.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### getDescription()

    public abstract String getDescription()

A description of this resource.

`string description = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The description. |

### getDescriptionBytes()

    public abstract ByteString getDescriptionBytes()

A description of this resource.

`string description = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for description. |

### getEtag()

    public abstract String 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.

`optional string etag = 11 [(.google.api.field_behavior) = OPTIONAL];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The etag. |

### getEtagBytes()

    public abstract ByteString getEtagBytes()

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.

`optional string etag = 11 [(.google.api.field_behavior) = OPTIONAL];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for etag. |

### getInfrastructure()

    public abstract Infrastructure getInfrastructure()

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

`
.google.cloud.networkconnectivity.v1.Infrastructure infrastructure = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-networkconnectivity/latest/com.google.cloud.networkconnectivity.v1.Infrastructure` | The infrastructure. |

### getInfrastructureValue()

    public abstract int getInfrastructureValue()

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

`
.google.cloud.networkconnectivity.v1.Infrastructure infrastructure = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for infrastructure. |

### getLabels() (deprecated)

    public abstract Map<String,String> getLabels()

Use [#getLabelsMap()](https://docs.cloud.google.com/java/docs/reference/google-cloud-networkconnectivity/latest/com.google.cloud.networkconnectivity.v1.ServiceConnectionPolicyOrBuilder#com_google_cloud_networkconnectivity_v1_ServiceConnectionPolicyOrBuilder_getLabelsMap__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getLabelsCount()

    public abstract int getLabelsCount()

User-defined labels.

`map<string, string> labels = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getLabelsMap()

    public abstract Map<String,String> getLabelsMap()

User-defined labels.

`map<string, string> labels = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getLabelsOrDefault(String key, String defaultValue)

    public abstract String getLabelsOrDefault(String key, String defaultValue)

User-defined labels.

`map<string, string> labels = 4;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `defaultValue` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getLabelsOrThrow(String key)

    public abstract String getLabelsOrThrow(String key)

User-defined labels.

`map<string, string> labels = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getName()

    public abstract String 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>

`string name = 1 [(.google.api.field_behavior) = IMMUTABLE];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The name. |

### getNameBytes()

    public abstract ByteString getNameBytes()

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>

`string name = 1 [(.google.api.field_behavior) = IMMUTABLE];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for name. |

### getNetwork()

    public abstract String getNetwork()

The resource path of the consumer network.
Example:

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

`string network = 6 [(.google.api.resource_reference) = { ... }`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The network. |

### getNetworkBytes()

    public abstract ByteString getNetworkBytes()

The resource path of the consumer network.
Example:

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

`string network = 6 [(.google.api.resource_reference) = { ... }`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for network. |

### getPscConfig()

    public abstract ServiceConnectionPolicy.PscConfig getPscConfig()

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

`.google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig psc_config = 9;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-networkconnectivity/latest/com.google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig` | The pscConfig. |

### getPscConfigOrBuilder()

    public abstract ServiceConnectionPolicy.PscConfigOrBuilder getPscConfigOrBuilder()

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

`.google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig psc_config = 9;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-networkconnectivity/latest/com.google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfigOrBuilder` |   |

### getPscConnections(int index)

    public abstract ServiceConnectionPolicy.PscConnection getPscConnections(int index)

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

`
repeated .google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection psc_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-networkconnectivity/latest/com.google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection` |   |

### getPscConnectionsCount()

    public abstract int getPscConnectionsCount()

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

`
repeated .google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection psc_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getPscConnectionsList()

    public abstract List<ServiceConnectionPolicy.PscConnection> getPscConnectionsList()

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

`
repeated .google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection psc_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-networkconnectivity/latest/com.google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection>` |   |

### getPscConnectionsOrBuilder(int index)

    public abstract ServiceConnectionPolicy.PscConnectionOrBuilder getPscConnectionsOrBuilder(int index)

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

`
repeated .google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection psc_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-networkconnectivity/latest/com.google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnectionOrBuilder` |   |

### getPscConnectionsOrBuilderList()

    public abstract List<? extends ServiceConnectionPolicy.PscConnectionOrBuilder> getPscConnectionsOrBuilderList()

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

`
repeated .google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection psc_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnectionOrBuilder>` |   |

### getServiceClass()

    public abstract String 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.

`string service_class = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The serviceClass. |

### getServiceClassBytes()

    public abstract ByteString getServiceClassBytes()

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.

`string service_class = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for serviceClass. |

### getUpdateTime()

    public abstract Timestamp getUpdateTime()

Output only. Time when the ServiceConnectionPolicy was updated.

`.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The updateTime. |

### getUpdateTimeOrBuilder()

    public abstract TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. Time when the ServiceConnectionPolicy was updated.

`.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### hasCreateTime()

    public abstract boolean hasCreateTime()

Output only. Time when the ServiceConnectionPolicy was created.

`.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the createTime field is set. |

### hasEtag()

    public abstract boolean hasEtag()

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.

`optional string etag = 11 [(.google.api.field_behavior) = OPTIONAL];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the etag field is set. |

### hasPscConfig()

    public abstract boolean hasPscConfig()

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

`.google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig psc_config = 9;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the pscConfig field is set. |

### hasUpdateTime()

    public abstract boolean hasUpdateTime()

Output only. Time when the ServiceConnectionPolicy was updated.

`.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the updateTime field is set. |