diff --git a/packages/nextcloud/lib/src/api/core.openapi.dart b/packages/nextcloud/lib/src/api/core.openapi.dart index 07bcb7a6..df54e15f 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.dart +++ b/packages/nextcloud/lib/src/api/core.openapi.dart @@ -360,6 +360,91 @@ class CoreClient extends DynamiteClient { } throw await CoreApiException.fromResponse(response); // coverage:ignore-line } + + /// Get the providers for unified search + Future unifiedSearchProviders({final String from = ''}) async { + const path = '/ocs/v2.php/search/providers'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/json', + }; + Uint8List? body; + if (authentications.where((final a) => a.type == 'http' && a.scheme == 'basic').isNotEmpty) { + headers.addAll(authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').headers); + } else { + throw Exception('Missing authentication for basic_auth'); // coverage:ignore-line + } + if (from != '') { + queryParameters['from'] = from; + } + final response = await doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(CoreUnifiedSearchProvidersResponse200ApplicationJson), + )! as CoreUnifiedSearchProvidersResponse200ApplicationJson; + } + throw await CoreApiException.fromResponse(response); // coverage:ignore-line + } + + /// Search + Future unifiedSearch({ + required final String providerId, + final String term = '', + final int? sortOrder, + final int? limit, + final ContentString? cursor, + final String from = '', + }) async { + var path = '/ocs/v2.php/search/providers/{providerId}/search'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/json', + }; + Uint8List? body; + if (authentications.where((final a) => a.type == 'http' && a.scheme == 'basic').isNotEmpty) { + headers.addAll(authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').headers); + } else { + throw Exception('Missing authentication for basic_auth'); // coverage:ignore-line + } + path = path.replaceAll('{providerId}', Uri.encodeQueryComponent(providerId)); + if (term != '') { + queryParameters['term'] = term; + } + if (sortOrder != null) { + queryParameters['sortOrder'] = sortOrder.toString(); + } + if (limit != null) { + queryParameters['limit'] = limit.toString(); + } + if (cursor != null) { + queryParameters['cursor'] = _jsonSerializers.serialize( + cursor, + specifiedType: const FullType(ContentString, [FullType(CoreUnifiedSearchCursor)]), + ); + } + if (from != '') { + queryParameters['from'] = from; + } + final response = await doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(CoreUnifiedSearchResponse200ApplicationJson), + )! as CoreUnifiedSearchResponse200ApplicationJson; + } + throw await CoreApiException.fromResponse(response); // coverage:ignore-line + } } abstract class CoreServerStatus implements Built { @@ -1711,6 +1796,222 @@ abstract class CoreAutocompleteResult implements Built get serializer => _$coreAutocompleteResultSerializer; } +abstract class CoreUnifiedSearchProvider implements Built { + factory CoreUnifiedSearchProvider([final void Function(CoreUnifiedSearchProviderBuilder)? b]) = + _$CoreUnifiedSearchProvider; + const CoreUnifiedSearchProvider._(); + + factory CoreUnifiedSearchProvider.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + String get id; + String get name; + int get order; + static Serializer get serializer => _$coreUnifiedSearchProviderSerializer; +} + +abstract class CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs + implements + Built { + factory CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs([ + final void Function(CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder)? b, + ]) = _$CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs; + const CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs._(); + + factory CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + CoreOCSMeta get meta; + BuiltList get data; + static Serializer get serializer => + _$coreUnifiedSearchProvidersResponse200ApplicationJsonOcsSerializer; +} + +abstract class CoreUnifiedSearchProvidersResponse200ApplicationJson + implements + Built { + factory CoreUnifiedSearchProvidersResponse200ApplicationJson([ + final void Function(CoreUnifiedSearchProvidersResponse200ApplicationJsonBuilder)? b, + ]) = _$CoreUnifiedSearchProvidersResponse200ApplicationJson; + const CoreUnifiedSearchProvidersResponse200ApplicationJson._(); + + factory CoreUnifiedSearchProvidersResponse200ApplicationJson.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs get ocs; + static Serializer get serializer => + _$coreUnifiedSearchProvidersResponse200ApplicationJsonSerializer; +} + +abstract class CoreUnifiedSearchCursor implements Built { + factory CoreUnifiedSearchCursor([final void Function(CoreUnifiedSearchCursorBuilder)? b]) = _$CoreUnifiedSearchCursor; + const CoreUnifiedSearchCursor._(); + + JsonObject get data; + int? get $int; + String? get string; + static CoreUnifiedSearchCursor fromJson(final Object json) => _jsonSerializers.deserializeWith(serializer, json)!; + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CoreUnifiedSearchCursorSerializer(); +} + +class _$CoreUnifiedSearchCursorSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [CoreUnifiedSearchCursor, _$CoreUnifiedSearchCursor]; + + @override + final String wireName = 'CoreUnifiedSearchCursor'; + + @override + Object serialize( + final Serializers serializers, + final CoreUnifiedSearchCursor object, { + final FullType specifiedType = FullType.unspecified, + }) => + object.data.value; + + @override + CoreUnifiedSearchCursor deserialize( + final Serializers serializers, + final Object data, { + final FullType specifiedType = FullType.unspecified, + }) { + final result = CoreUnifiedSearchCursorBuilder()..data = JsonObject(data); + try { + result._$int = data as int?; + } catch (_) {} + try { + result._string = data as String?; + } catch (_) {} + assert([result._$int, result._string].where((final x) => x != null).isNotEmpty, 'Need oneOf for ${result._data}'); + return result.build(); + } +} + +abstract class CoreUnifiedSearchResultEntry + implements Built { + factory CoreUnifiedSearchResultEntry([final void Function(CoreUnifiedSearchResultEntryBuilder)? b]) = + _$CoreUnifiedSearchResultEntry; + const CoreUnifiedSearchResultEntry._(); + + factory CoreUnifiedSearchResultEntry.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + String get thumbnailUrl; + String get title; + String get subline; + String get resourceUrl; + String get icon; + bool get rounded; + BuiltList get attributes; + static Serializer get serializer => _$coreUnifiedSearchResultEntrySerializer; +} + +abstract class CoreUnifiedSearchResult_Cursor + implements Built { + factory CoreUnifiedSearchResult_Cursor([final void Function(CoreUnifiedSearchResult_CursorBuilder)? b]) = + _$CoreUnifiedSearchResult_Cursor; + const CoreUnifiedSearchResult_Cursor._(); + + JsonObject get data; + int? get $int; + String? get string; + static CoreUnifiedSearchResult_Cursor fromJson(final Object json) => + _jsonSerializers.deserializeWith(serializer, json)!; + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CoreUnifiedSearchResult_CursorSerializer(); +} + +class _$CoreUnifiedSearchResult_CursorSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [CoreUnifiedSearchResult_Cursor, _$CoreUnifiedSearchResult_Cursor]; + + @override + final String wireName = 'CoreUnifiedSearchResult_Cursor'; + + @override + Object serialize( + final Serializers serializers, + final CoreUnifiedSearchResult_Cursor object, { + final FullType specifiedType = FullType.unspecified, + }) => + object.data.value; + + @override + CoreUnifiedSearchResult_Cursor deserialize( + final Serializers serializers, + final Object data, { + final FullType specifiedType = FullType.unspecified, + }) { + final result = CoreUnifiedSearchResult_CursorBuilder()..data = JsonObject(data); + try { + result._$int = data as int?; + } catch (_) {} + try { + result._string = data as String?; + } catch (_) {} + assert([result._$int, result._string].where((final x) => x != null).isNotEmpty, 'Need oneOf for ${result._data}'); + return result.build(); + } +} + +abstract class CoreUnifiedSearchResult implements Built { + factory CoreUnifiedSearchResult([final void Function(CoreUnifiedSearchResultBuilder)? b]) = _$CoreUnifiedSearchResult; + const CoreUnifiedSearchResult._(); + + factory CoreUnifiedSearchResult.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + String get name; + bool get isPaginated; + BuiltList get entries; + CoreUnifiedSearchResult_Cursor? get cursor; + static Serializer get serializer => _$coreUnifiedSearchResultSerializer; +} + +abstract class CoreUnifiedSearchResponse200ApplicationJson_Ocs + implements + Built { + factory CoreUnifiedSearchResponse200ApplicationJson_Ocs([ + final void Function(CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder)? b, + ]) = _$CoreUnifiedSearchResponse200ApplicationJson_Ocs; + const CoreUnifiedSearchResponse200ApplicationJson_Ocs._(); + + factory CoreUnifiedSearchResponse200ApplicationJson_Ocs.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + CoreOCSMeta get meta; + CoreUnifiedSearchResult get data; + static Serializer get serializer => + _$coreUnifiedSearchResponse200ApplicationJsonOcsSerializer; +} + +abstract class CoreUnifiedSearchResponse200ApplicationJson + implements Built { + factory CoreUnifiedSearchResponse200ApplicationJson([ + final void Function(CoreUnifiedSearchResponse200ApplicationJsonBuilder)? b, + ]) = _$CoreUnifiedSearchResponse200ApplicationJson; + const CoreUnifiedSearchResponse200ApplicationJson._(); + + factory CoreUnifiedSearchResponse200ApplicationJson.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + CoreUnifiedSearchResponse200ApplicationJson_Ocs get ocs; + static Serializer get serializer => + _$coreUnifiedSearchResponse200ApplicationJsonSerializer; +} + abstract class CoreEmptyOCS_Ocs implements Built { factory CoreEmptyOCS_Ocs([final void Function(CoreEmptyOCS_OcsBuilder)? b]) = _$CoreEmptyOCS_Ocs; const CoreEmptyOCS_Ocs._(); @@ -1797,6 +2098,13 @@ abstract class CoreEmptyOCS implements Built CoreAutocompleteResult, CoreAutocompleteResult_Ocs, CoreAutocompleteResult_Ocs_Data, + CoreUnifiedSearchProvidersResponse200ApplicationJson, + CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs, + CoreUnifiedSearchProvider, + CoreUnifiedSearchResponse200ApplicationJson, + CoreUnifiedSearchResponse200ApplicationJson_Ocs, + CoreUnifiedSearchResult, + CoreUnifiedSearchResultEntry, CoreEmptyOCS, CoreEmptyOCS_Ocs, ]) @@ -1807,7 +2115,20 @@ final Serializers _serializers = (_$_serializers.toBuilder() ..addBuilderFactory(const FullType(CoreLoginFlowInit), CoreLoginFlowInit.new) ..addBuilderFactory(const FullType(CoreLoginFlowResult), CoreLoginFlowResult.new) ..addBuilderFactory(const FullType(List, [FullType(int)]), ListBuilder.new) - ..addBuilderFactory(const FullType(CoreAutocompleteResult), CoreAutocompleteResult.new)) + ..addBuilderFactory(const FullType(CoreAutocompleteResult), CoreAutocompleteResult.new) + ..addBuilderFactory( + const FullType(CoreUnifiedSearchProvidersResponse200ApplicationJson), + CoreUnifiedSearchProvidersResponse200ApplicationJson.new, + ) + ..addBuilderFactory(const FullType(CoreUnifiedSearchCursor), CoreUnifiedSearchCursor.new) + ..addBuilderFactory( + const FullType(ContentString, [FullType(CoreUnifiedSearchCursor)]), + ContentString.new, + ) + ..addBuilderFactory( + const FullType(CoreUnifiedSearchResponse200ApplicationJson), + CoreUnifiedSearchResponse200ApplicationJson.new, + )) .build(); Serializers get coreSerializers => _serializers; diff --git a/packages/nextcloud/lib/src/api/core.openapi.g.dart b/packages/nextcloud/lib/src/api/core.openapi.g.dart index afee50e0..b1262a1a 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.g.dart +++ b/packages/nextcloud/lib/src/api/core.openapi.g.dart @@ -72,6 +72,14 @@ Serializers _$_serializers = (Serializers().toBuilder() ..add(CoreServerCapabilities_Ocs_Data_Capabilities_WeatherStatus.serializer) ..add(CoreServerCapabilities_Ocs_Data_Version.serializer) ..add(CoreServerStatus.serializer) + ..add(CoreUnifiedSearchProvider.serializer) + ..add(CoreUnifiedSearchProvidersResponse200ApplicationJson.serializer) + ..add(CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs.serializer) + ..add(CoreUnifiedSearchResponse200ApplicationJson.serializer) + ..add(CoreUnifiedSearchResponse200ApplicationJson_Ocs.serializer) + ..add(CoreUnifiedSearchResult.serializer) + ..add(CoreUnifiedSearchResultEntry.serializer) + ..add(CoreUnifiedSearchResult_Cursor.serializer) ..addBuilderFactory(const FullType(BuiltList, [FullType(CoreAutocompleteResult_Ocs_Data)]), () => ListBuilder()) ..addBuilderFactory(const FullType(BuiltList, [FullType(CoreNavigationApps_Ocs_Data)]), @@ -79,6 +87,10 @@ Serializers _$_serializers = (Serializers().toBuilder() ..addBuilderFactory( const FullType(BuiltList, [FullType(CoreServerCapabilities_Ocs_Data_Capabilities_Ocm_ResourceTypes)]), () => ListBuilder()) + ..addBuilderFactory(const FullType(BuiltList, [FullType(CoreUnifiedSearchProvider)]), + () => ListBuilder()) + ..addBuilderFactory(const FullType(BuiltList, [FullType(CoreUnifiedSearchResultEntry)]), + () => ListBuilder()) ..addBuilderFactory(const FullType(BuiltList, [FullType(JsonObject)]), () => ListBuilder()) ..addBuilderFactory(const FullType(BuiltList, [FullType(JsonObject)]), () => ListBuilder()) ..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), () => ListBuilder()) @@ -90,6 +102,7 @@ Serializers _$_serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), () => ListBuilder()) ..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), () => ListBuilder()) ..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), () => ListBuilder()) + ..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), () => ListBuilder()) ..addBuilderFactory(const FullType(BuiltList, [FullType(int)]), () => ListBuilder()) ..addBuilderFactory(const FullType(BuiltList, [FullType(int)]), () => ListBuilder())) .build(); @@ -247,6 +260,20 @@ Serializer _$coreAutocompleteResultOcsDataSeria _$CoreAutocompleteResult_Ocs_DataSerializer(); Serializer _$coreAutocompleteResultOcsSerializer = _$CoreAutocompleteResult_OcsSerializer(); Serializer _$coreAutocompleteResultSerializer = _$CoreAutocompleteResultSerializer(); +Serializer _$coreUnifiedSearchProviderSerializer = _$CoreUnifiedSearchProviderSerializer(); +Serializer + _$coreUnifiedSearchProvidersResponse200ApplicationJsonOcsSerializer = + _$CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsSerializer(); +Serializer + _$coreUnifiedSearchProvidersResponse200ApplicationJsonSerializer = + _$CoreUnifiedSearchProvidersResponse200ApplicationJsonSerializer(); +Serializer _$coreUnifiedSearchResultEntrySerializer = + _$CoreUnifiedSearchResultEntrySerializer(); +Serializer _$coreUnifiedSearchResultSerializer = _$CoreUnifiedSearchResultSerializer(); +Serializer _$coreUnifiedSearchResponse200ApplicationJsonOcsSerializer = + _$CoreUnifiedSearchResponse200ApplicationJson_OcsSerializer(); +Serializer _$coreUnifiedSearchResponse200ApplicationJsonSerializer = + _$CoreUnifiedSearchResponse200ApplicationJsonSerializer(); Serializer _$coreEmptyOCSOcsSerializer = _$CoreEmptyOCS_OcsSerializer(); Serializer _$coreEmptyOCSSerializer = _$CoreEmptyOCSSerializer(); @@ -4295,29 +4322,83 @@ class _$CoreAutocompleteResultSerializer implements StructuredSerializer { +class _$CoreUnifiedSearchProviderSerializer implements StructuredSerializer { @override - final Iterable types = const [CoreEmptyOCS_Ocs, _$CoreEmptyOCS_Ocs]; + final Iterable types = const [CoreUnifiedSearchProvider, _$CoreUnifiedSearchProvider]; @override - final String wireName = 'CoreEmptyOCS_Ocs'; + final String wireName = 'CoreUnifiedSearchProvider'; @override - Iterable serialize(Serializers serializers, CoreEmptyOCS_Ocs object, + Iterable serialize(Serializers serializers, CoreUnifiedSearchProvider object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'id', + serializers.serialize(object.id, specifiedType: const FullType(String)), + 'name', + serializers.serialize(object.name, specifiedType: const FullType(String)), + 'order', + serializers.serialize(object.order, specifiedType: const FullType(int)), + ]; + + return result; + } + + @override + CoreUnifiedSearchProvider deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = CoreUnifiedSearchProviderBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'id': + result.id = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'name': + result.name = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'order': + result.order = serializers.deserialize(value, specifiedType: const FullType(int))! as int; + break; + } + } + + return result.build(); + } +} + +class _$CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsSerializer + implements StructuredSerializer { + @override + final Iterable types = const [ + CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs, + _$CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs + ]; + @override + final String wireName = 'CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs'; + + @override + Iterable serialize(Serializers serializers, CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs object, {FullType specifiedType = FullType.unspecified}) { final result = [ 'meta', serializers.serialize(object.meta, specifiedType: const FullType(CoreOCSMeta)), 'data', - serializers.serialize(object.data, specifiedType: const FullType(BuiltList, [FullType(JsonObject)])), + serializers.serialize(object.data, + specifiedType: const FullType(BuiltList, [FullType(CoreUnifiedSearchProvider)])), ]; return result; } @override - CoreEmptyOCS_Ocs deserialize(Serializers serializers, Iterable serialized, + CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs deserialize( + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { - final result = CoreEmptyOCS_OcsBuilder(); + final result = CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder(); final iterator = serialized.iterator; while (iterator.moveNext()) { @@ -4331,7 +4412,7 @@ class _$CoreEmptyOCS_OcsSerializer implements StructuredSerializer); + specifiedType: const FullType(BuiltList, [FullType(CoreUnifiedSearchProvider)]))! as BuiltList); break; } } @@ -4340,27 +4421,33 @@ class _$CoreEmptyOCS_OcsSerializer implements StructuredSerializer { +class _$CoreUnifiedSearchProvidersResponse200ApplicationJsonSerializer + implements StructuredSerializer { @override - final Iterable types = const [CoreEmptyOCS, _$CoreEmptyOCS]; + final Iterable types = const [ + CoreUnifiedSearchProvidersResponse200ApplicationJson, + _$CoreUnifiedSearchProvidersResponse200ApplicationJson + ]; @override - final String wireName = 'CoreEmptyOCS'; + final String wireName = 'CoreUnifiedSearchProvidersResponse200ApplicationJson'; @override - Iterable serialize(Serializers serializers, CoreEmptyOCS object, + Iterable serialize(Serializers serializers, CoreUnifiedSearchProvidersResponse200ApplicationJson object, {FullType specifiedType = FullType.unspecified}) { final result = [ 'ocs', - serializers.serialize(object.ocs, specifiedType: const FullType(CoreEmptyOCS_Ocs)), + serializers.serialize(object.ocs, + specifiedType: const FullType(CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs)), ]; return result; } @override - CoreEmptyOCS deserialize(Serializers serializers, Iterable serialized, + CoreUnifiedSearchProvidersResponse200ApplicationJson deserialize( + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { - final result = CoreEmptyOCSBuilder(); + final result = CoreUnifiedSearchProvidersResponse200ApplicationJsonBuilder(); final iterator = serialized.iterator; while (iterator.moveNext()) { @@ -4369,8 +4456,9 @@ class _$CoreEmptyOCSSerializer implements StructuredSerializer { final Object? value = iterator.current; switch (key) { case 'ocs': - result.ocs.replace( - serializers.deserialize(value, specifiedType: const FullType(CoreEmptyOCS_Ocs))! as CoreEmptyOCS_Ocs); + result.ocs.replace(serializers.deserialize(value, + specifiedType: const FullType(CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs))! + as CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs); break; } } @@ -4379,114 +4467,421 @@ class _$CoreEmptyOCSSerializer implements StructuredSerializer { } } -class _$CoreServerStatus extends CoreServerStatus { +class _$CoreUnifiedSearchResultEntrySerializer implements StructuredSerializer { @override - final bool installed; + final Iterable types = const [CoreUnifiedSearchResultEntry, _$CoreUnifiedSearchResultEntry]; @override - final bool maintenance; + final String wireName = 'CoreUnifiedSearchResultEntry'; + @override - final bool needsDbUpgrade; + Iterable serialize(Serializers serializers, CoreUnifiedSearchResultEntry object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'thumbnailUrl', + serializers.serialize(object.thumbnailUrl, specifiedType: const FullType(String)), + 'title', + serializers.serialize(object.title, specifiedType: const FullType(String)), + 'subline', + serializers.serialize(object.subline, specifiedType: const FullType(String)), + 'resourceUrl', + serializers.serialize(object.resourceUrl, specifiedType: const FullType(String)), + 'icon', + serializers.serialize(object.icon, specifiedType: const FullType(String)), + 'rounded', + serializers.serialize(object.rounded, specifiedType: const FullType(bool)), + 'attributes', + serializers.serialize(object.attributes, specifiedType: const FullType(BuiltList, [FullType(String)])), + ]; + + return result; + } + @override - final String version; + CoreUnifiedSearchResultEntry deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = CoreUnifiedSearchResultEntryBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'thumbnailUrl': + result.thumbnailUrl = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'title': + result.title = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'subline': + result.subline = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'resourceUrl': + result.resourceUrl = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'icon': + result.icon = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'rounded': + result.rounded = serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'attributes': + result.attributes.replace(serializers.deserialize(value, + specifiedType: const FullType(BuiltList, [FullType(String)]))! as BuiltList); + break; + } + } + + return result.build(); + } +} + +class _$CoreUnifiedSearchResultSerializer implements StructuredSerializer { @override - final String versionstring; + final Iterable types = const [CoreUnifiedSearchResult, _$CoreUnifiedSearchResult]; @override - final String edition; + final String wireName = 'CoreUnifiedSearchResult'; + @override - final String productname; + Iterable serialize(Serializers serializers, CoreUnifiedSearchResult object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'name', + serializers.serialize(object.name, specifiedType: const FullType(String)), + 'isPaginated', + serializers.serialize(object.isPaginated, specifiedType: const FullType(bool)), + 'entries', + serializers.serialize(object.entries, + specifiedType: const FullType(BuiltList, [FullType(CoreUnifiedSearchResultEntry)])), + ]; + Object? value; + value = object.cursor; + if (value != null) { + result + ..add('cursor') + ..add(serializers.serialize(value, specifiedType: const FullType(CoreUnifiedSearchResult_Cursor))); + } + return result; + } + @override - final bool extendedSupport; + CoreUnifiedSearchResult deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = CoreUnifiedSearchResultBuilder(); - factory _$CoreServerStatus([void Function(CoreServerStatusBuilder)? updates]) => - (CoreServerStatusBuilder()..update(updates))._build(); + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'name': + result.name = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'isPaginated': + result.isPaginated = serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'entries': + result.entries.replace(serializers.deserialize(value, + specifiedType: const FullType(BuiltList, [FullType(CoreUnifiedSearchResultEntry)]))! + as BuiltList); + break; + case 'cursor': + result.cursor.replace(serializers.deserialize(value, + specifiedType: const FullType(CoreUnifiedSearchResult_Cursor))! as CoreUnifiedSearchResult_Cursor); + break; + } + } - _$CoreServerStatus._( - {required this.installed, - required this.maintenance, - required this.needsDbUpgrade, - required this.version, - required this.versionstring, - required this.edition, - required this.productname, - required this.extendedSupport}) - : super._() { - BuiltValueNullFieldError.checkNotNull(installed, r'CoreServerStatus', 'installed'); - BuiltValueNullFieldError.checkNotNull(maintenance, r'CoreServerStatus', 'maintenance'); - BuiltValueNullFieldError.checkNotNull(needsDbUpgrade, r'CoreServerStatus', 'needsDbUpgrade'); - BuiltValueNullFieldError.checkNotNull(version, r'CoreServerStatus', 'version'); - BuiltValueNullFieldError.checkNotNull(versionstring, r'CoreServerStatus', 'versionstring'); - BuiltValueNullFieldError.checkNotNull(edition, r'CoreServerStatus', 'edition'); - BuiltValueNullFieldError.checkNotNull(productname, r'CoreServerStatus', 'productname'); - BuiltValueNullFieldError.checkNotNull(extendedSupport, r'CoreServerStatus', 'extendedSupport'); + return result.build(); } +} +class _$CoreUnifiedSearchResponse200ApplicationJson_OcsSerializer + implements StructuredSerializer { @override - CoreServerStatus rebuild(void Function(CoreServerStatusBuilder) updates) => (toBuilder()..update(updates)).build(); - + final Iterable types = const [ + CoreUnifiedSearchResponse200ApplicationJson_Ocs, + _$CoreUnifiedSearchResponse200ApplicationJson_Ocs + ]; @override - CoreServerStatusBuilder toBuilder() => CoreServerStatusBuilder()..replace(this); + final String wireName = 'CoreUnifiedSearchResponse200ApplicationJson_Ocs'; @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is CoreServerStatus && - installed == other.installed && - maintenance == other.maintenance && - needsDbUpgrade == other.needsDbUpgrade && - version == other.version && - versionstring == other.versionstring && - edition == other.edition && - productname == other.productname && - extendedSupport == other.extendedSupport; - } + Iterable serialize(Serializers serializers, CoreUnifiedSearchResponse200ApplicationJson_Ocs object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'meta', + serializers.serialize(object.meta, specifiedType: const FullType(CoreOCSMeta)), + 'data', + serializers.serialize(object.data, specifiedType: const FullType(CoreUnifiedSearchResult)), + ]; - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, installed.hashCode); - _$hash = $jc(_$hash, maintenance.hashCode); - _$hash = $jc(_$hash, needsDbUpgrade.hashCode); - _$hash = $jc(_$hash, version.hashCode); - _$hash = $jc(_$hash, versionstring.hashCode); - _$hash = $jc(_$hash, edition.hashCode); - _$hash = $jc(_$hash, productname.hashCode); - _$hash = $jc(_$hash, extendedSupport.hashCode); - _$hash = $jf(_$hash); - return _$hash; + return result; } @override - String toString() { - return (newBuiltValueToStringHelper(r'CoreServerStatus') - ..add('installed', installed) - ..add('maintenance', maintenance) - ..add('needsDbUpgrade', needsDbUpgrade) - ..add('version', version) - ..add('versionstring', versionstring) - ..add('edition', edition) - ..add('productname', productname) - ..add('extendedSupport', extendedSupport)) - .toString(); + CoreUnifiedSearchResponse200ApplicationJson_Ocs deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'meta': + result.meta + .replace(serializers.deserialize(value, specifiedType: const FullType(CoreOCSMeta))! as CoreOCSMeta); + break; + case 'data': + result.data.replace(serializers.deserialize(value, specifiedType: const FullType(CoreUnifiedSearchResult))! + as CoreUnifiedSearchResult); + break; + } + } + + return result.build(); } } -class CoreServerStatusBuilder implements Builder { - _$CoreServerStatus? _$v; +class _$CoreUnifiedSearchResponse200ApplicationJsonSerializer + implements StructuredSerializer { + @override + final Iterable types = const [ + CoreUnifiedSearchResponse200ApplicationJson, + _$CoreUnifiedSearchResponse200ApplicationJson + ]; + @override + final String wireName = 'CoreUnifiedSearchResponse200ApplicationJson'; - bool? _installed; - bool? get installed => _$this._installed; - set installed(bool? installed) => _$this._installed = installed; + @override + Iterable serialize(Serializers serializers, CoreUnifiedSearchResponse200ApplicationJson object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'ocs', + serializers.serialize(object.ocs, specifiedType: const FullType(CoreUnifiedSearchResponse200ApplicationJson_Ocs)), + ]; - bool? _maintenance; - bool? get maintenance => _$this._maintenance; - set maintenance(bool? maintenance) => _$this._maintenance = maintenance; + return result; + } - bool? _needsDbUpgrade; - bool? get needsDbUpgrade => _$this._needsDbUpgrade; - set needsDbUpgrade(bool? needsDbUpgrade) => _$this._needsDbUpgrade = needsDbUpgrade; + @override + CoreUnifiedSearchResponse200ApplicationJson deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = CoreUnifiedSearchResponse200ApplicationJsonBuilder(); - String? _version; - String? get version => _$this._version; + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'ocs': + result.ocs.replace(serializers.deserialize(value, + specifiedType: const FullType(CoreUnifiedSearchResponse200ApplicationJson_Ocs))! + as CoreUnifiedSearchResponse200ApplicationJson_Ocs); + break; + } + } + + return result.build(); + } +} + +class _$CoreEmptyOCS_OcsSerializer implements StructuredSerializer { + @override + final Iterable types = const [CoreEmptyOCS_Ocs, _$CoreEmptyOCS_Ocs]; + @override + final String wireName = 'CoreEmptyOCS_Ocs'; + + @override + Iterable serialize(Serializers serializers, CoreEmptyOCS_Ocs object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'meta', + serializers.serialize(object.meta, specifiedType: const FullType(CoreOCSMeta)), + 'data', + serializers.serialize(object.data, specifiedType: const FullType(BuiltList, [FullType(JsonObject)])), + ]; + + return result; + } + + @override + CoreEmptyOCS_Ocs deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = CoreEmptyOCS_OcsBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'meta': + result.meta + .replace(serializers.deserialize(value, specifiedType: const FullType(CoreOCSMeta))! as CoreOCSMeta); + break; + case 'data': + result.data.replace(serializers.deserialize(value, + specifiedType: const FullType(BuiltList, [FullType(JsonObject)]))! as BuiltList); + break; + } + } + + return result.build(); + } +} + +class _$CoreEmptyOCSSerializer implements StructuredSerializer { + @override + final Iterable types = const [CoreEmptyOCS, _$CoreEmptyOCS]; + @override + final String wireName = 'CoreEmptyOCS'; + + @override + Iterable serialize(Serializers serializers, CoreEmptyOCS object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'ocs', + serializers.serialize(object.ocs, specifiedType: const FullType(CoreEmptyOCS_Ocs)), + ]; + + return result; + } + + @override + CoreEmptyOCS deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = CoreEmptyOCSBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'ocs': + result.ocs.replace( + serializers.deserialize(value, specifiedType: const FullType(CoreEmptyOCS_Ocs))! as CoreEmptyOCS_Ocs); + break; + } + } + + return result.build(); + } +} + +class _$CoreServerStatus extends CoreServerStatus { + @override + final bool installed; + @override + final bool maintenance; + @override + final bool needsDbUpgrade; + @override + final String version; + @override + final String versionstring; + @override + final String edition; + @override + final String productname; + @override + final bool extendedSupport; + + factory _$CoreServerStatus([void Function(CoreServerStatusBuilder)? updates]) => + (CoreServerStatusBuilder()..update(updates))._build(); + + _$CoreServerStatus._( + {required this.installed, + required this.maintenance, + required this.needsDbUpgrade, + required this.version, + required this.versionstring, + required this.edition, + required this.productname, + required this.extendedSupport}) + : super._() { + BuiltValueNullFieldError.checkNotNull(installed, r'CoreServerStatus', 'installed'); + BuiltValueNullFieldError.checkNotNull(maintenance, r'CoreServerStatus', 'maintenance'); + BuiltValueNullFieldError.checkNotNull(needsDbUpgrade, r'CoreServerStatus', 'needsDbUpgrade'); + BuiltValueNullFieldError.checkNotNull(version, r'CoreServerStatus', 'version'); + BuiltValueNullFieldError.checkNotNull(versionstring, r'CoreServerStatus', 'versionstring'); + BuiltValueNullFieldError.checkNotNull(edition, r'CoreServerStatus', 'edition'); + BuiltValueNullFieldError.checkNotNull(productname, r'CoreServerStatus', 'productname'); + BuiltValueNullFieldError.checkNotNull(extendedSupport, r'CoreServerStatus', 'extendedSupport'); + } + + @override + CoreServerStatus rebuild(void Function(CoreServerStatusBuilder) updates) => (toBuilder()..update(updates)).build(); + + @override + CoreServerStatusBuilder toBuilder() => CoreServerStatusBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is CoreServerStatus && + installed == other.installed && + maintenance == other.maintenance && + needsDbUpgrade == other.needsDbUpgrade && + version == other.version && + versionstring == other.versionstring && + edition == other.edition && + productname == other.productname && + extendedSupport == other.extendedSupport; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, installed.hashCode); + _$hash = $jc(_$hash, maintenance.hashCode); + _$hash = $jc(_$hash, needsDbUpgrade.hashCode); + _$hash = $jc(_$hash, version.hashCode); + _$hash = $jc(_$hash, versionstring.hashCode); + _$hash = $jc(_$hash, edition.hashCode); + _$hash = $jc(_$hash, productname.hashCode); + _$hash = $jc(_$hash, extendedSupport.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'CoreServerStatus') + ..add('installed', installed) + ..add('maintenance', maintenance) + ..add('needsDbUpgrade', needsDbUpgrade) + ..add('version', version) + ..add('versionstring', versionstring) + ..add('edition', edition) + ..add('productname', productname) + ..add('extendedSupport', extendedSupport)) + .toString(); + } +} + +class CoreServerStatusBuilder implements Builder { + _$CoreServerStatus? _$v; + + bool? _installed; + bool? get installed => _$this._installed; + set installed(bool? installed) => _$this._installed = installed; + + bool? _maintenance; + bool? get maintenance => _$this._maintenance; + set maintenance(bool? maintenance) => _$this._maintenance = maintenance; + + bool? _needsDbUpgrade; + bool? get needsDbUpgrade => _$this._needsDbUpgrade; + set needsDbUpgrade(bool? needsDbUpgrade) => _$this._needsDbUpgrade = needsDbUpgrade; + + String? _version; + String? get version => _$this._version; set version(String? version) => _$this._version = version; String? _versionstring; @@ -12021,6 +12416,1044 @@ class CoreAutocompleteResultBuilder implements Builder + (CoreUnifiedSearchProviderBuilder()..update(updates))._build(); + + _$CoreUnifiedSearchProvider._({required this.id, required this.name, required this.order}) : super._() { + BuiltValueNullFieldError.checkNotNull(id, r'CoreUnifiedSearchProvider', 'id'); + BuiltValueNullFieldError.checkNotNull(name, r'CoreUnifiedSearchProvider', 'name'); + BuiltValueNullFieldError.checkNotNull(order, r'CoreUnifiedSearchProvider', 'order'); + } + + @override + CoreUnifiedSearchProvider rebuild(void Function(CoreUnifiedSearchProviderBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + CoreUnifiedSearchProviderBuilder toBuilder() => CoreUnifiedSearchProviderBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is CoreUnifiedSearchProvider && id == other.id && name == other.name && order == other.order; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, order.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'CoreUnifiedSearchProvider') + ..add('id', id) + ..add('name', name) + ..add('order', order)) + .toString(); + } +} + +class CoreUnifiedSearchProviderBuilder implements Builder { + _$CoreUnifiedSearchProvider? _$v; + + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + int? _order; + int? get order => _$this._order; + set order(int? order) => _$this._order = order; + + CoreUnifiedSearchProviderBuilder(); + + CoreUnifiedSearchProviderBuilder get _$this { + final $v = _$v; + if ($v != null) { + _id = $v.id; + _name = $v.name; + _order = $v.order; + _$v = null; + } + return this; + } + + @override + void replace(CoreUnifiedSearchProvider other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$CoreUnifiedSearchProvider; + } + + @override + void update(void Function(CoreUnifiedSearchProviderBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + CoreUnifiedSearchProvider build() => _build(); + + _$CoreUnifiedSearchProvider _build() { + final _$result = _$v ?? + _$CoreUnifiedSearchProvider._( + id: BuiltValueNullFieldError.checkNotNull(id, r'CoreUnifiedSearchProvider', 'id'), + name: BuiltValueNullFieldError.checkNotNull(name, r'CoreUnifiedSearchProvider', 'name'), + order: BuiltValueNullFieldError.checkNotNull(order, r'CoreUnifiedSearchProvider', 'order')); + replace(_$result); + return _$result; + } +} + +class _$CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs + extends CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs { + @override + final CoreOCSMeta meta; + @override + final BuiltList data; + + factory _$CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs( + [void Function(CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder)? updates]) => + (CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder()..update(updates))._build(); + + _$CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs._({required this.meta, required this.data}) : super._() { + BuiltValueNullFieldError.checkNotNull(meta, r'CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs', 'meta'); + BuiltValueNullFieldError.checkNotNull(data, r'CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs', 'data'); + } + + @override + CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs rebuild( + void Function(CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder toBuilder() => + CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs && + meta == other.meta && + data == other.data; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, meta.hashCode); + _$hash = $jc(_$hash, data.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs') + ..add('meta', meta) + ..add('data', data)) + .toString(); + } +} + +class CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder + implements + Builder { + _$CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs? _$v; + + CoreOCSMetaBuilder? _meta; + CoreOCSMetaBuilder get meta => _$this._meta ??= CoreOCSMetaBuilder(); + set meta(CoreOCSMetaBuilder? meta) => _$this._meta = meta; + + ListBuilder? _data; + ListBuilder get data => _$this._data ??= ListBuilder(); + set data(ListBuilder? data) => _$this._data = data; + + CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder(); + + CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder get _$this { + final $v = _$v; + if ($v != null) { + _meta = $v.meta.toBuilder(); + _data = $v.data.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs; + } + + @override + void update(void Function(CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs build() => _build(); + + _$CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs _build() { + _$CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs _$result; + try { + _$result = + _$v ?? _$CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs._(meta: meta.build(), data: data.build()); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'meta'; + meta.build(); + _$failedField = 'data'; + data.build(); + } catch (e) { + throw BuiltValueNestedFieldError( + r'CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$CoreUnifiedSearchProvidersResponse200ApplicationJson + extends CoreUnifiedSearchProvidersResponse200ApplicationJson { + @override + final CoreUnifiedSearchProvidersResponse200ApplicationJson_Ocs ocs; + + factory _$CoreUnifiedSearchProvidersResponse200ApplicationJson( + [void Function(CoreUnifiedSearchProvidersResponse200ApplicationJsonBuilder)? updates]) => + (CoreUnifiedSearchProvidersResponse200ApplicationJsonBuilder()..update(updates))._build(); + + _$CoreUnifiedSearchProvidersResponse200ApplicationJson._({required this.ocs}) : super._() { + BuiltValueNullFieldError.checkNotNull(ocs, r'CoreUnifiedSearchProvidersResponse200ApplicationJson', 'ocs'); + } + + @override + CoreUnifiedSearchProvidersResponse200ApplicationJson rebuild( + void Function(CoreUnifiedSearchProvidersResponse200ApplicationJsonBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + CoreUnifiedSearchProvidersResponse200ApplicationJsonBuilder toBuilder() => + CoreUnifiedSearchProvidersResponse200ApplicationJsonBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is CoreUnifiedSearchProvidersResponse200ApplicationJson && ocs == other.ocs; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, ocs.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'CoreUnifiedSearchProvidersResponse200ApplicationJson')..add('ocs', ocs)) + .toString(); + } +} + +class CoreUnifiedSearchProvidersResponse200ApplicationJsonBuilder + implements + Builder { + _$CoreUnifiedSearchProvidersResponse200ApplicationJson? _$v; + + CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder? _ocs; + CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder get ocs => + _$this._ocs ??= CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder(); + set ocs(CoreUnifiedSearchProvidersResponse200ApplicationJson_OcsBuilder? ocs) => _$this._ocs = ocs; + + CoreUnifiedSearchProvidersResponse200ApplicationJsonBuilder(); + + CoreUnifiedSearchProvidersResponse200ApplicationJsonBuilder get _$this { + final $v = _$v; + if ($v != null) { + _ocs = $v.ocs.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(CoreUnifiedSearchProvidersResponse200ApplicationJson other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$CoreUnifiedSearchProvidersResponse200ApplicationJson; + } + + @override + void update(void Function(CoreUnifiedSearchProvidersResponse200ApplicationJsonBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + CoreUnifiedSearchProvidersResponse200ApplicationJson build() => _build(); + + _$CoreUnifiedSearchProvidersResponse200ApplicationJson _build() { + _$CoreUnifiedSearchProvidersResponse200ApplicationJson _$result; + try { + _$result = _$v ?? _$CoreUnifiedSearchProvidersResponse200ApplicationJson._(ocs: ocs.build()); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'ocs'; + ocs.build(); + } catch (e) { + throw BuiltValueNestedFieldError( + r'CoreUnifiedSearchProvidersResponse200ApplicationJson', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$CoreUnifiedSearchCursor extends CoreUnifiedSearchCursor { + @override + final JsonObject data; + @override + final int? $int; + @override + final String? string; + + factory _$CoreUnifiedSearchCursor([void Function(CoreUnifiedSearchCursorBuilder)? updates]) => + (CoreUnifiedSearchCursorBuilder()..update(updates))._build(); + + _$CoreUnifiedSearchCursor._({required this.data, this.$int, this.string}) : super._() { + BuiltValueNullFieldError.checkNotNull(data, r'CoreUnifiedSearchCursor', 'data'); + } + + @override + CoreUnifiedSearchCursor rebuild(void Function(CoreUnifiedSearchCursorBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + CoreUnifiedSearchCursorBuilder toBuilder() => CoreUnifiedSearchCursorBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is CoreUnifiedSearchCursor && data == other.data && $int == other.$int && string == other.string; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, data.hashCode); + _$hash = $jc(_$hash, $int.hashCode); + _$hash = $jc(_$hash, string.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'CoreUnifiedSearchCursor') + ..add('data', data) + ..add('\$int', $int) + ..add('string', string)) + .toString(); + } +} + +class CoreUnifiedSearchCursorBuilder implements Builder { + _$CoreUnifiedSearchCursor? _$v; + + JsonObject? _data; + JsonObject? get data => _$this._data; + set data(JsonObject? data) => _$this._data = data; + + int? _$int; + int? get $int => _$this._$int; + set $int(int? $int) => _$this._$int = $int; + + String? _string; + String? get string => _$this._string; + set string(String? string) => _$this._string = string; + + CoreUnifiedSearchCursorBuilder(); + + CoreUnifiedSearchCursorBuilder get _$this { + final $v = _$v; + if ($v != null) { + _data = $v.data; + _$int = $v.$int; + _string = $v.string; + _$v = null; + } + return this; + } + + @override + void replace(CoreUnifiedSearchCursor other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$CoreUnifiedSearchCursor; + } + + @override + void update(void Function(CoreUnifiedSearchCursorBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + CoreUnifiedSearchCursor build() => _build(); + + _$CoreUnifiedSearchCursor _build() { + final _$result = _$v ?? + _$CoreUnifiedSearchCursor._( + data: BuiltValueNullFieldError.checkNotNull(data, r'CoreUnifiedSearchCursor', 'data'), + $int: $int, + string: string); + replace(_$result); + return _$result; + } +} + +class _$CoreUnifiedSearchResultEntry extends CoreUnifiedSearchResultEntry { + @override + final String thumbnailUrl; + @override + final String title; + @override + final String subline; + @override + final String resourceUrl; + @override + final String icon; + @override + final bool rounded; + @override + final BuiltList attributes; + + factory _$CoreUnifiedSearchResultEntry([void Function(CoreUnifiedSearchResultEntryBuilder)? updates]) => + (CoreUnifiedSearchResultEntryBuilder()..update(updates))._build(); + + _$CoreUnifiedSearchResultEntry._( + {required this.thumbnailUrl, + required this.title, + required this.subline, + required this.resourceUrl, + required this.icon, + required this.rounded, + required this.attributes}) + : super._() { + BuiltValueNullFieldError.checkNotNull(thumbnailUrl, r'CoreUnifiedSearchResultEntry', 'thumbnailUrl'); + BuiltValueNullFieldError.checkNotNull(title, r'CoreUnifiedSearchResultEntry', 'title'); + BuiltValueNullFieldError.checkNotNull(subline, r'CoreUnifiedSearchResultEntry', 'subline'); + BuiltValueNullFieldError.checkNotNull(resourceUrl, r'CoreUnifiedSearchResultEntry', 'resourceUrl'); + BuiltValueNullFieldError.checkNotNull(icon, r'CoreUnifiedSearchResultEntry', 'icon'); + BuiltValueNullFieldError.checkNotNull(rounded, r'CoreUnifiedSearchResultEntry', 'rounded'); + BuiltValueNullFieldError.checkNotNull(attributes, r'CoreUnifiedSearchResultEntry', 'attributes'); + } + + @override + CoreUnifiedSearchResultEntry rebuild(void Function(CoreUnifiedSearchResultEntryBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + CoreUnifiedSearchResultEntryBuilder toBuilder() => CoreUnifiedSearchResultEntryBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is CoreUnifiedSearchResultEntry && + thumbnailUrl == other.thumbnailUrl && + title == other.title && + subline == other.subline && + resourceUrl == other.resourceUrl && + icon == other.icon && + rounded == other.rounded && + attributes == other.attributes; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, thumbnailUrl.hashCode); + _$hash = $jc(_$hash, title.hashCode); + _$hash = $jc(_$hash, subline.hashCode); + _$hash = $jc(_$hash, resourceUrl.hashCode); + _$hash = $jc(_$hash, icon.hashCode); + _$hash = $jc(_$hash, rounded.hashCode); + _$hash = $jc(_$hash, attributes.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'CoreUnifiedSearchResultEntry') + ..add('thumbnailUrl', thumbnailUrl) + ..add('title', title) + ..add('subline', subline) + ..add('resourceUrl', resourceUrl) + ..add('icon', icon) + ..add('rounded', rounded) + ..add('attributes', attributes)) + .toString(); + } +} + +class CoreUnifiedSearchResultEntryBuilder + implements Builder { + _$CoreUnifiedSearchResultEntry? _$v; + + String? _thumbnailUrl; + String? get thumbnailUrl => _$this._thumbnailUrl; + set thumbnailUrl(String? thumbnailUrl) => _$this._thumbnailUrl = thumbnailUrl; + + String? _title; + String? get title => _$this._title; + set title(String? title) => _$this._title = title; + + String? _subline; + String? get subline => _$this._subline; + set subline(String? subline) => _$this._subline = subline; + + String? _resourceUrl; + String? get resourceUrl => _$this._resourceUrl; + set resourceUrl(String? resourceUrl) => _$this._resourceUrl = resourceUrl; + + String? _icon; + String? get icon => _$this._icon; + set icon(String? icon) => _$this._icon = icon; + + bool? _rounded; + bool? get rounded => _$this._rounded; + set rounded(bool? rounded) => _$this._rounded = rounded; + + ListBuilder? _attributes; + ListBuilder get attributes => _$this._attributes ??= ListBuilder(); + set attributes(ListBuilder? attributes) => _$this._attributes = attributes; + + CoreUnifiedSearchResultEntryBuilder(); + + CoreUnifiedSearchResultEntryBuilder get _$this { + final $v = _$v; + if ($v != null) { + _thumbnailUrl = $v.thumbnailUrl; + _title = $v.title; + _subline = $v.subline; + _resourceUrl = $v.resourceUrl; + _icon = $v.icon; + _rounded = $v.rounded; + _attributes = $v.attributes.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(CoreUnifiedSearchResultEntry other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$CoreUnifiedSearchResultEntry; + } + + @override + void update(void Function(CoreUnifiedSearchResultEntryBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + CoreUnifiedSearchResultEntry build() => _build(); + + _$CoreUnifiedSearchResultEntry _build() { + _$CoreUnifiedSearchResultEntry _$result; + try { + _$result = _$v ?? + _$CoreUnifiedSearchResultEntry._( + thumbnailUrl: + BuiltValueNullFieldError.checkNotNull(thumbnailUrl, r'CoreUnifiedSearchResultEntry', 'thumbnailUrl'), + title: BuiltValueNullFieldError.checkNotNull(title, r'CoreUnifiedSearchResultEntry', 'title'), + subline: BuiltValueNullFieldError.checkNotNull(subline, r'CoreUnifiedSearchResultEntry', 'subline'), + resourceUrl: + BuiltValueNullFieldError.checkNotNull(resourceUrl, r'CoreUnifiedSearchResultEntry', 'resourceUrl'), + icon: BuiltValueNullFieldError.checkNotNull(icon, r'CoreUnifiedSearchResultEntry', 'icon'), + rounded: BuiltValueNullFieldError.checkNotNull(rounded, r'CoreUnifiedSearchResultEntry', 'rounded'), + attributes: attributes.build()); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'attributes'; + attributes.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'CoreUnifiedSearchResultEntry', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$CoreUnifiedSearchResult_Cursor extends CoreUnifiedSearchResult_Cursor { + @override + final JsonObject data; + @override + final int? $int; + @override + final String? string; + + factory _$CoreUnifiedSearchResult_Cursor([void Function(CoreUnifiedSearchResult_CursorBuilder)? updates]) => + (CoreUnifiedSearchResult_CursorBuilder()..update(updates))._build(); + + _$CoreUnifiedSearchResult_Cursor._({required this.data, this.$int, this.string}) : super._() { + BuiltValueNullFieldError.checkNotNull(data, r'CoreUnifiedSearchResult_Cursor', 'data'); + } + + @override + CoreUnifiedSearchResult_Cursor rebuild(void Function(CoreUnifiedSearchResult_CursorBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + CoreUnifiedSearchResult_CursorBuilder toBuilder() => CoreUnifiedSearchResult_CursorBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is CoreUnifiedSearchResult_Cursor && + data == other.data && + $int == other.$int && + string == other.string; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, data.hashCode); + _$hash = $jc(_$hash, $int.hashCode); + _$hash = $jc(_$hash, string.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'CoreUnifiedSearchResult_Cursor') + ..add('data', data) + ..add('\$int', $int) + ..add('string', string)) + .toString(); + } +} + +class CoreUnifiedSearchResult_CursorBuilder + implements Builder { + _$CoreUnifiedSearchResult_Cursor? _$v; + + JsonObject? _data; + JsonObject? get data => _$this._data; + set data(JsonObject? data) => _$this._data = data; + + int? _$int; + int? get $int => _$this._$int; + set $int(int? $int) => _$this._$int = $int; + + String? _string; + String? get string => _$this._string; + set string(String? string) => _$this._string = string; + + CoreUnifiedSearchResult_CursorBuilder(); + + CoreUnifiedSearchResult_CursorBuilder get _$this { + final $v = _$v; + if ($v != null) { + _data = $v.data; + _$int = $v.$int; + _string = $v.string; + _$v = null; + } + return this; + } + + @override + void replace(CoreUnifiedSearchResult_Cursor other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$CoreUnifiedSearchResult_Cursor; + } + + @override + void update(void Function(CoreUnifiedSearchResult_CursorBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + CoreUnifiedSearchResult_Cursor build() => _build(); + + _$CoreUnifiedSearchResult_Cursor _build() { + final _$result = _$v ?? + _$CoreUnifiedSearchResult_Cursor._( + data: BuiltValueNullFieldError.checkNotNull(data, r'CoreUnifiedSearchResult_Cursor', 'data'), + $int: $int, + string: string); + replace(_$result); + return _$result; + } +} + +class _$CoreUnifiedSearchResult extends CoreUnifiedSearchResult { + @override + final String name; + @override + final bool isPaginated; + @override + final BuiltList entries; + @override + final CoreUnifiedSearchResult_Cursor? cursor; + + factory _$CoreUnifiedSearchResult([void Function(CoreUnifiedSearchResultBuilder)? updates]) => + (CoreUnifiedSearchResultBuilder()..update(updates))._build(); + + _$CoreUnifiedSearchResult._({required this.name, required this.isPaginated, required this.entries, this.cursor}) + : super._() { + BuiltValueNullFieldError.checkNotNull(name, r'CoreUnifiedSearchResult', 'name'); + BuiltValueNullFieldError.checkNotNull(isPaginated, r'CoreUnifiedSearchResult', 'isPaginated'); + BuiltValueNullFieldError.checkNotNull(entries, r'CoreUnifiedSearchResult', 'entries'); + } + + @override + CoreUnifiedSearchResult rebuild(void Function(CoreUnifiedSearchResultBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + CoreUnifiedSearchResultBuilder toBuilder() => CoreUnifiedSearchResultBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is CoreUnifiedSearchResult && + name == other.name && + isPaginated == other.isPaginated && + entries == other.entries && + cursor == other.cursor; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, isPaginated.hashCode); + _$hash = $jc(_$hash, entries.hashCode); + _$hash = $jc(_$hash, cursor.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'CoreUnifiedSearchResult') + ..add('name', name) + ..add('isPaginated', isPaginated) + ..add('entries', entries) + ..add('cursor', cursor)) + .toString(); + } +} + +class CoreUnifiedSearchResultBuilder implements Builder { + _$CoreUnifiedSearchResult? _$v; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + bool? _isPaginated; + bool? get isPaginated => _$this._isPaginated; + set isPaginated(bool? isPaginated) => _$this._isPaginated = isPaginated; + + ListBuilder? _entries; + ListBuilder get entries => + _$this._entries ??= ListBuilder(); + set entries(ListBuilder? entries) => _$this._entries = entries; + + CoreUnifiedSearchResult_CursorBuilder? _cursor; + CoreUnifiedSearchResult_CursorBuilder get cursor => _$this._cursor ??= CoreUnifiedSearchResult_CursorBuilder(); + set cursor(CoreUnifiedSearchResult_CursorBuilder? cursor) => _$this._cursor = cursor; + + CoreUnifiedSearchResultBuilder(); + + CoreUnifiedSearchResultBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _isPaginated = $v.isPaginated; + _entries = $v.entries.toBuilder(); + _cursor = $v.cursor?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(CoreUnifiedSearchResult other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$CoreUnifiedSearchResult; + } + + @override + void update(void Function(CoreUnifiedSearchResultBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + CoreUnifiedSearchResult build() => _build(); + + _$CoreUnifiedSearchResult _build() { + _$CoreUnifiedSearchResult _$result; + try { + _$result = _$v ?? + _$CoreUnifiedSearchResult._( + name: BuiltValueNullFieldError.checkNotNull(name, r'CoreUnifiedSearchResult', 'name'), + isPaginated: + BuiltValueNullFieldError.checkNotNull(isPaginated, r'CoreUnifiedSearchResult', 'isPaginated'), + entries: entries.build(), + cursor: _cursor?.build()); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'entries'; + entries.build(); + _$failedField = 'cursor'; + _cursor?.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'CoreUnifiedSearchResult', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$CoreUnifiedSearchResponse200ApplicationJson_Ocs extends CoreUnifiedSearchResponse200ApplicationJson_Ocs { + @override + final CoreOCSMeta meta; + @override + final CoreUnifiedSearchResult data; + + factory _$CoreUnifiedSearchResponse200ApplicationJson_Ocs( + [void Function(CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder)? updates]) => + (CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder()..update(updates))._build(); + + _$CoreUnifiedSearchResponse200ApplicationJson_Ocs._({required this.meta, required this.data}) : super._() { + BuiltValueNullFieldError.checkNotNull(meta, r'CoreUnifiedSearchResponse200ApplicationJson_Ocs', 'meta'); + BuiltValueNullFieldError.checkNotNull(data, r'CoreUnifiedSearchResponse200ApplicationJson_Ocs', 'data'); + } + + @override + CoreUnifiedSearchResponse200ApplicationJson_Ocs rebuild( + void Function(CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder toBuilder() => + CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is CoreUnifiedSearchResponse200ApplicationJson_Ocs && meta == other.meta && data == other.data; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, meta.hashCode); + _$hash = $jc(_$hash, data.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'CoreUnifiedSearchResponse200ApplicationJson_Ocs') + ..add('meta', meta) + ..add('data', data)) + .toString(); + } +} + +class CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder + implements + Builder { + _$CoreUnifiedSearchResponse200ApplicationJson_Ocs? _$v; + + CoreOCSMetaBuilder? _meta; + CoreOCSMetaBuilder get meta => _$this._meta ??= CoreOCSMetaBuilder(); + set meta(CoreOCSMetaBuilder? meta) => _$this._meta = meta; + + CoreUnifiedSearchResultBuilder? _data; + CoreUnifiedSearchResultBuilder get data => _$this._data ??= CoreUnifiedSearchResultBuilder(); + set data(CoreUnifiedSearchResultBuilder? data) => _$this._data = data; + + CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder(); + + CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder get _$this { + final $v = _$v; + if ($v != null) { + _meta = $v.meta.toBuilder(); + _data = $v.data.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(CoreUnifiedSearchResponse200ApplicationJson_Ocs other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$CoreUnifiedSearchResponse200ApplicationJson_Ocs; + } + + @override + void update(void Function(CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + CoreUnifiedSearchResponse200ApplicationJson_Ocs build() => _build(); + + _$CoreUnifiedSearchResponse200ApplicationJson_Ocs _build() { + _$CoreUnifiedSearchResponse200ApplicationJson_Ocs _$result; + try { + _$result = _$v ?? _$CoreUnifiedSearchResponse200ApplicationJson_Ocs._(meta: meta.build(), data: data.build()); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'meta'; + meta.build(); + _$failedField = 'data'; + data.build(); + } catch (e) { + throw BuiltValueNestedFieldError( + r'CoreUnifiedSearchResponse200ApplicationJson_Ocs', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$CoreUnifiedSearchResponse200ApplicationJson extends CoreUnifiedSearchResponse200ApplicationJson { + @override + final CoreUnifiedSearchResponse200ApplicationJson_Ocs ocs; + + factory _$CoreUnifiedSearchResponse200ApplicationJson( + [void Function(CoreUnifiedSearchResponse200ApplicationJsonBuilder)? updates]) => + (CoreUnifiedSearchResponse200ApplicationJsonBuilder()..update(updates))._build(); + + _$CoreUnifiedSearchResponse200ApplicationJson._({required this.ocs}) : super._() { + BuiltValueNullFieldError.checkNotNull(ocs, r'CoreUnifiedSearchResponse200ApplicationJson', 'ocs'); + } + + @override + CoreUnifiedSearchResponse200ApplicationJson rebuild( + void Function(CoreUnifiedSearchResponse200ApplicationJsonBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + CoreUnifiedSearchResponse200ApplicationJsonBuilder toBuilder() => + CoreUnifiedSearchResponse200ApplicationJsonBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is CoreUnifiedSearchResponse200ApplicationJson && ocs == other.ocs; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, ocs.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'CoreUnifiedSearchResponse200ApplicationJson')..add('ocs', ocs)).toString(); + } +} + +class CoreUnifiedSearchResponse200ApplicationJsonBuilder + implements + Builder { + _$CoreUnifiedSearchResponse200ApplicationJson? _$v; + + CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder? _ocs; + CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder get ocs => + _$this._ocs ??= CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder(); + set ocs(CoreUnifiedSearchResponse200ApplicationJson_OcsBuilder? ocs) => _$this._ocs = ocs; + + CoreUnifiedSearchResponse200ApplicationJsonBuilder(); + + CoreUnifiedSearchResponse200ApplicationJsonBuilder get _$this { + final $v = _$v; + if ($v != null) { + _ocs = $v.ocs.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(CoreUnifiedSearchResponse200ApplicationJson other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$CoreUnifiedSearchResponse200ApplicationJson; + } + + @override + void update(void Function(CoreUnifiedSearchResponse200ApplicationJsonBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + CoreUnifiedSearchResponse200ApplicationJson build() => _build(); + + _$CoreUnifiedSearchResponse200ApplicationJson _build() { + _$CoreUnifiedSearchResponse200ApplicationJson _$result; + try { + _$result = _$v ?? _$CoreUnifiedSearchResponse200ApplicationJson._(ocs: ocs.build()); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'ocs'; + ocs.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'CoreUnifiedSearchResponse200ApplicationJson', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + class _$CoreEmptyOCS_Ocs extends CoreEmptyOCS_Ocs { @override final CoreOCSMeta meta; diff --git a/packages/nextcloud/lib/src/api/core.openapi.json b/packages/nextcloud/lib/src/api/core.openapi.json index fc11a552..182584ba 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.json +++ b/packages/nextcloud/lib/src/api/core.openapi.json @@ -968,6 +968,99 @@ } } } + }, + "UnifiedSearchProvider": { + "type": "object", + "required": [ + "id", + "name", + "order" + ], + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "order": { + "type": "integer", + "format": "int64" + } + } + }, + "UnifiedSearchResult": { + "type": "object", + "required": [ + "name", + "isPaginated", + "entries", + "cursor" + ], + "properties": { + "name": { + "type": "string" + }, + "isPaginated": { + "type": "boolean" + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UnifiedSearchResultEntry" + } + }, + "cursor": { + "nullable": true, + "oneOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "string" + } + ] + } + } + }, + "UnifiedSearchResultEntry": { + "type": "object", + "required": [ + "thumbnailUrl", + "title", + "subline", + "resourceUrl", + "icon", + "rounded", + "attributes" + ], + "properties": { + "thumbnailUrl": { + "type": "string" + }, + "title": { + "type": "string" + }, + "subline": { + "type": "string" + }, + "resourceUrl": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "rounded": { + "type": "boolean" + }, + "attributes": { + "type": "array", + "items": { + "type": "string" + } + } + } } }, "securitySchemes": { @@ -1310,6 +1403,168 @@ } } } + }, + "/ocs/v2.php/search/providers": { + "get": { + "operationId": "unified-search-providers", + "summary": "Get the providers for unified search", + "parameters": [ + { + "name": "from", + "in": "query", + "description": "the url the user is currently at", + "schema": { + "type": "string", + "default": "" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UnifiedSearchProvider" + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/search/providers/{providerId}/search": { + "get": { + "operationId": "unified-search", + "summary": "Search", + "parameters": [ + { + "name": "term", + "in": "query", + "description": "Term to search", + "schema": { + "type": "string", + "default": "" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Order of entries", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum amount of entries", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "cursor", + "in": "query", + "description": "Offset for searching", + "schema": { + "type": "string", + "nullable": true, + "contentMediaType": "application/json", + "contentSchema": { + "nullable": true, + "description": "Offset for searching", + "oneOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "string" + } + ] + } + } + }, + { + "name": "from", + "in": "query", + "description": "The current user URL", + "schema": { + "type": "string", + "default": "" + } + }, + { + "name": "providerId", + "in": "path", + "description": "ID of the provider", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Search entries returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/UnifiedSearchResult" + } + } + } + } + } + } + } + } + } + } } } } diff --git a/packages/nextcloud/test/core_test.dart b/packages/nextcloud/test/core_test.dart index b9d773fb..18289abe 100644 --- a/packages/nextcloud/test/core_test.dart +++ b/packages/nextcloud/test/core_test.dart @@ -131,5 +131,27 @@ Future run(final DockerImage image) async { throwsA(predicate((final e) => (e! as DynamiteApiException).statusCode == 401)), ); }); + + test('Unified search providers', () async { + final response = await client.core.unifiedSearchProviders(); + expect(response.ocs.data, hasLength(13)); + }); + + test('Unified search', () async { + final response = await client.core.unifiedSearch( + providerId: 'settings', + term: 'Personal info', + ); + expect(response.ocs.data.name, 'Settings'); + expect(response.ocs.data.isPaginated, isFalse); + expect(response.ocs.data.entries, hasLength(1)); + expect(response.ocs.data.entries.single.thumbnailUrl, isEmpty); + expect(response.ocs.data.entries.single.title, 'Personal info'); + expect(response.ocs.data.entries.single.subline, isEmpty); + expect(response.ocs.data.entries.single.resourceUrl, isNotEmpty); + expect(response.ocs.data.entries.single.icon, 'icon-settings-dark'); + expect(response.ocs.data.entries.single.rounded, isFalse); + expect(response.ocs.data.entries.single.attributes, isEmpty); + }); }); }