rotateAppSigningKey method

Future<RotateAppSigningKeyResponse> rotateAppSigningKey(
  1. RotateAppSigningKeyRequest request,
  2. String name, {
  3. String? $fields,
})

Rotates an app's signing key to a new self-hosted Google Cloud KMS key.

Warning: This method only applies to apps enrolled with self-hosted Cloud KMS keys. For apps using standard Google-managed Play App Signing, key rotation requests must be initiated through the Google Play Console UI. See Help Center: https://support.google.com/googleplay/android-developer/answer/9842756

request - The metadata request object.

Request parameters:

name - Required. Either package name or app ID of the app rotating the signing key.

$fields - Selector specifying which fields to include in a partial response.

Completes with a RotateAppSigningKeyResponse.

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<RotateAppSigningKeyResponse> rotateAppSigningKey(
  RotateAppSigningKeyRequest request,
  core.String name, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ =
      'androidpublisher/v3/applications/' +
      commons.escapeVariable('$name') +
      '/appSigning:rotateAppSigningKey';

  final response_ = await _requester.request(
    url_,
    'POST',
    body: body_,
    queryParams: queryParams_,
  );
  return RotateAppSigningKeyResponse.fromJson(
    response_ as core.Map<core.String, core.dynamic>,
  );
}