| 1 | // |
| 2 | // AUTO-GENERATED FILE, DO NOT MODIFY! |
| 3 | // |
| 4 | |
| 5 | import 'dart:async'; |
| 6 | |
| 7 | import 'package:built_value/json_object.dart'; |
| 8 | import 'package:built_value/serializer.dart'; |
| 9 | import 'package:dio/dio.dart'; |
| 10 | |
| 11 | import 'package:openapi/src/model/generic_error_entity.dart'; |
| 12 | import 'package:openapi/src/model/profile_stats_response_entity.dart'; |
| 13 | |
| 14 | class ProfileApi { |
| 15 | |
| 16 | final Dio _dio; |
| 17 | |
| 18 | final Serializers _serializers; |
| 19 | |
| 20 | const ProfileApi(this |
| 21 | |
| 22 | /// Get profile stats |
| 23 | /// Returns comprehensive statistics about tracked flights including passport data, aircraft stats, airlines, airports, and routes |
| 24 | /// |
| 25 | /// Parameters: |
| 26 | /// * [cancelToken] - A [CancelToken] |
| 27 | /// * [headers] - Can be used to add additional headers to the request |
| 28 | /// * [extras] - Can be used to add flags to the request |
| 29 | /// * [validateStatus] - A [ValidateStatus] |
| 30 | /// * [onSendProgress] - A [ProgressCallback] |
| 31 | /// * [onReceiveProgress] - A [ProgressCallback] |
| 32 | /// |
| 33 | /// Returns a [Future] containing a [Response] |
| 34 | /// Throws [DioException] if API call or serialization fails |
| 35 | Future<Response<ProfileStatsResponseEntity |
| 36 | CancelToken? cancelToken, |
| 37 | Map<String, dynamic |
| 38 | Map<String, dynamic |
| 39 | ValidateStatus? validateStatus, |
| 40 | ProgressCallback? onSendProgress, |
| 41 | ProgressCallback? onReceiveProgress, |
| 42 | }) async { |
| 43 | final _path = r'/v1/profile/@me'; |
| 44 | final _options = Options( |
| 45 | method: r'GET', |
| 46 | headers: <String, dynamic |
| 47 | ...?headers, |
| 48 | }, |
| 49 | extra: <String, dynamic |
| 50 | 'secure': <Map<String |
| 51 | { |
| 52 | 'type': 'http', |
| 53 | 'scheme': 'bearer', |
| 54 | 'name': 'JWT-auth', |
| 55 | }, |
| 56 | ], |
| 57 | ...?extra, |
| 58 | }, |
| 59 | validateStatus: validateStatus, |
| 60 | ); |
| 61 | |
| 62 | final _response = await _dio. |
| 63 | _path, |
| 64 | options: _options, |
| 65 | cancelToken: cancelToken, |
| 66 | onSendProgress: onSendProgress, |
| 67 | onReceiveProgress: onReceiveProgress, |
| 68 | ); |
| 69 | |
| 70 | ProfileStatsResponseEntity? _responseData; |
| 71 | |
| 72 | try { |
| 73 | final rawResponse = _response.data; |
| 74 | _responseData = rawResponse == null ? null |
| 75 | rawResponse, |
| 76 | specifiedType: const FullType( |
| 77 | ) as ProfileStatsResponseEntity; |
| 78 | |
| 79 | } catch (error, stackTrace) { |
| 80 | throw DioException( |
| 81 | requestOptions: _response.requestOptions, |
| 82 | response: _response, |
| 83 | type: DioExceptionType.unknown, |
| 84 | error: error, |
| 85 | stackTrace: stackTrace, |
| 86 | ); |
| 87 | } |
| 88 | |
| 89 | return Response<ProfileStatsResponseEntity |
| 90 | data: _responseData, |
| 91 | headers: _response.headers, |
| 92 | isRedirect: _response.isRedirect, |
| 93 | requestOptions: _response.requestOptions, |
| 94 | redirects: _response.redirects, |
| 95 | statusCode: _response.statusCode, |
| 96 | statusMessage: _response.statusMessage, |
| 97 | extra: _response.extra, |
| 98 | ); |
| 99 | } |
| 100 | |
| 101 | } |