API Keys v2 API - Class ApiKeys.ApiKeysClient (1.2.0)

public class ApiKeys.ApiKeysClient : ClientBase<ApiKeys.ApiKeysClient>

Reference documentation and code samples for the API Keys v2 API class ApiKeys.ApiKeysClient.

Client for ApiKeys

Inheritance

object > ClientBase > ClientBaseApiKeysApiKeysClient > ApiKeys.ApiKeysClient

Namespace

Google.Cloud.ApiKeys.V2

Assembly

Google.Cloud.ApiKeys.V2.dll

Constructors

ApiKeysClient()

protected ApiKeysClient()

Protected parameterless constructor to allow creation of test doubles.

ApiKeysClient(CallInvoker)

public ApiKeysClient(CallInvoker callInvoker)

Creates a new client for ApiKeys that uses a custom CallInvoker.

Parameter
NameDescription
callInvokerCallInvoker

The callInvoker to use to make remote calls.

ApiKeysClient(ChannelBase)

public ApiKeysClient(ChannelBase channel)

Creates a new client for ApiKeys

Parameter
NameDescription
channelChannelBase

The channel to use to make remote calls.

ApiKeysClient(ClientBaseConfiguration)

protected ApiKeysClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration

The client configuration.

Methods

CreateKey(CreateKeyRequest, CallOptions)

public virtual Operation CreateKey(CreateKeyRequest request, CallOptions options)

Creates a new API key.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestCreateKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

CreateKey(CreateKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation CreateKey(CreateKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Creates a new API key.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestCreateKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

CreateKeyAsync(CreateKeyRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> CreateKeyAsync(CreateKeyRequest request, CallOptions options)

Creates a new API key.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestCreateKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

CreateKeyAsync(CreateKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> CreateKeyAsync(CreateKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Creates a new API key.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestCreateKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

CreateOperationsClient()

public virtual Operations.OperationsClient CreateOperationsClient()

Creates a new instance of Operations.OperationsClient using the same call invoker as this client.

Returns
TypeDescription
OperationsOperationsClient

A new Operations client for the same target as this client.

DeleteKey(DeleteKeyRequest, CallOptions)

public virtual Operation DeleteKey(DeleteKeyRequest request, CallOptions options)

Deletes an API key. Deleted key can be retrieved within 30 days of deletion. Afterward, key will be purged from the project.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestDeleteKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

DeleteKey(DeleteKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation DeleteKey(DeleteKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes an API key. Deleted key can be retrieved within 30 days of deletion. Afterward, key will be purged from the project.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestDeleteKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

DeleteKeyAsync(DeleteKeyRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> DeleteKeyAsync(DeleteKeyRequest request, CallOptions options)

Deletes an API key. Deleted key can be retrieved within 30 days of deletion. Afterward, key will be purged from the project.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestDeleteKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

DeleteKeyAsync(DeleteKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> DeleteKeyAsync(DeleteKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes an API key. Deleted key can be retrieved within 30 days of deletion. Afterward, key will be purged from the project.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestDeleteKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

GetKey(GetKeyRequest, CallOptions)

public virtual Key GetKey(GetKeyRequest request, CallOptions options)

Gets the metadata for an API key. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestGetKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Key

The response received from the server.

GetKey(GetKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual Key GetKey(GetKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets the metadata for an API key. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestGetKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Key

The response received from the server.

GetKeyAsync(GetKeyRequest, CallOptions)

public virtual AsyncUnaryCall<Key> GetKeyAsync(GetKeyRequest request, CallOptions options)

Gets the metadata for an API key. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestGetKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallKey

The call object.

GetKeyAsync(GetKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Key> GetKeyAsync(GetKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets the metadata for an API key. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestGetKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallKey

The call object.

GetKeyString(GetKeyStringRequest, CallOptions)

public virtual GetKeyStringResponse GetKeyString(GetKeyStringRequest request, CallOptions options)

Get the key string for an API key.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestGetKeyStringRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
GetKeyStringResponse

The response received from the server.

GetKeyString(GetKeyStringRequest, Metadata, DateTime?, CancellationToken)

public virtual GetKeyStringResponse GetKeyString(GetKeyStringRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Get the key string for an API key.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestGetKeyStringRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
GetKeyStringResponse

The response received from the server.

GetKeyStringAsync(GetKeyStringRequest, CallOptions)

public virtual AsyncUnaryCall<GetKeyStringResponse> GetKeyStringAsync(GetKeyStringRequest request, CallOptions options)

Get the key string for an API key.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestGetKeyStringRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallGetKeyStringResponse

The call object.

GetKeyStringAsync(GetKeyStringRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<GetKeyStringResponse> GetKeyStringAsync(GetKeyStringRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Get the key string for an API key.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestGetKeyStringRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallGetKeyStringResponse

The call object.

ListKeys(ListKeysRequest, CallOptions)

public virtual ListKeysResponse ListKeys(ListKeysRequest request, CallOptions options)

Lists the API keys owned by a project. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestListKeysRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
ListKeysResponse

The response received from the server.

ListKeys(ListKeysRequest, Metadata, DateTime?, CancellationToken)

public virtual ListKeysResponse ListKeys(ListKeysRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists the API keys owned by a project. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestListKeysRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
ListKeysResponse

The response received from the server.

ListKeysAsync(ListKeysRequest, CallOptions)

public virtual AsyncUnaryCall<ListKeysResponse> ListKeysAsync(ListKeysRequest request, CallOptions options)

Lists the API keys owned by a project. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestListKeysRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallListKeysResponse

The call object.

ListKeysAsync(ListKeysRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListKeysResponse> ListKeysAsync(ListKeysRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists the API keys owned by a project. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestListKeysRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallListKeysResponse

The call object.

LookupKey(LookupKeyRequest, CallOptions)

public virtual LookupKeyResponse LookupKey(LookupKeyRequest request, CallOptions options)

Find the parent project and resource name of the API key that matches the key string in the request. If the API key has been purged, resource name will not be set. The service account must have the apikeys.keys.lookup permission on the parent project.

Parameters
NameDescription
requestLookupKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
LookupKeyResponse

The response received from the server.

LookupKey(LookupKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual LookupKeyResponse LookupKey(LookupKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Find the parent project and resource name of the API key that matches the key string in the request. If the API key has been purged, resource name will not be set. The service account must have the apikeys.keys.lookup permission on the parent project.

Parameters
NameDescription
requestLookupKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
LookupKeyResponse

The response received from the server.

LookupKeyAsync(LookupKeyRequest, CallOptions)

public virtual AsyncUnaryCall<LookupKeyResponse> LookupKeyAsync(LookupKeyRequest request, CallOptions options)

Find the parent project and resource name of the API key that matches the key string in the request. If the API key has been purged, resource name will not be set. The service account must have the apikeys.keys.lookup permission on the parent project.

Parameters
NameDescription
requestLookupKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallLookupKeyResponse

The call object.

LookupKeyAsync(LookupKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<LookupKeyResponse> LookupKeyAsync(LookupKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Find the parent project and resource name of the API key that matches the key string in the request. If the API key has been purged, resource name will not be set. The service account must have the apikeys.keys.lookup permission on the parent project.

Parameters
NameDescription
requestLookupKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallLookupKeyResponse

The call object.

NewInstance(ClientBaseConfiguration)

protected override ApiKeys.ApiKeysClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration
Returns
TypeDescription
ApiKeysApiKeysClient
Overrides

UndeleteKey(UndeleteKeyRequest, CallOptions)

public virtual Operation UndeleteKey(UndeleteKeyRequest request, CallOptions options)

Undeletes an API key which was deleted within 30 days.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestUndeleteKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

UndeleteKey(UndeleteKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation UndeleteKey(UndeleteKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Undeletes an API key which was deleted within 30 days.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestUndeleteKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

UndeleteKeyAsync(UndeleteKeyRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> UndeleteKeyAsync(UndeleteKeyRequest request, CallOptions options)

Undeletes an API key which was deleted within 30 days.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestUndeleteKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

UndeleteKeyAsync(UndeleteKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> UndeleteKeyAsync(UndeleteKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Undeletes an API key which was deleted within 30 days.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestUndeleteKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

UpdateKey(UpdateKeyRequest, CallOptions)

public virtual Operation UpdateKey(UpdateKeyRequest request, CallOptions options)

Patches the modifiable fields of an API key. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestUpdateKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

UpdateKey(UpdateKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation UpdateKey(UpdateKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Patches the modifiable fields of an API key. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestUpdateKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

UpdateKeyAsync(UpdateKeyRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> UpdateKeyAsync(UpdateKeyRequest request, CallOptions options)

Patches the modifiable fields of an API key. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestUpdateKeyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

UpdateKeyAsync(UpdateKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> UpdateKeyAsync(UpdateKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Patches the modifiable fields of an API key. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
requestUpdateKeyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.