# Interface ApiKeyConfigOrBuilder (0.9.0)

0.9.0 (latest) 0.7.0 0.4.0 0.3.0 0.1.0

    public interface ApiKeyConfigOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getApiKeySecretVersion()

    public abstract String getApiKeySecretVersion()

Required. The name of the SecretManager secret version resource storing the
API key. Format: `projects/{project}/secrets/{secret}/versions/{version}`

Note: You should grant `roles/secretmanager.secretAccessor` role to the CES
service agent
`service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com`.

`
string api_key_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The apiKeySecretVersion. |

### getApiKeySecretVersionBytes()

    public abstract ByteString getApiKeySecretVersionBytes()

Required. The name of the SecretManager secret version resource storing the
API key. Format: `projects/{project}/secrets/{secret}/versions/{version}`

Note: You should grant `roles/secretmanager.secretAccessor` role to the CES
service agent
`service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com`.

`
string api_key_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for apiKeySecretVersion. |

### getKeyName()

    public abstract String getKeyName()

Required. The parameter name or the header name of the API key.
E.g., If the API request is "[https://example.com/act?X-Api-Key=\<API](https://example.com/act?X-Api-Key=%3CAPI)
KEY\>", "X-Api-Key" would be the parameter name.

`string key_name = 1 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The keyName. |

### getKeyNameBytes()

    public abstract ByteString getKeyNameBytes()

Required. The parameter name or the header name of the API key.
E.g., If the API request is "[https://example.com/act?X-Api-Key=\<API](https://example.com/act?X-Api-Key=%3CAPI)
KEY\>", "X-Api-Key" would be the parameter name.

`string key_name = 1 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for keyName. |

### getRequestLocation()

    public abstract ApiKeyConfig.RequestLocation getRequestLocation()

Required. Key location in the request.

`
.google.cloud.ces.v1.ApiKeyConfig.RequestLocation request_location = 3 [(.google.api.field_behavior) = REQUIRED];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.ApiKeyConfig.RequestLocation` | The requestLocation. |

### getRequestLocationValue()

    public abstract int getRequestLocationValue()

Required. Key location in the request.

`
.google.cloud.ces.v1.ApiKeyConfig.RequestLocation request_location = 3 [(.google.api.field_behavior) = REQUIRED];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for requestLocation. |