0.16.0 (latest) 0.15.0 0.14.2 0.13.0 0.12.0 0.11.1 0.10.0 0.9.0 0.8.1 0.7.0 0.6.1 0.5.2 0.4.0 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the API Keys V2 API class Google::Cloud::ApiKeys::V2::Restrictions.

Describes the restrictions on the key.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #android_key_restrictions

    def android_key_restrictions() -> ::Google::Cloud::ApiKeys::V2::AndroidKeyRestrictions

**Returns**

- ([::Google::Cloud::ApiKeys::V2::AndroidKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-AndroidKeyRestrictions)) --- The Android apps that are allowed to use the key.


  Note: The following fields are mutually exclusive: `android_key_restrictions`, `browser_key_restrictions`, `server_key_restrictions`, `ios_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #android_key_restrictions=

    def android_key_restrictions=(value) -> ::Google::Cloud::ApiKeys::V2::AndroidKeyRestrictions

**Parameter**

- **value** ([::Google::Cloud::ApiKeys::V2::AndroidKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-AndroidKeyRestrictions)) --- The Android apps that are allowed to use the key.


  Note: The following fields are mutually exclusive: `android_key_restrictions`, `browser_key_restrictions`, `server_key_restrictions`, `ios_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::ApiKeys::V2::AndroidKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-AndroidKeyRestrictions)) --- The Android apps that are allowed to use the key.


  Note: The following fields are mutually exclusive: `android_key_restrictions`, `browser_key_restrictions`, `server_key_restrictions`, `ios_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #api_targets

    def api_targets() -> ::Array<::Google::Cloud::ApiKeys::V2::ApiTarget>

**Returns**

- (::Array\<[::Google::Cloud::ApiKeys::V2::ApiTarget](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-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.

### #api_targets=

    def api_targets=(value) -> ::Array<::Google::Cloud::ApiKeys::V2::ApiTarget>

**Parameter**

- **value** (::Array\<[::Google::Cloud::ApiKeys::V2::ApiTarget](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-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.
**Returns**

- (::Array\<[::Google::Cloud::ApiKeys::V2::ApiTarget](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-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.

### #browser_key_restrictions

    def browser_key_restrictions() -> ::Google::Cloud::ApiKeys::V2::BrowserKeyRestrictions

**Returns**

- ([::Google::Cloud::ApiKeys::V2::BrowserKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-BrowserKeyRestrictions)) --- The HTTP referrers (websites) that are allowed to use the key.


  Note: The following fields are mutually exclusive: `browser_key_restrictions`, `server_key_restrictions`, `android_key_restrictions`, `ios_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #browser_key_restrictions=

    def browser_key_restrictions=(value) -> ::Google::Cloud::ApiKeys::V2::BrowserKeyRestrictions

**Parameter**

- **value** ([::Google::Cloud::ApiKeys::V2::BrowserKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-BrowserKeyRestrictions)) --- The HTTP referrers (websites) that are allowed to use the key.


  Note: The following fields are mutually exclusive: `browser_key_restrictions`, `server_key_restrictions`, `android_key_restrictions`, `ios_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::ApiKeys::V2::BrowserKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-BrowserKeyRestrictions)) --- The HTTP referrers (websites) that are allowed to use the key.


  Note: The following fields are mutually exclusive: `browser_key_restrictions`, `server_key_restrictions`, `android_key_restrictions`, `ios_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #ios_key_restrictions

    def ios_key_restrictions() -> ::Google::Cloud::ApiKeys::V2::IosKeyRestrictions

**Returns**

- ([::Google::Cloud::ApiKeys::V2::IosKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-IosKeyRestrictions)) --- The iOS apps that are allowed to use the key.


  Note: The following fields are mutually exclusive: `ios_key_restrictions`, `browser_key_restrictions`, `server_key_restrictions`, `android_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #ios_key_restrictions=

    def ios_key_restrictions=(value) -> ::Google::Cloud::ApiKeys::V2::IosKeyRestrictions

**Parameter**

- **value** ([::Google::Cloud::ApiKeys::V2::IosKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-IosKeyRestrictions)) --- The iOS apps that are allowed to use the key.


  Note: The following fields are mutually exclusive: `ios_key_restrictions`, `browser_key_restrictions`, `server_key_restrictions`, `android_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::ApiKeys::V2::IosKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-IosKeyRestrictions)) --- The iOS apps that are allowed to use the key.


  Note: The following fields are mutually exclusive: `ios_key_restrictions`, `browser_key_restrictions`, `server_key_restrictions`, `android_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #server_key_restrictions

    def server_key_restrictions() -> ::Google::Cloud::ApiKeys::V2::ServerKeyRestrictions

**Returns**

- ([::Google::Cloud::ApiKeys::V2::ServerKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-ServerKeyRestrictions)) --- The IP addresses of callers that are allowed to use the key.


  Note: The following fields are mutually exclusive: `server_key_restrictions`, `browser_key_restrictions`, `android_key_restrictions`, `ios_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #server_key_restrictions=

    def server_key_restrictions=(value) -> ::Google::Cloud::ApiKeys::V2::ServerKeyRestrictions

**Parameter**

- **value** ([::Google::Cloud::ApiKeys::V2::ServerKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-ServerKeyRestrictions)) --- The IP addresses of callers that are allowed to use the key.


  Note: The following fields are mutually exclusive: `server_key_restrictions`, `browser_key_restrictions`, `android_key_restrictions`, `ios_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::ApiKeys::V2::ServerKeyRestrictions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_keys-v2/latest/Google-Cloud-ApiKeys-V2-ServerKeyRestrictions)) --- The IP addresses of callers that are allowed to use the key.


  Note: The following fields are mutually exclusive: `server_key_restrictions`, `browser_key_restrictions`, `android_key_restrictions`, `ios_key_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared.