search_api.dart 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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> getExploreDataWithHttpInfo() async {
  17. // ignore: prefer_const_declarations
  18. final path = r'/search/explore';
  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<List<SearchExploreResponseDto>?> getExploreData() async {
  37. final response = await getExploreDataWithHttpInfo();
  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. final responseBody = await _decodeBodyBytes(response);
  46. return (await apiClient.deserializeAsync(responseBody, 'List<SearchExploreResponseDto>') as List)
  47. .cast<SearchExploreResponseDto>()
  48. .toList();
  49. }
  50. return null;
  51. }
  52. ///
  53. ///
  54. /// Note: This method returns the HTTP [Response].
  55. Future<Response> getSearchConfigWithHttpInfo() async {
  56. // ignore: prefer_const_declarations
  57. final path = r'/search/config';
  58. // ignore: prefer_final_locals
  59. Object? postBody;
  60. final queryParams = <QueryParam>[];
  61. final headerParams = <String, String>{};
  62. final formParams = <String, String>{};
  63. const contentTypes = <String>[];
  64. return apiClient.invokeAPI(
  65. path,
  66. 'GET',
  67. queryParams,
  68. postBody,
  69. headerParams,
  70. formParams,
  71. contentTypes.isEmpty ? null : contentTypes.first,
  72. );
  73. }
  74. ///
  75. Future<SearchConfigResponseDto?> getSearchConfig() async {
  76. final response = await getSearchConfigWithHttpInfo();
  77. if (response.statusCode >= HttpStatus.badRequest) {
  78. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  79. }
  80. // When a remote server returns no body with a status of 204, we shall not decode it.
  81. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  82. // FormatException when trying to decode an empty string.
  83. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  84. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SearchConfigResponseDto',) as SearchConfigResponseDto;
  85. }
  86. return null;
  87. }
  88. ///
  89. ///
  90. /// Note: This method returns the HTTP [Response].
  91. ///
  92. /// Parameters:
  93. ///
  94. /// * [String] q:
  95. ///
  96. /// * [String] query:
  97. ///
  98. /// * [bool] clip:
  99. ///
  100. /// * [String] type:
  101. ///
  102. /// * [bool] isFavorite:
  103. ///
  104. /// * [String] exifInfoPeriodCity:
  105. ///
  106. /// * [String] exifInfoPeriodState:
  107. ///
  108. /// * [String] exifInfoPeriodCountry:
  109. ///
  110. /// * [String] exifInfoPeriodMake:
  111. ///
  112. /// * [String] exifInfoPeriodModel:
  113. ///
  114. /// * [List<String>] smartInfoPeriodObjects:
  115. ///
  116. /// * [List<String>] smartInfoPeriodTags:
  117. ///
  118. /// * [bool] recent:
  119. ///
  120. /// * [bool] motion:
  121. Future<Response> searchWithHttpInfo({ String? q, String? query, bool? clip, String? type, bool? isFavorite, String? exifInfoPeriodCity, String? exifInfoPeriodState, String? exifInfoPeriodCountry, String? exifInfoPeriodMake, String? exifInfoPeriodModel, List<String>? smartInfoPeriodObjects, List<String>? smartInfoPeriodTags, bool? recent, bool? motion, }) async {
  122. // ignore: prefer_const_declarations
  123. final path = r'/search';
  124. // ignore: prefer_final_locals
  125. Object? postBody;
  126. final queryParams = <QueryParam>[];
  127. final headerParams = <String, String>{};
  128. final formParams = <String, String>{};
  129. if (q != null) {
  130. queryParams.addAll(_queryParams('', 'q', q));
  131. }
  132. if (query != null) {
  133. queryParams.addAll(_queryParams('', 'query', query));
  134. }
  135. if (clip != null) {
  136. queryParams.addAll(_queryParams('', 'clip', clip));
  137. }
  138. if (type != null) {
  139. queryParams.addAll(_queryParams('', 'type', type));
  140. }
  141. if (isFavorite != null) {
  142. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  143. }
  144. if (exifInfoPeriodCity != null) {
  145. queryParams.addAll(_queryParams('', 'exifInfo.city', exifInfoPeriodCity));
  146. }
  147. if (exifInfoPeriodState != null) {
  148. queryParams.addAll(_queryParams('', 'exifInfo.state', exifInfoPeriodState));
  149. }
  150. if (exifInfoPeriodCountry != null) {
  151. queryParams.addAll(_queryParams('', 'exifInfo.country', exifInfoPeriodCountry));
  152. }
  153. if (exifInfoPeriodMake != null) {
  154. queryParams.addAll(_queryParams('', 'exifInfo.make', exifInfoPeriodMake));
  155. }
  156. if (exifInfoPeriodModel != null) {
  157. queryParams.addAll(_queryParams('', 'exifInfo.model', exifInfoPeriodModel));
  158. }
  159. if (smartInfoPeriodObjects != null) {
  160. queryParams.addAll(_queryParams('multi', 'smartInfo.objects', smartInfoPeriodObjects));
  161. }
  162. if (smartInfoPeriodTags != null) {
  163. queryParams.addAll(_queryParams('multi', 'smartInfo.tags', smartInfoPeriodTags));
  164. }
  165. if (recent != null) {
  166. queryParams.addAll(_queryParams('', 'recent', recent));
  167. }
  168. if (motion != null) {
  169. queryParams.addAll(_queryParams('', 'motion', motion));
  170. }
  171. const contentTypes = <String>[];
  172. return apiClient.invokeAPI(
  173. path,
  174. 'GET',
  175. queryParams,
  176. postBody,
  177. headerParams,
  178. formParams,
  179. contentTypes.isEmpty ? null : contentTypes.first,
  180. );
  181. }
  182. ///
  183. ///
  184. /// Parameters:
  185. ///
  186. /// * [String] q:
  187. ///
  188. /// * [String] query:
  189. ///
  190. /// * [bool] clip:
  191. ///
  192. /// * [String] type:
  193. ///
  194. /// * [bool] isFavorite:
  195. ///
  196. /// * [String] exifInfoPeriodCity:
  197. ///
  198. /// * [String] exifInfoPeriodState:
  199. ///
  200. /// * [String] exifInfoPeriodCountry:
  201. ///
  202. /// * [String] exifInfoPeriodMake:
  203. ///
  204. /// * [String] exifInfoPeriodModel:
  205. ///
  206. /// * [List<String>] smartInfoPeriodObjects:
  207. ///
  208. /// * [List<String>] smartInfoPeriodTags:
  209. ///
  210. /// * [bool] recent:
  211. ///
  212. /// * [bool] motion:
  213. Future<SearchResponseDto?> search({ String? q, String? query, bool? clip, String? type, bool? isFavorite, String? exifInfoPeriodCity, String? exifInfoPeriodState, String? exifInfoPeriodCountry, String? exifInfoPeriodMake, String? exifInfoPeriodModel, List<String>? smartInfoPeriodObjects, List<String>? smartInfoPeriodTags, bool? recent, bool? motion, }) async {
  214. final response = await searchWithHttpInfo( q: q, query: query, clip: clip, type: type, isFavorite: isFavorite, exifInfoPeriodCity: exifInfoPeriodCity, exifInfoPeriodState: exifInfoPeriodState, exifInfoPeriodCountry: exifInfoPeriodCountry, exifInfoPeriodMake: exifInfoPeriodMake, exifInfoPeriodModel: exifInfoPeriodModel, smartInfoPeriodObjects: smartInfoPeriodObjects, smartInfoPeriodTags: smartInfoPeriodTags, recent: recent, motion: motion, );
  215. if (response.statusCode >= HttpStatus.badRequest) {
  216. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  217. }
  218. // When a remote server returns no body with a status of 204, we shall not decode it.
  219. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  220. // FormatException when trying to decode an empty string.
  221. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  222. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SearchResponseDto',) as SearchResponseDto;
  223. }
  224. return null;
  225. }
  226. }