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

public class ApiKeysClient : ClientBase<ApiKeys.ApiKeysClient>

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

Client for ApiKeys

Inheritance

Object > ClientBase > ClientBase<ApiKeys.ApiKeysClient> > 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(ClientBase.ClientBaseConfiguration)

protected ApiKeysClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
NameDescription
configurationClientBase.ClientBaseConfiguration

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

The call object.

CreateKeyAsync(CreateKeyRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

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
Operations.OperationsClient

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

The call object.

DeleteKeyAsync(DeleteKeyRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Key>

The call object.

GetKeyAsync(GetKeyRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Key>

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<GetKeyStringResponse>

The call object.

GetKeyStringAsync(GetKeyStringRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<GetKeyStringResponse>

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<ListKeysResponse>

The call object.

ListKeysAsync(ListKeysRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<ListKeysResponse>

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<LookupKeyResponse>

The call object.

LookupKeyAsync(LookupKeyRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<LookupKeyResponse>

The call object.

NewInstance(ClientBase.ClientBaseConfiguration)

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

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
NameDescription
configurationClientBase.ClientBaseConfiguration
Returns
TypeDescription
ApiKeys.ApiKeysClient
Overrides
Grpc.Core.ClientBase<Google.Cloud.ApiKeys.V2.ApiKeys.ApiKeysClient>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

The call object.

UndeleteKeyAsync(UndeleteKeyRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

The call object.

UpdateKeyAsync(UpdateKeyRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

The call object.