patch method

Future<CseIdentity> patch(
  1. CseIdentity request,
  2. String userId,
  3. String emailAddress, {
  4. String? $fields,
})

Associates a different key pair with an existing client-side encryption identity.

The updated key pair must validate against Google's S/MIME certificate profiles.

request - The metadata request object.

Request parameters:

userId - The requester's primary email address. To indicate the authenticated user, you can use the special value me.

emailAddress - The email address of the client-side encryption identity to update.

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

Completes with a CseIdentity.

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<CseIdentity> patch(
  CseIdentity request,
  core.String userId,
  core.String emailAddress, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'gmail/v1/users/' +
      commons.escapeVariable('$userId') +
      '/settings/cse/identities/' +
      commons.escapeVariable('$emailAddress');

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