$getMimeIconUrl_Request method

  1. @experimental
Request $getMimeIconUrl_Request({
  1. String? mime,
})

Get a preview by mime.

Returns a DynamiteRequest backing the getMimeIconUrl operation. Throws a DynamiteApiException if the API call does not return an expected status code.

Parameters:

  • mime Mime type. Defaults to "application/octet-stream".

Status codes:

  • 303: The mime icon url

See:

Implementation

@_i2.experimental
_i3.Request $getMimeIconUrl_Request({String? mime}) {
  final _parameters = <String, Object?>{};
  var __mime = _$jsonSerializers.serialize(mime, specifiedType: const FullType(String));
  __mime ??= 'application/octet-stream';
  _parameters['mime'] = __mime;

  final _path = _i6.UriTemplate('/index.php/core/mimeicon{?mime*}').expand(_parameters);
  final _uri = Uri.parse('${_rootClient.baseURL}$_path');
  final _request = _i3.Request('get', _uri);
  // coverage:ignore-start
  final authentication = _i4.IterableExtension(_rootClient.authentications)?.firstWhereOrNull(
    (auth) => switch (auth) {
      _i1.DynamiteHttpBearerAuthentication() || _i1.DynamiteHttpBasicAuthentication() => true,
      _ => false,
    },
  );

  if (authentication != null) {
    _request.headers.addAll(authentication.headers);
  }

  // coverage:ignore-end
  return _request;
}