describeInputDeviceThumbnail method

Future<DescribeInputDeviceThumbnailResponse> describeInputDeviceThumbnail({
  1. required AcceptHeader accept,
  2. required String inputDeviceId,
})

Get the latest thumbnail data for the input device.

May throw BadRequestException. May throw InternalServerErrorException. May throw ForbiddenException. May throw BadGatewayException. May throw NotFoundException. May throw GatewayTimeoutException. May throw TooManyRequestsException.

Parameter accept : The HTTP Accept header. Indicates the requested type for the thumbnail.

Parameter inputDeviceId : The unique ID of this input device. For example, hd-123456789abcdef.

Implementation

Future<DescribeInputDeviceThumbnailResponse> describeInputDeviceThumbnail({
  required AcceptHeader accept,
  required String inputDeviceId,
}) async {
  ArgumentError.checkNotNull(accept, 'accept');
  ArgumentError.checkNotNull(inputDeviceId, 'inputDeviceId');
  final headers = <String, String>{
    'accept': accept.toValue(),
  };
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'GET',
    requestUri:
        '/prod/inputDevices/${Uri.encodeComponent(inputDeviceId)}/thumbnailData',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return DescribeInputDeviceThumbnailResponse(
    body: await response.stream.toBytes(),
    contentLength:
        _s.extractHeaderIntValue(response.headers, 'Content-Length'),
    contentType: _s
        .extractHeaderStringValue(response.headers, 'Content-Type')
        ?.toContentType(),
    eTag: _s.extractHeaderStringValue(response.headers, 'ETag'),
    lastModified:
        _s.extractHeaderDateTimeValue(response.headers, 'Last-Modified'),
  );
}