$getThemedIcon_Request method

  1. @experimental
Request $getThemedIcon_Request({
  1. required String app,
  2. required String image,
})

Get a themed icon.

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

Parameters:

  • app ID of the app.
  • image image file name (svg required).

Status codes:

  • 200: Themed icon returned
  • 404: Themed icon not found
  • 500

See:

Implementation

@_i2.experimental
_i3.Request $getThemedIcon_Request({
  required String app,
  required String image,
}) {
  final _parameters = <String, Object?>{};
  final $app = _$jsonSerializers.serialize(app, specifiedType: const FullType(String));
  _parameters['app'] = $app;

  final $image = _$jsonSerializers.serialize(image, specifiedType: const FullType(String));
  _i5.checkString(
    $image,
    'image',
    pattern: RegExp(r'^.+$'),
  );
  _parameters['image'] = $image;

  final _path = _i4.UriTemplate('/index.php/apps/theming/img/{app}/{image}').expand(_parameters);
  final _uri = Uri.parse('${_rootClient.baseURL}$_path');
  final _request = _i3.Request('get', _uri);
  _request.headers['Accept'] = 'image/svg+xml';
// coverage:ignore-start
  final authentication = _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;
}