class ProjectsLocationsKeys extends Resource (View source)

The "keys" collection of methods.

Typical usage is:

 $apikeysService = new Google\Service\ApiKeysService(...);
 $keys = $apikeysService->projects_locations_keys;

Methods

create(string $parent, V2Key $postBody, array $optParams = [])

Creates a new API key. NOTE: Key is a global resource; hence the only supported value for location is global. (keys.create)

delete(string $name, array $optParams = [])

Deletes an API key. Deleted key can be retrieved within 30 days of deletion.

get(string $name, array $optParams = [])

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. (keys.get)

getKeyString(string $name, array $optParams = [])

Get the key string for an API key. NOTE: Key is a global resource; hence the only supported value for location is global. (keys.getKeyString)

listProjectsLocationsKeys(string $parent, array $optParams = [])

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. (keys.listProjectsLocationsKeys)

patch(string $name, V2Key $postBody, array $optParams = [])

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. (keys.patch)

undelete(string $name, V2UndeleteKeyRequest $postBody, array $optParams = [])

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.

Details

Operation create(string $parent, V2Key $postBody, array $optParams = [])

Creates a new API key. NOTE: Key is a global resource; hence the only supported value for location is global. (keys.create)

Parameters

string $parent

Required. The project in which the API key is created.

V2Key $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation delete(string $name, array $optParams = [])

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. (keys.delete)

Parameters

string $name

Required. The resource name of the API key to be deleted.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

V2Key get(string $name, array $optParams = [])

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. (keys.get)

Parameters

string $name

Required. The resource name of the API key to get.

array $optParams

Optional parameters.

Return Value

V2Key

Exceptions

Exception

V2GetKeyStringResponse getKeyString(string $name, array $optParams = [])

Get the key string for an API key. NOTE: Key is a global resource; hence the only supported value for location is global. (keys.getKeyString)

Parameters

string $name

Required. The resource name of the API key to be retrieved.

array $optParams

Optional parameters.

Return Value

V2GetKeyStringResponse

Exceptions

Exception

V2ListKeysResponse listProjectsLocationsKeys(string $parent, array $optParams = [])

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. (keys.listProjectsLocationsKeys)

Parameters

string $parent

Required. Lists all API keys associated with this project.

array $optParams

Optional parameters.

Return Value

V2ListKeysResponse

Exceptions

Exception

Operation patch(string $name, V2Key $postBody, array $optParams = [])

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. (keys.patch)

Parameters

string $name

Output only. The resource name of the key. The name has the form: projects//locations/global/keys/. For example: projects/12345686 7718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2 NOTE: Key is a global resource; hence the only supported value for location is global.

V2Key $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation undelete(string $name, V2UndeleteKeyRequest $postBody, array $optParams = [])

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.

(keys.undelete)

Parameters

string $name

Required. The resource name of the API key to be undeleted.

V2UndeleteKeyRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception