$getMimeIconUrl_Request method
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:
mimeMime type. Defaults to"application/octet-stream".
Status codes:
- 303: The mime icon url
See:
- getMimeIconUrl for a method executing this request and parsing the response.
- $getMimeIconUrl_Serializer for a converter to parse the
Responsefrom an executed this request.
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;
}