search_api.dart 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. //
  2. // AUTO-GENERATED FILE, DO NOT MODIFY!
  3. //
  4. // @dart=2.12
  5. // ignore_for_file: unused_element, unused_import
  6. // ignore_for_file: always_put_required_named_parameters_first
  7. // ignore_for_file: constant_identifier_names
  8. // ignore_for_file: lines_longer_than_80_chars
  9. part of openapi.api;
  10. class SearchApi {
  11. SearchApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. ///
  14. ///
  15. /// Note: This method returns the HTTP [Response].
  16. Future<Response> getSearchConfigWithHttpInfo() async {
  17. // ignore: prefer_const_declarations
  18. final path = r'/search/config';
  19. // ignore: prefer_final_locals
  20. Object? postBody;
  21. final queryParams = <QueryParam>[];
  22. final headerParams = <String, String>{};
  23. final formParams = <String, String>{};
  24. const contentTypes = <String>[];
  25. return apiClient.invokeAPI(
  26. path,
  27. 'GET',
  28. queryParams,
  29. postBody,
  30. headerParams,
  31. formParams,
  32. contentTypes.isEmpty ? null : contentTypes.first,
  33. );
  34. }
  35. ///
  36. Future<SearchConfigResponseDto?> getSearchConfig() async {
  37. final response = await getSearchConfigWithHttpInfo();
  38. if (response.statusCode >= HttpStatus.badRequest) {
  39. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  40. }
  41. // When a remote server returns no body with a status of 204, we shall not decode it.
  42. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  43. // FormatException when trying to decode an empty string.
  44. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  45. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SearchConfigResponseDto',) as SearchConfigResponseDto;
  46. }
  47. return null;
  48. }
  49. ///
  50. ///
  51. /// Note: This method returns the HTTP [Response].
  52. ///
  53. /// Parameters:
  54. ///
  55. /// * [String] query:
  56. ///
  57. /// * [String] type:
  58. ///
  59. /// * [bool] isFavorite:
  60. ///
  61. /// * [String] exifInfoPeriodCity:
  62. ///
  63. /// * [String] exifInfoPeriodState:
  64. ///
  65. /// * [String] exifInfoPeriodCountry:
  66. ///
  67. /// * [String] exifInfoPeriodMake:
  68. ///
  69. /// * [String] exifInfoPeriodModel:
  70. ///
  71. /// * [List<String>] smartInfoPeriodObjects:
  72. ///
  73. /// * [List<String>] smartInfoPeriodTags:
  74. Future<Response> searchWithHttpInfo({ String? query, String? type, bool? isFavorite, String? exifInfoPeriodCity, String? exifInfoPeriodState, String? exifInfoPeriodCountry, String? exifInfoPeriodMake, String? exifInfoPeriodModel, List<String>? smartInfoPeriodObjects, List<String>? smartInfoPeriodTags, }) async {
  75. // ignore: prefer_const_declarations
  76. final path = r'/search';
  77. // ignore: prefer_final_locals
  78. Object? postBody;
  79. final queryParams = <QueryParam>[];
  80. final headerParams = <String, String>{};
  81. final formParams = <String, String>{};
  82. if (query != null) {
  83. queryParams.addAll(_queryParams('', 'query', query));
  84. }
  85. if (type != null) {
  86. queryParams.addAll(_queryParams('', 'type', type));
  87. }
  88. if (isFavorite != null) {
  89. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  90. }
  91. if (exifInfoPeriodCity != null) {
  92. queryParams.addAll(_queryParams('', 'exifInfo.city', exifInfoPeriodCity));
  93. }
  94. if (exifInfoPeriodState != null) {
  95. queryParams.addAll(_queryParams('', 'exifInfo.state', exifInfoPeriodState));
  96. }
  97. if (exifInfoPeriodCountry != null) {
  98. queryParams.addAll(_queryParams('', 'exifInfo.country', exifInfoPeriodCountry));
  99. }
  100. if (exifInfoPeriodMake != null) {
  101. queryParams.addAll(_queryParams('', 'exifInfo.make', exifInfoPeriodMake));
  102. }
  103. if (exifInfoPeriodModel != null) {
  104. queryParams.addAll(_queryParams('', 'exifInfo.model', exifInfoPeriodModel));
  105. }
  106. if (smartInfoPeriodObjects != null) {
  107. queryParams.addAll(_queryParams('multi', 'smartInfo.objects', smartInfoPeriodObjects));
  108. }
  109. if (smartInfoPeriodTags != null) {
  110. queryParams.addAll(_queryParams('multi', 'smartInfo.tags', smartInfoPeriodTags));
  111. }
  112. const contentTypes = <String>[];
  113. return apiClient.invokeAPI(
  114. path,
  115. 'GET',
  116. queryParams,
  117. postBody,
  118. headerParams,
  119. formParams,
  120. contentTypes.isEmpty ? null : contentTypes.first,
  121. );
  122. }
  123. ///
  124. ///
  125. /// Parameters:
  126. ///
  127. /// * [String] query:
  128. ///
  129. /// * [String] type:
  130. ///
  131. /// * [bool] isFavorite:
  132. ///
  133. /// * [String] exifInfoPeriodCity:
  134. ///
  135. /// * [String] exifInfoPeriodState:
  136. ///
  137. /// * [String] exifInfoPeriodCountry:
  138. ///
  139. /// * [String] exifInfoPeriodMake:
  140. ///
  141. /// * [String] exifInfoPeriodModel:
  142. ///
  143. /// * [List<String>] smartInfoPeriodObjects:
  144. ///
  145. /// * [List<String>] smartInfoPeriodTags:
  146. Future<SearchResponseDto?> search({ String? query, String? type, bool? isFavorite, String? exifInfoPeriodCity, String? exifInfoPeriodState, String? exifInfoPeriodCountry, String? exifInfoPeriodMake, String? exifInfoPeriodModel, List<String>? smartInfoPeriodObjects, List<String>? smartInfoPeriodTags, }) async {
  147. final response = await searchWithHttpInfo( query: query, type: type, isFavorite: isFavorite, exifInfoPeriodCity: exifInfoPeriodCity, exifInfoPeriodState: exifInfoPeriodState, exifInfoPeriodCountry: exifInfoPeriodCountry, exifInfoPeriodMake: exifInfoPeriodMake, exifInfoPeriodModel: exifInfoPeriodModel, smartInfoPeriodObjects: smartInfoPeriodObjects, smartInfoPeriodTags: smartInfoPeriodTags, );
  148. if (response.statusCode >= HttpStatus.badRequest) {
  149. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  150. }
  151. // When a remote server returns no body with a status of 204, we shall not decode it.
  152. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  153. // FormatException when trying to decode an empty string.
  154. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  155. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SearchResponseDto',) as SearchResponseDto;
  156. }
  157. return null;
  158. }
  159. }