# Google Cloud Recaptcha Enterprise V1 Client - Class TokenProperties (2.3.1)

2.3.1 (latest) 2.3.0 2.2.1 2.1.3 2.0.1 1.17.2 1.16.1 1.15.0 1.14.0 1.13.0 1.12.2 1.8.0 1.7.0 1.6.0 1.5.2 1.4.2 1.3.2 1.2.6 Reference documentation and code samples for the Google Cloud Recaptcha Enterprise V1 Client class TokenProperties.

Properties of the provided event token.

Generated from protobuf message `google.cloud.recaptchaenterprise.v1.TokenProperties`

## Namespace

Google \\ Cloud \\ RecaptchaEnterprise \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ valid` | `bool` Output only. Whether the provided user response token is valid. When valid = false, the reason could be specified in invalid_reason or it could also be due to a user failing to solve a challenge or a sitekey mismatch (i.e the sitekey used to generate the token was different than the one specified in the assessment). |
| `↳ invalid_reason` | `int` Output only. Reason associated with the response when valid = false. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The timestamp corresponding to the generation of the token. |
| `↳ hostname` | `string` Output only. The hostname of the page on which the token was generated (Web keys only). |
| `↳ android_package_name` | `string` Output only. The name of the Android package with which the token was generated (Android keys only). |
| `↳ ios_bundle_id` | `string` Output only. The ID of the iOS bundle with which the token was generated (iOS keys only). |
| `↳ action` | `string` Output only. Action name provided at token generation. |

### getValid

Output only. Whether the provided user response token is valid. When valid
= false, the reason could be specified in invalid_reason or it could also
be due to a user failing to solve a challenge or a sitekey mismatch (i.e
the sitekey used to generate the token was different than the one specified
in the assessment).

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

### setValid

Output only. Whether the provided user response token is valid. When valid
= false, the reason could be specified in invalid_reason or it could also
be due to a user failing to solve a challenge or a sitekey mismatch (i.e
the sitekey used to generate the token was different than the one specified
in the assessment).

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

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

### getInvalidReason

Output only. Reason associated with the response when valid = false.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [InvalidReason](https://docs.cloud.google.com/php/docs/reference/cloud-recaptcha-enterprise/latest/V1.TokenProperties.InvalidReason). |

### setInvalidReason

Output only. Reason associated with the response when valid = false.

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

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

### getCreateTime

Output only. The timestamp corresponding to the generation of the token.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The timestamp corresponding to the generation of the token.

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

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

### getHostname

Output only. The hostname of the page on which the token was generated (Web
keys only).

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

### setHostname

Output only. The hostname of the page on which the token was generated (Web
keys only).

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

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

### getAndroidPackageName

Output only. The name of the Android package with which the token was
generated (Android keys only).

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

### setAndroidPackageName

Output only. The name of the Android package with which the token was
generated (Android keys only).

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

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

### getIosBundleId

Output only. The ID of the iOS bundle with which the token was generated
(iOS keys only).

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

### setIosBundleId

Output only. The ID of the iOS bundle with which the token was generated
(iOS keys only).

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

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

### getAction

Output only. Action name provided at token generation.

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

### setAction

Output only. Action name provided at token generation.

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

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