Manages the API keys associated with projects.
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
ApiKeysClient(ApiKeysClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ApiKeysClient const &
|
ApiKeysClient(ApiKeysClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ApiKeysClient &&
|
ApiKeysClient(std::shared_ptr< ApiKeysConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< ApiKeysConnection >
|
opts |
Options
|
Operators
operator=(ApiKeysClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ApiKeysClient const &
|
Returns | |
---|---|
Type | Description |
ApiKeysClient & |
operator=(ApiKeysClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ApiKeysClient &&
|
Returns | |
---|---|
Type | Description |
ApiKeysClient & |
Functions
CreateKey(std::string const &, google::api::apikeys::v2::Key const &, std::string const &, Options)
Creates a new API key.
NOTE: Key is a global resource; hence the only supported value for location is global
.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The project in which the API key is created. |
key |
google::api::apikeys::v2::Key const &
Required. The API key fields to set at creation time. You can configure only the |
key_id |
std::string const &
User specified key id (optional). If specified, it will become the final component of the key resource name. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::api::apikeys::v2::Key > > |
A |
CreateKey(ExperimentalTag, NoAwaitTag, std::string const &, google::api::apikeys::v2::Key const &, std::string const &, Options)
Creates a new API key.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
ExperimentalTag
|
|
NoAwaitTag
|
parent |
std::string const &
|
key |
google::api::apikeys::v2::Key const &
|
key_id |
std::string const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
CreateKey(google::api::apikeys::v2::CreateKeyRequest const &, 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 |
google::api::apikeys::v2::CreateKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::api::apikeys::v2::Key > > |
A |
CreateKey(ExperimentalTag, NoAwaitTag, google::api::apikeys::v2::CreateKeyRequest const &, Options)
Creates a new API key.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
ExperimentalTag
|
|
NoAwaitTag
|
request |
google::api::apikeys::v2::CreateKeyRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
CreateKey(ExperimentalTag, google::longrunning::Operation const &, Options)
Creates a new API key.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::api::apikeys::v2::Key > > |
ListKeys(std::string const &, 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 |
parent |
std::string const &
Required. Lists all API keys associated with this project. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::api::apikeys::v2::Key > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListKeys(google::api::apikeys::v2::ListKeysRequest, 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 |
google::api::apikeys::v2::ListKeysRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::api::apikeys::v2::Key > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetKey(std::string const &, 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 |
name |
std::string const &
Required. The resource name of the API key to get. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::apikeys::v2::Key > |
the result of the RPC. The response message type (google.api.apikeys.v2.Key) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetKey(google::api::apikeys::v2::GetKeyRequest const &, 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 |
google::api::apikeys::v2::GetKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::apikeys::v2::Key > |
the result of the RPC. The response message type (google.api.apikeys.v2.Key) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetKeyString(std::string const &, 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 |
name |
std::string const &
Required. The resource name of the API key to be retrieved. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::apikeys::v2::GetKeyStringResponse > |
the result of the RPC. The response message type (google.api.apikeys.v2.GetKeyStringResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetKeyString(google::api::apikeys::v2::GetKeyStringRequest const &, 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 |
google::api::apikeys::v2::GetKeyStringRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::apikeys::v2::GetKeyStringResponse > |
the result of the RPC. The response message type (google.api.apikeys.v2.GetKeyStringResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateKey(google::api::apikeys::v2::Key const &, google::protobuf::FieldMask const &, 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 |
key |
google::api::apikeys::v2::Key const &
Required. Set the |
update_mask |
google::protobuf::FieldMask const &
The field mask specifies which fields to be updated as part of this request. All other fields are ignored. Mutable fields are: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::api::apikeys::v2::Key > > |
A |
UpdateKey(ExperimentalTag, NoAwaitTag, google::api::apikeys::v2::Key const &, google::protobuf::FieldMask const &, Options)
Patches the modifiable fields of an API key.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
ExperimentalTag
|
|
NoAwaitTag
|
key |
google::api::apikeys::v2::Key const &
|
update_mask |
google::protobuf::FieldMask const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
UpdateKey(google::api::apikeys::v2::UpdateKeyRequest const &, 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 |
google::api::apikeys::v2::UpdateKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::api::apikeys::v2::Key > > |
A |
UpdateKey(ExperimentalTag, NoAwaitTag, google::api::apikeys::v2::UpdateKeyRequest const &, Options)
Patches the modifiable fields of an API key.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
ExperimentalTag
|
|
NoAwaitTag
|
request |
google::api::apikeys::v2::UpdateKeyRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
UpdateKey(ExperimentalTag, google::longrunning::Operation const &, Options)
Patches the modifiable fields of an API key.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::api::apikeys::v2::Key > > |
DeleteKey(std::string const &, 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 |
name |
std::string const &
Required. The resource name of the API key to be deleted. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::api::apikeys::v2::Key > > |
A |
DeleteKey(ExperimentalTag, NoAwaitTag, std::string const &, Options)
Deletes an API key.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
ExperimentalTag
|
|
NoAwaitTag
|
name |
std::string const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
DeleteKey(google::api::apikeys::v2::DeleteKeyRequest const &, 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 |
google::api::apikeys::v2::DeleteKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::api::apikeys::v2::Key > > |
A |
DeleteKey(ExperimentalTag, NoAwaitTag, google::api::apikeys::v2::DeleteKeyRequest const &, Options)
Deletes an API key.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
ExperimentalTag
|
|
NoAwaitTag
|
request |
google::api::apikeys::v2::DeleteKeyRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
DeleteKey(ExperimentalTag, google::longrunning::Operation const &, Options)
Deletes an API key.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::api::apikeys::v2::Key > > |
UndeleteKey(google::api::apikeys::v2::UndeleteKeyRequest const &, 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 |
google::api::apikeys::v2::UndeleteKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::api::apikeys::v2::Key > > |
A |
UndeleteKey(ExperimentalTag, NoAwaitTag, google::api::apikeys::v2::UndeleteKeyRequest const &, Options)
Undeletes an API key which was deleted within 30 days.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
ExperimentalTag
|
|
NoAwaitTag
|
request |
google::api::apikeys::v2::UndeleteKeyRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
UndeleteKey(ExperimentalTag, google::longrunning::Operation const &, Options)
Undeletes an API key which was deleted within 30 days.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::api::apikeys::v2::Key > > |
LookupKey(google::api::apikeys::v2::LookupKeyRequest const &, 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 |
google::api::apikeys::v2::LookupKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::apikeys::v2::LookupKeyResponse > |
the result of the RPC. The response message type (google.api.apikeys.v2.LookupKeyResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |