1.2.3 (latest) 1.1.2 1.0.5 0.4.5 0.3.3 0.2.2 0.1.7 Reference documentation and code samples for the Google Cloud Api Keys V2 Client class Restrictions.

Describes the restrictions on the key.

Generated from protobuf message `google.api.apikeys.v2.Restrictions`

## Namespace

Google \\ Cloud \\ ApiKeys \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ browser_key_restrictions` | `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.BrowserKeyRestrictions` The HTTP referrers (websites) that are allowed to use the key. |
| `↳ server_key_restrictions` | `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.ServerKeyRestrictions` The IP addresses of callers that are allowed to use the key. |
| `↳ android_key_restrictions` | `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.AndroidKeyRestrictions` The Android apps that are allowed to use the key. |
| `↳ ios_key_restrictions` | `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.IosKeyRestrictions` The iOS apps that are allowed to use the key. |
| `↳ api_targets` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.ApiTarget>` A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed. |

### getBrowserKeyRestrictions

The HTTP referrers (websites) that are allowed to use the key.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.BrowserKeyRestrictions|null` |   |

### hasBrowserKeyRestrictions

### setBrowserKeyRestrictions

The HTTP referrers (websites) that are allowed to use the key.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.BrowserKeyRestrictions` |

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

### getServerKeyRestrictions

The IP addresses of callers that are allowed to use the key.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.ServerKeyRestrictions|null` |   |

### hasServerKeyRestrictions

### setServerKeyRestrictions

The IP addresses of callers that are allowed to use the key.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.ServerKeyRestrictions` |

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

### getAndroidKeyRestrictions

The Android apps that are allowed to use the key.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.AndroidKeyRestrictions|null` |   |

### hasAndroidKeyRestrictions

### setAndroidKeyRestrictions

The Android apps that are allowed to use the key.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.AndroidKeyRestrictions` |

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

### getIosKeyRestrictions

The iOS apps that are allowed to use the key.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.IosKeyRestrictions|null` |   |

### hasIosKeyRestrictions

### setIosKeyRestrictions

The iOS apps that are allowed to use the key.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.IosKeyRestrictions` |

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

### getApiTargets

A restriction for a specific service and optionally one or
more specific methods. Requests are allowed if they
match any of these restrictions. If no restrictions are
specified, all targets are allowed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.ApiTarget>` |   |

### setApiTargets

A restriction for a specific service and optionally one or
more specific methods. Requests are allowed if they
match any of these restrictions. If no restrictions are
specified, all targets are allowed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-api-keys/latest/V2.ApiTarget>` |

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

### getClientRestrictions

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