# Google Cloud Recaptcha Enterprise V1 Client - Class WebKeySettings (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 WebKeySettings.

Settings specific to keys that can be used by websites.

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

## Namespace

Google \\ Cloud \\ RecaptchaEnterprise \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ allow_all_domains` | `bool` Optional. If set to true, it means allowed_domains are not enforced. |
| `↳ allowed_domains` | `string[]` Optional. Domains or subdomains of websites allowed to use the key. All subdomains of an allowed domain are automatically allowed. A valid domain requires a host and must not include any path, port, query or fragment. Examples: 'example.com' or 'subdomain.example.com' Each key supports a maximum of 250 domains. To use a key on more domains, set `allow_all_domains` to true. When this is set, you are responsible for validating the hostname by checking the `token_properties.hostname` field in each assessment response against your list of allowed domains. |
| `↳ allow_amp_traffic` | `bool` Optional. If set to true, the key can be used on AMP (Accelerated Mobile Pages) websites. This is supported only for the SCORE integration type. |
| `↳ integration_type` | `int` Required. Describes how this key is integrated with the website. |
| `↳ challenge_security_preference` | `int` Optional. Settings for the frequency and difficulty at which this key triggers captcha challenges. This should only be specified for `IntegrationType` CHECKBOX, INVISIBLE or POLICY_BASED_CHALLENGE. |
| `↳ challenge_settings` | `https://docs.cloud.google.com/php/docs/reference/cloud-recaptcha-enterprise/latest/V1.WebKeySettings.ChallengeSettings` Optional. Challenge settings. |

### getAllowAllDomains

Optional. If set to true, it means allowed_domains are not enforced.

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

### setAllowAllDomains

Optional. If set to true, it means allowed_domains are not enforced.

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

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

### getAllowedDomains

Optional. Domains or subdomains of websites allowed to use the key. All
subdomains of an allowed domain are automatically allowed. A valid domain
requires a host and must not include any path, port, query or fragment.

Examples: 'example.com' or 'subdomain.example.com'
Each key supports a maximum of 250 domains. To use a key on more domains,
set `allow_all_domains` to true. When this is set, you are responsible for
validating the hostname by checking the `token_properties.hostname` field
in each assessment response against your list of allowed domains.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setAllowedDomains

Optional. Domains or subdomains of websites allowed to use the key. All
subdomains of an allowed domain are automatically allowed. A valid domain
requires a host and must not include any path, port, query or fragment.

Examples: 'example.com' or 'subdomain.example.com'
Each key supports a maximum of 250 domains. To use a key on more domains,
set `allow_all_domains` to true. When this is set, you are responsible for
validating the hostname by checking the `token_properties.hostname` field
in each assessment response against your list of allowed domains.

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

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

### getAllowAmpTraffic

Optional. If set to true, the key can be used on AMP (Accelerated Mobile
Pages) websites. This is supported only for the SCORE integration type.

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

### setAllowAmpTraffic

Optional. If set to true, the key can be used on AMP (Accelerated Mobile
Pages) websites. This is supported only for the SCORE integration type.

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

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

### getIntegrationType

Required. Describes how this key is integrated with the website.

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

### setIntegrationType

Required. Describes how this key is integrated with the website.

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

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

### getChallengeSecurityPreference

Optional. Settings for the frequency and difficulty at which this key
triggers captcha challenges. This should only be specified for
`IntegrationType` CHECKBOX, INVISIBLE or POLICY_BASED_CHALLENGE.

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

### setChallengeSecurityPreference

Optional. Settings for the frequency and difficulty at which this key
triggers captcha challenges. This should only be specified for
`IntegrationType` CHECKBOX, INVISIBLE or POLICY_BASED_CHALLENGE.

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

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

### getChallengeSettings

Optional. Challenge settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-recaptcha-enterprise/latest/V1.WebKeySettings.ChallengeSettings|null` |   |

### hasChallengeSettings

### clearChallengeSettings

### setChallengeSettings

Optional. Challenge settings.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-recaptcha-enterprise/latest/V1.WebKeySettings.ChallengeSettings` |

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