// GENERATED CODE - DO NOT MODIFY BY HAND part of 'settings_service.dart'; // ************************************************************************** // RetrofitGenerator // ************************************************************************** // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations class _SettingsService implements SettingsService { _SettingsService(this._dio, {this.baseUrl, this.errorLogger}); final Dio _dio; String? baseUrl; final ParseErrorLogger? errorLogger; @override Future getProfileSettings() async { final _extra = {}; final queryParameters = {}; final _headers = {}; const Map? _data = null; final _options = _setStreamType( Options(method: 'GET', headers: _headers, extra: _extra) .compose( _dio.options, '/api/profile/settings', queryParameters: queryParameters, data: _data, ) .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), ); final _result = await _dio.fetch>(_options); late ProfileSettingsModel _value; try { _value = ProfileSettingsModel.fromJson(_result.data!); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; } return _value; } @override Future updateProfileSettings({ required Map data, }) async { final _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(data); final _options = _setStreamType( Options(method: 'PUT', headers: _headers, extra: _extra) .compose( _dio.options, '/api/profile/settings/update', queryParameters: queryParameters, data: _data, ) .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), ); final _result = await _dio.fetch>(_options); late ProfileSettingsModel _value; try { _value = ProfileSettingsModel.fromJson(_result.data!); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; } return _value; } @override Future updateProfileDetails({ required Map data, }) async { final _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(data); final _options = _setStreamType( Options(method: 'PUT', headers: _headers, extra: _extra) .compose( _dio.options, '/api/profile/update', queryParameters: queryParameters, data: _data, ) .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), ); final _result = await _dio.fetch>(_options); late ProfileDetailsModel _value; try { _value = ProfileDetailsModel.fromJson(_result.data!); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; } return _value; } RequestOptions _setStreamType(RequestOptions requestOptions) { if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { requestOptions.responseType = ResponseType.json; } } return requestOptions; } String _combineBaseUrls(String dioBaseUrl, String? baseUrl) { if (baseUrl == null || baseUrl.trim().isEmpty) { return dioBaseUrl; } final url = Uri.parse(baseUrl); if (url.isAbsolute) { return url.toString(); } return Uri.parse(dioBaseUrl).resolveUri(url).toString(); } }