# Stackdriver Error Reporting V1beta1 Client - Class ServiceContextFilter (0.26.1)

0.26.1 (latest) 0.26.0 0.25.3 0.24.0 0.23.1 0.22.10 0.21.1 0.20.2 0.19.12

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Stackdriver Error Reporting V1beta1 Client class ServiceContextFilter.

Specifies criteria for filtering a subset of service contexts.

The fields in the filter correspond to the fields in `ServiceContext`.
Only exact, case-sensitive matches are supported.
If a field is unset or empty, it matches arbitrary values.

Generated from protobuf message `google.devtools.clouderrorreporting.v1beta1.ServiceContextFilter`

## Namespace

Google \\ Cloud \\ ErrorReporting \\ V1beta1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ service` | `string` Optional. The exact value to match against [`ServiceContext.service`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). |
| `↳ version` | `string` Optional. The exact value to match against [`ServiceContext.version`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). |
| `↳ resource_type` | `string` Optional. The exact value to match against [`ServiceContext.resource_type`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). |

### getService

Optional. The exact value to match against
[`ServiceContext.service`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service).

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

### setService

Optional. The exact value to match against
[`ServiceContext.service`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service).

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

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

### getVersion

Optional. The exact value to match against
[`ServiceContext.version`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version).

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

### setVersion

Optional. The exact value to match against
[`ServiceContext.version`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version).

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

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

### getResourceType

Optional. The exact value to match against
[`ServiceContext.resource_type`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type).

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

### setResourceType

Optional. The exact value to match against
[`ServiceContext.resource_type`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type).

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

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