# Stackdriver Monitoring V3 Client - Class ServiceAgentAuthentication (2.2.2)

2.2.2 (latest) 2.2.1 2.1.2 2.0.1 1.12.1 1.11.1 1.10.3 1.9.0 1.8.0 1.7.1 1.6.0 1.5.1 1.4.0 1.3.2 1.2.2 Reference documentation and code samples for the Stackdriver Monitoring V3 Client class ServiceAgentAuthentication.

Contains information needed for generating either an
[OpenID Connect
token](https://developers.google.com/identity/protocols/OpenIDConnect) or
[OAuth token](https://developers.google.com/identity/protocols/oauth2).

The token will be generated for the Monitoring service agent service
account.

Generated from protobuf message `google.monitoring.v3.UptimeCheckConfig.HttpCheck.ServiceAgentAuthentication`

## Namespace

Google \\ Cloud \\ Monitoring \\ V3 \\ UptimeCheckConfig \\ HttpCheck

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ type` | `int` Type of authentication. |

### getType

Type of authentication.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ServiceAgentAuthenticationType](https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.UptimeCheckConfig.HttpCheck.ServiceAgentAuthentication.ServiceAgentAuthenticationType). |

### setType

Type of authentication.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ServiceAgentAuthenticationType](https://docs.cloud.google.com/php/docs/reference/cloud-monitoring/latest/V3.UptimeCheckConfig.HttpCheck.ServiceAgentAuthentication.ServiceAgentAuthenticationType). |

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