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 ApiTarget.

A restriction for a specific service and optionally one or multiple
specific methods. Both fields are case insensitive.

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

## Namespace

Google \\ Cloud \\ ApiKeys \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ service` | `string` The service for this restriction. It should be the canonical service name, for example: `translate.googleapis.com`. You can use [`gcloud services list`](https://docs.cloud.google.com/sdk/gcloud/reference/services/list) to get a list of services that are enabled in the project. |
| `↳ methods` | `string[]` Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: `google.cloud.translate.v2.TranslateService.GetSupportedLanguage` `TranslateText` \`Get* `` `translate.googleapis.com.Get* `` |

### getService

The service for this restriction. It should be the canonical
service name, for example: `translate.googleapis.com`.

You can use [`gcloud services list`](https://docs.cloud.google.com/sdk/gcloud/reference/services/list)
to get a list of services that are enabled in the project.

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

### setService

The service for this restriction. It should be the canonical
service name, for example: `translate.googleapis.com`.

You can use [`gcloud services list`](https://docs.cloud.google.com/sdk/gcloud/reference/services/list)
to get a list of services that are enabled in the project.

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

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

### getMethods

Optional. List of one or more methods that can be called.

If empty, all methods for the service are allowed. A wildcard
(*) can be used as the last symbol.
Valid examples:
`google.cloud.translate.v2.TranslateService.GetSupportedLanguage`
`TranslateText`
\`Get* `` `translate.googleapis.com.Get* ``

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<string>` |   |

### setMethods

Optional. List of one or more methods that can be called.

If empty, all methods for the service are allowed. A wildcard
(*) can be used as the last symbol.
Valid examples:
`google.cloud.translate.v2.TranslateService.GetSupportedLanguage`
`TranslateText`
\`Get* `` `translate.googleapis.com.Get* ``

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

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