API Keys v2 API - Class ApiKeys.ApiKeysClient (1.3.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
Name Description
callInvoker CallInvoker

The callInvoker to use to make remote calls.

ApiKeysClient(ChannelBase)

public ApiKeysClient(ChannelBase channel)

Creates a new client for ApiKeys

Parameter
Name Description
channel ChannelBase

The channel to use to make remote calls.

ApiKeysClient(ClientBaseConfiguration)

protected ApiKeysClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration

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
Name Description
request CreateKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request CreateKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request CreateKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request CreateKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Type Description
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
Name Description
request DeleteKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request DeleteKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request DeleteKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request DeleteKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request GetKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request GetKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request GetKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request GetKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request GetKeyStringRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request GetKeyStringRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request GetKeyStringRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request GetKeyStringRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request ListKeysRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request ListKeysRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request ListKeysRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request ListKeysRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request LookupKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request LookupKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request LookupKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request LookupKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallLookupKeyResponse

The call object.

NewInstance(ClientBaseConfiguration)

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

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration
Returns
Type Description
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
Name Description
request UndeleteKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request UndeleteKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request UndeleteKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request UndeleteKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request UpdateKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request UpdateKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request UpdateKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request UpdateKeyRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.