getThumbnail method

Future<Thumbnail> getThumbnail(
  1. String presentationId,
  2. String pageObjectId, {
  3. String? thumbnailProperties_mimeType,
  4. String? thumbnailProperties_thumbnailSize,
  5. String? $fields,
})

Generates a thumbnail of the latest version of the specified page in the presentation and returns a URL to the thumbnail image.

This request counts as an [expensive read request](/slides/limits) for quota purposes.

Request parameters:

presentationId - The ID of the presentation to retrieve.

pageObjectId - The object ID of the page whose thumbnail to retrieve.

thumbnailProperties_mimeType - The optional mime type of the thumbnail image. If you don't specify the mime type, the mime type defaults to PNG. Possible string values are:

  • "PNG" : The default mime type.

thumbnailProperties_thumbnailSize - The optional thumbnail image size. If you don't specify the size, the server chooses a default size of the image. Possible string values are:

  • "THUMBNAIL_SIZE_UNSPECIFIED" : The default thumbnail image size. The unspecified thumbnail size implies that the server chooses the size of the image in a way that might vary in the future.
  • "LARGE" : The thumbnail image width of 1600px.
  • "MEDIUM" : The thumbnail image width of 800px.
  • "SMALL" : The thumbnail image width of 200px.

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

Completes with a Thumbnail.

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<Thumbnail> getThumbnail(
  core.String presentationId,
  core.String pageObjectId, {
  core.String? thumbnailProperties_mimeType,
  core.String? thumbnailProperties_thumbnailSize,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (thumbnailProperties_mimeType != null)
      'thumbnailProperties.mimeType': [thumbnailProperties_mimeType],
    if (thumbnailProperties_thumbnailSize != null)
      'thumbnailProperties.thumbnailSize': [
        thumbnailProperties_thumbnailSize
      ],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/presentations/' +
      commons.escapeVariable('$presentationId') +
      '/pages/' +
      commons.escapeVariable('$pageObjectId') +
      '/thumbnail';

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