deleteContactPhoto method

Future<DeleteContactPhotoResponse> deleteContactPhoto(
  1. String resourceName, {
  2. String? personFields,
  3. List<String>? sources,
  4. String? $fields,
})

Delete a contact's photo.

Mutate requests for the same user should be done sequentially to avoid // lock contention.

Request parameters:

resourceName - Required. The resource name of the contact whose photo will be deleted. Value must have pattern ^people/\[^/\]+$.

personFields - Optional. A field mask to restrict which fields on the person are returned. Multiple fields can be specified by separating them with commas. Defaults to empty if not set, which will skip the post mutate get. Valid values are: * addresses * ageRanges * biographies * birthdays * calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills

  • urls * userDefined

sources - Optional. A mask of what source types to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.

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

Completes with a DeleteContactPhotoResponse.

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<DeleteContactPhotoResponse> deleteContactPhoto(
  core.String resourceName, {
  core.String? personFields,
  core.List<core.String>? sources,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (personFields != null) 'personFields': [personFields],
    if (sources != null) 'sources': sources,
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'v1/' + core.Uri.encodeFull('$resourceName') + ':deleteContactPhoto';

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