generateKeyPairOrUpdateDeveloperAppStatus method
- GoogleCloudApigeeV1DeveloperApp request,
- String name, {
- String? action,
- String? $fields,
Manages access to a developer app by enabling you to: * Approve or revoke
a developer app * Generate a new consumer key and secret for a developer
app To approve or revoke a developer app, set the action
query parameter
to approve
or revoke
, respectively, and the Content-Type
header to
application/octet-stream
.
If a developer app is revoked, none of its API keys are valid for API
calls even though the keys are still approved. If successful, the API call
returns the following HTTP status code: 204 No Content
To generate a new
consumer key and secret for a developer app, pass the new key/secret
details. Rather than replace an existing key, this API generates a new
key. In this case, multiple key pairs may be associated with a single
developer app. Each key pair has an independent status (approve
or
revoke
) and expiration time. Any approved, non-expired key can be used
in an API call. For example, if you're using API key rotation, you can
generate new keys with expiration times that overlap keys that are going
to expire. You might also generate a new consumer key/secret if the
security of the original key/secret is compromised. The keyExpiresIn
property defines the expiration time for the API key in milliseconds. If
you don't set this property or set it to -1
, the API key never expires.
Notes: * When generating a new key/secret, this API replaces the
existing attributes, notes, and callback URLs with those specified in the
request. Include or exclude any existing information that you want to
retain or delete, respectively. * To migrate existing consumer keys and
secrets to hybrid from another system, see the CreateDeveloperAppKey API.
request
- The metadata request object.
Request parameters:
name
- Required. Name of the developer app. Use the following structure
in your request:
organizations/{org}/developers/{developer_email}/apps/{app}
Value must have pattern
^organizations/\[^/\]+/developers/\[^/\]+/apps/\[^/\]+$
.
action
- Action. Valid values are approve
or revoke
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudApigeeV1DeveloperApp.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<GoogleCloudApigeeV1DeveloperApp>
generateKeyPairOrUpdateDeveloperAppStatus(
GoogleCloudApigeeV1DeveloperApp request,
core.String name, {
core.String? action,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (action != null) 'action': [action],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleCloudApigeeV1DeveloperApp.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}