search_api.dart 8.8 KB

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