// ignore_for_file: camel_case_types // ignore_for_file: public_member_api_docs import 'dart:convert'; import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:universal_io/io.dart'; export 'package:dynamite_runtime/http_client.dart'; part 'user_status.openapi.g.dart'; class UserStatusResponse extends DynamiteResponse { UserStatusResponse( super.data, super.headers, ); @override String toString() => 'UserStatusResponse(data: $data, headers: $headers)'; } class UserStatusApiException extends DynamiteApiException { UserStatusApiException( super.statusCode, super.headers, super.body, ); static Future fromResponse(final HttpClientResponse response) async { final data = await response.bodyBytes; String body; try { body = utf8.decode(data); } on FormatException { body = 'binary'; } return UserStatusApiException( response.statusCode, response.responseHeaders, body, ); } @override String toString() => 'UserStatusApiException(statusCode: $statusCode, headers: $headers, body: $body)'; } class UserStatusClient extends DynamiteClient { UserStatusClient( super.baseURL, { super.baseHeaders, super.userAgent, super.httpClient, super.cookieJar, super.authentications, }); UserStatusClient.fromClient(final DynamiteClient client) : super( client.baseURL, baseHeaders: client.baseHeaders, httpClient: client.httpClient, cookieJar: client.cookieJar, authentications: client.authentications, ); Future getPublicStatuses() async { const path = '/ocs/v2.php/apps/user_status/api/v1/statuses'; 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 } 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(UserStatusGetPublicStatuses), )! as UserStatusGetPublicStatuses; } throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line } Future getPublicStatus({required final String userId}) async { var path = '/ocs/v2.php/apps/user_status/api/v1/statuses/{userId}'; 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('{userId}', Uri.encodeQueryComponent(userId)); 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(UserStatusGetPublicStatus), )! as UserStatusGetPublicStatus; } throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line } Future getStatus() async { const path = '/ocs/v2.php/apps/user_status/api/v1/user_status'; 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 } 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(UserStatusGetStatus))! as UserStatusGetStatus; } throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line } Future setStatus({required final UserStatusType statusType}) async { const path = '/ocs/v2.php/apps/user_status/api/v1/user_status/status'; 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 } queryParameters['statusType'] = statusType.name; final response = await doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), headers, body, ); if (response.statusCode == 200) { return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(UserStatusGetStatus))! as UserStatusGetStatus; } throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line } Future setPredefinedMessage({ required final String messageId, final int? clearAt, }) async { const path = '/ocs/v2.php/apps/user_status/api/v1/user_status/message/predefined'; 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 } queryParameters['messageId'] = messageId; if (clearAt != null) { queryParameters['clearAt'] = clearAt.toString(); } final response = await doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), headers, body, ); if (response.statusCode == 200) { return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(UserStatusGetStatus))! as UserStatusGetStatus; } throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line } Future setCustomMessage({ final String? statusIcon, final String? message, final int? clearAt, }) async { const path = '/ocs/v2.php/apps/user_status/api/v1/user_status/message/custom'; 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 (statusIcon != null) { queryParameters['statusIcon'] = statusIcon; } if (message != null) { queryParameters['message'] = message; } if (clearAt != null) { queryParameters['clearAt'] = clearAt.toString(); } final response = await doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), headers, body, ); if (response.statusCode == 200) { return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(UserStatusGetStatus))! as UserStatusGetStatus; } throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line } Future clearMessage() async { const path = '/ocs/v2.php/apps/user_status/api/v1/user_status/message'; final queryParameters = {}; final headers = {}; 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 } final response = await doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), headers, body, ); if (response.statusCode == 200) { return; } throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line } Future getPredefinedStatuses() async { const path = '/ocs/v2.php/apps/user_status/api/v1/predefined_statuses'; 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 } 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(UserStatusPredefinedStatuses), )! as UserStatusPredefinedStatuses; } throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line } Future heartbeat({required final UserStatusType status}) async { const path = '/ocs/v2.php/apps/user_status/api/v1/heartbeat'; 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 } queryParameters['status'] = status.name; final response = await doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), headers, body, ); if (response.statusCode == 200) { return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(UserStatusHeartbeat))! as UserStatusHeartbeat; } throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line } } abstract class UserStatusOCSMeta implements Built { factory UserStatusOCSMeta([final void Function(UserStatusOCSMetaBuilder)? b]) = _$UserStatusOCSMeta; const UserStatusOCSMeta._(); factory UserStatusOCSMeta.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; String get status; int get statuscode; String? get message; String? get totalitems; String? get itemsperpage; static Serializer get serializer => _$userStatusOCSMetaSerializer; } class UserStatusClearAt_Type extends EnumClass { const UserStatusClearAt_Type._(super.name); static const UserStatusClearAt_Type period = _$userStatusClearAtTypePeriod; @BuiltValueEnumConst(wireName: 'end-of') static const UserStatusClearAt_Type endOf = _$userStatusClearAtTypeEndOf; static BuiltSet get values => _$userStatusClearAtTypeValues; static UserStatusClearAt_Type valueOf(final String name) => _$valueOfUserStatusClearAt_Type(name); static Serializer get serializer => _$userStatusClearAtTypeSerializer; } class UserStatusClearAt_Time0 extends EnumClass { const UserStatusClearAt_Time0._(super.name); static const UserStatusClearAt_Time0 day = _$userStatusClearAtTime0Day; static const UserStatusClearAt_Time0 week = _$userStatusClearAtTime0Week; static BuiltSet get values => _$userStatusClearAtTime0Values; static UserStatusClearAt_Time0 valueOf(final String name) => _$valueOfUserStatusClearAt_Time0(name); static Serializer get serializer => _$userStatusClearAtTime0Serializer; } abstract class UserStatusClearAt_Time implements Built { factory UserStatusClearAt_Time([final void Function(UserStatusClearAt_TimeBuilder)? b]) = _$UserStatusClearAt_Time; const UserStatusClearAt_Time._(); JsonObject get data; UserStatusClearAt_Time0? get clearAtTime0; /// Time offset in seconds int? get $int; static UserStatusClearAt_Time fromJson(final Object json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$UserStatusClearAt_TimeSerializer(); } class _$UserStatusClearAt_TimeSerializer implements PrimitiveSerializer { @override final Iterable types = const [UserStatusClearAt_Time, _$UserStatusClearAt_Time]; @override final String wireName = 'UserStatusClearAt_Time'; @override Object serialize( final Serializers serializers, final UserStatusClearAt_Time object, { final FullType specifiedType = FullType.unspecified, }) => object.data.value; @override UserStatusClearAt_Time deserialize( final Serializers serializers, final Object data, { final FullType specifiedType = FullType.unspecified, }) { final result = UserStatusClearAt_TimeBuilder()..data = JsonObject(data); try { result._clearAtTime0 = _jsonSerializers.deserialize( data, specifiedType: const FullType(UserStatusClearAt_Time0), )! as UserStatusClearAt_Time0; } catch (_) {} try { result._$int = data as int?; } catch (_) {} assert( [result._clearAtTime0, result._$int].where((final x) => x != null).isNotEmpty, 'Need oneOf for ${result._data}', ); return result.build(); } } abstract class UserStatusClearAt implements Built { factory UserStatusClearAt([final void Function(UserStatusClearAtBuilder)? b]) = _$UserStatusClearAt; const UserStatusClearAt._(); factory UserStatusClearAt.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusClearAt_Type get type; UserStatusClearAt_Time get time; static Serializer get serializer => _$userStatusClearAtSerializer; } abstract class UserStatusPublicStatus_ClearAt implements Built { factory UserStatusPublicStatus_ClearAt([final void Function(UserStatusPublicStatus_ClearAtBuilder)? b]) = _$UserStatusPublicStatus_ClearAt; const UserStatusPublicStatus_ClearAt._(); JsonObject get data; UserStatusClearAt? get clearAt; /// Time as unix timestamp int? get $int; static UserStatusPublicStatus_ClearAt fromJson(final Object json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$UserStatusPublicStatus_ClearAtSerializer(); } class _$UserStatusPublicStatus_ClearAtSerializer implements PrimitiveSerializer { @override final Iterable types = const [UserStatusPublicStatus_ClearAt, _$UserStatusPublicStatus_ClearAt]; @override final String wireName = 'UserStatusPublicStatus_ClearAt'; @override Object serialize( final Serializers serializers, final UserStatusPublicStatus_ClearAt object, { final FullType specifiedType = FullType.unspecified, }) => object.data.value; @override UserStatusPublicStatus_ClearAt deserialize( final Serializers serializers, final Object data, { final FullType specifiedType = FullType.unspecified, }) { final result = UserStatusPublicStatus_ClearAtBuilder()..data = JsonObject(data); try { result._clearAt = (_jsonSerializers.deserialize(data, specifiedType: const FullType(UserStatusClearAt))! as UserStatusClearAt) .toBuilder(); } catch (_) {} try { result._$int = data as int?; } catch (_) {} assert([result._clearAt, result._$int].where((final x) => x != null).isNotEmpty, 'Need oneOf for ${result._data}'); return result.build(); } } class UserStatusType extends EnumClass { const UserStatusType._(super.name); static const UserStatusType online = _$userStatusTypeOnline; static const UserStatusType offline = _$userStatusTypeOffline; static const UserStatusType dnd = _$userStatusTypeDnd; static const UserStatusType away = _$userStatusTypeAway; static const UserStatusType invisible = _$userStatusTypeInvisible; static BuiltSet get values => _$userStatusTypeValues; static UserStatusType valueOf(final String name) => _$valueOfUserStatusType(name); static Serializer get serializer => _$userStatusTypeSerializer; } abstract class UserStatusPublicStatus implements Built { factory UserStatusPublicStatus([final void Function(UserStatusPublicStatusBuilder)? b]) = _$UserStatusPublicStatus; const UserStatusPublicStatus._(); factory UserStatusPublicStatus.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; String get userId; String? get message; String? get icon; UserStatusPublicStatus_ClearAt? get clearAt; UserStatusType get status; static Serializer get serializer => _$userStatusPublicStatusSerializer; } abstract class UserStatusGetPublicStatuses_Ocs implements Built { factory UserStatusGetPublicStatuses_Ocs([final void Function(UserStatusGetPublicStatuses_OcsBuilder)? b]) = _$UserStatusGetPublicStatuses_Ocs; const UserStatusGetPublicStatuses_Ocs._(); factory UserStatusGetPublicStatuses_Ocs.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusOCSMeta get meta; BuiltList get data; static Serializer get serializer => _$userStatusGetPublicStatusesOcsSerializer; } abstract class UserStatusGetPublicStatuses implements Built { factory UserStatusGetPublicStatuses([final void Function(UserStatusGetPublicStatusesBuilder)? b]) = _$UserStatusGetPublicStatuses; const UserStatusGetPublicStatuses._(); factory UserStatusGetPublicStatuses.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusGetPublicStatuses_Ocs get ocs; static Serializer get serializer => _$userStatusGetPublicStatusesSerializer; } abstract class UserStatusGetPublicStatus_Ocs_Data implements Built { factory UserStatusGetPublicStatus_Ocs_Data([final void Function(UserStatusGetPublicStatus_Ocs_DataBuilder)? b]) = _$UserStatusGetPublicStatus_Ocs_Data; const UserStatusGetPublicStatus_Ocs_Data._(); JsonObject get data; BuiltList? get builtListJsonObject; UserStatusPublicStatus? get publicStatus; static UserStatusGetPublicStatus_Ocs_Data fromJson(final Object json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$UserStatusGetPublicStatus_Ocs_DataSerializer(); } class _$UserStatusGetPublicStatus_Ocs_DataSerializer implements PrimitiveSerializer { @override final Iterable types = const [UserStatusGetPublicStatus_Ocs_Data, _$UserStatusGetPublicStatus_Ocs_Data]; @override final String wireName = 'UserStatusGetPublicStatus_Ocs_Data'; @override Object serialize( final Serializers serializers, final UserStatusGetPublicStatus_Ocs_Data object, { final FullType specifiedType = FullType.unspecified, }) => object.data.value; @override UserStatusGetPublicStatus_Ocs_Data deserialize( final Serializers serializers, final Object data, { final FullType specifiedType = FullType.unspecified, }) { final result = UserStatusGetPublicStatus_Ocs_DataBuilder()..data = JsonObject(data); try { result._builtListJsonObject = (_jsonSerializers.deserialize( data, specifiedType: const FullType(BuiltList, [FullType(JsonObject)]), )! as BuiltList) .toBuilder(); } catch (_) {} try { result._publicStatus = (_jsonSerializers.deserialize(data, specifiedType: const FullType(UserStatusPublicStatus))! as UserStatusPublicStatus) .toBuilder(); } catch (_) {} assert( [result._builtListJsonObject, result._publicStatus].where((final x) => x != null).isNotEmpty, 'Need oneOf for ${result._data}', ); return result.build(); } } abstract class UserStatusGetPublicStatus_Ocs implements Built { factory UserStatusGetPublicStatus_Ocs([final void Function(UserStatusGetPublicStatus_OcsBuilder)? b]) = _$UserStatusGetPublicStatus_Ocs; const UserStatusGetPublicStatus_Ocs._(); factory UserStatusGetPublicStatus_Ocs.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusOCSMeta get meta; UserStatusGetPublicStatus_Ocs_Data get data; static Serializer get serializer => _$userStatusGetPublicStatusOcsSerializer; } abstract class UserStatusGetPublicStatus implements Built { factory UserStatusGetPublicStatus([final void Function(UserStatusGetPublicStatusBuilder)? b]) = _$UserStatusGetPublicStatus; const UserStatusGetPublicStatus._(); factory UserStatusGetPublicStatus.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusGetPublicStatus_Ocs get ocs; static Serializer get serializer => _$userStatusGetPublicStatusSerializer; } abstract class UserStatusStatus1 implements Built { factory UserStatusStatus1([final void Function(UserStatusStatus1Builder)? b]) = _$UserStatusStatus1; const UserStatusStatus1._(); factory UserStatusStatus1.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; String? get messageId; bool get messageIsPredefined; bool get statusIsUserDefined; static Serializer get serializer => _$userStatusStatus1Serializer; } abstract class UserStatusStatus implements Built { factory UserStatusStatus([final void Function(UserStatusStatusBuilder)? b]) = _$UserStatusStatus; const UserStatusStatus._(); JsonObject get data; UserStatusPublicStatus get publicStatus; UserStatusStatus1 get status1; static UserStatusStatus fromJson(final Object json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$UserStatusStatusSerializer(); } class _$UserStatusStatusSerializer implements PrimitiveSerializer { @override final Iterable types = const [UserStatusStatus, _$UserStatusStatus]; @override final String wireName = 'UserStatusStatus'; @override Object serialize( final Serializers serializers, final UserStatusStatus object, { final FullType specifiedType = FullType.unspecified, }) => object.data.value; @override UserStatusStatus deserialize( final Serializers serializers, final Object data, { final FullType specifiedType = FullType.unspecified, }) { final result = UserStatusStatusBuilder()..data = JsonObject(data); result.publicStatus.replace( _jsonSerializers.deserialize( data, specifiedType: const FullType(UserStatusPublicStatus), )! as UserStatusPublicStatus, ); result.status1.replace( _jsonSerializers.deserialize(data, specifiedType: const FullType(UserStatusStatus1))! as UserStatusStatus1, ); return result.build(); } } abstract class UserStatusGetStatus_Ocs_Data implements Built { factory UserStatusGetStatus_Ocs_Data([final void Function(UserStatusGetStatus_Ocs_DataBuilder)? b]) = _$UserStatusGetStatus_Ocs_Data; const UserStatusGetStatus_Ocs_Data._(); JsonObject get data; BuiltList? get builtListJsonObject; UserStatusStatus? get status; static UserStatusGetStatus_Ocs_Data fromJson(final Object json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$UserStatusGetStatus_Ocs_DataSerializer(); } class _$UserStatusGetStatus_Ocs_DataSerializer implements PrimitiveSerializer { @override final Iterable types = const [UserStatusGetStatus_Ocs_Data, _$UserStatusGetStatus_Ocs_Data]; @override final String wireName = 'UserStatusGetStatus_Ocs_Data'; @override Object serialize( final Serializers serializers, final UserStatusGetStatus_Ocs_Data object, { final FullType specifiedType = FullType.unspecified, }) => object.data.value; @override UserStatusGetStatus_Ocs_Data deserialize( final Serializers serializers, final Object data, { final FullType specifiedType = FullType.unspecified, }) { final result = UserStatusGetStatus_Ocs_DataBuilder()..data = JsonObject(data); try { result._builtListJsonObject = (_jsonSerializers.deserialize( data, specifiedType: const FullType(BuiltList, [FullType(JsonObject)]), )! as BuiltList) .toBuilder(); } catch (_) {} try { result._status = (_jsonSerializers.deserialize(data, specifiedType: const FullType(UserStatusStatus))! as UserStatusStatus) .toBuilder(); } catch (_) {} assert( [result._builtListJsonObject, result._status].where((final x) => x != null).isNotEmpty, 'Need oneOf for ${result._data}', ); return result.build(); } } abstract class UserStatusGetStatus_Ocs implements Built { factory UserStatusGetStatus_Ocs([final void Function(UserStatusGetStatus_OcsBuilder)? b]) = _$UserStatusGetStatus_Ocs; const UserStatusGetStatus_Ocs._(); factory UserStatusGetStatus_Ocs.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusOCSMeta get meta; UserStatusGetStatus_Ocs_Data get data; static Serializer get serializer => _$userStatusGetStatusOcsSerializer; } abstract class UserStatusGetStatus implements Built { factory UserStatusGetStatus([final void Function(UserStatusGetStatusBuilder)? b]) = _$UserStatusGetStatus; const UserStatusGetStatus._(); factory UserStatusGetStatus.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusGetStatus_Ocs get ocs; static Serializer get serializer => _$userStatusGetStatusSerializer; } abstract class UserStatusPredefinedStatus_ClearAt implements Built { factory UserStatusPredefinedStatus_ClearAt([final void Function(UserStatusPredefinedStatus_ClearAtBuilder)? b]) = _$UserStatusPredefinedStatus_ClearAt; const UserStatusPredefinedStatus_ClearAt._(); JsonObject get data; UserStatusClearAt? get clearAt; /// Time as unix timestamp int? get $int; static UserStatusPredefinedStatus_ClearAt fromJson(final Object json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$UserStatusPredefinedStatus_ClearAtSerializer(); } class _$UserStatusPredefinedStatus_ClearAtSerializer implements PrimitiveSerializer { @override final Iterable types = const [UserStatusPredefinedStatus_ClearAt, _$UserStatusPredefinedStatus_ClearAt]; @override final String wireName = 'UserStatusPredefinedStatus_ClearAt'; @override Object serialize( final Serializers serializers, final UserStatusPredefinedStatus_ClearAt object, { final FullType specifiedType = FullType.unspecified, }) => object.data.value; @override UserStatusPredefinedStatus_ClearAt deserialize( final Serializers serializers, final Object data, { final FullType specifiedType = FullType.unspecified, }) { final result = UserStatusPredefinedStatus_ClearAtBuilder()..data = JsonObject(data); try { result._clearAt = (_jsonSerializers.deserialize(data, specifiedType: const FullType(UserStatusClearAt))! as UserStatusClearAt) .toBuilder(); } catch (_) {} try { result._$int = data as int?; } catch (_) {} assert([result._clearAt, result._$int].where((final x) => x != null).isNotEmpty, 'Need oneOf for ${result._data}'); return result.build(); } } abstract class UserStatusPredefinedStatus implements Built { factory UserStatusPredefinedStatus([final void Function(UserStatusPredefinedStatusBuilder)? b]) = _$UserStatusPredefinedStatus; const UserStatusPredefinedStatus._(); factory UserStatusPredefinedStatus.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; String get id; String get icon; String get message; UserStatusPredefinedStatus_ClearAt? get clearAt; static Serializer get serializer => _$userStatusPredefinedStatusSerializer; } abstract class UserStatusPredefinedStatuses_Ocs implements Built { factory UserStatusPredefinedStatuses_Ocs([final void Function(UserStatusPredefinedStatuses_OcsBuilder)? b]) = _$UserStatusPredefinedStatuses_Ocs; const UserStatusPredefinedStatuses_Ocs._(); factory UserStatusPredefinedStatuses_Ocs.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusOCSMeta get meta; BuiltList get data; static Serializer get serializer => _$userStatusPredefinedStatusesOcsSerializer; } abstract class UserStatusPredefinedStatuses implements Built { factory UserStatusPredefinedStatuses([final void Function(UserStatusPredefinedStatusesBuilder)? b]) = _$UserStatusPredefinedStatuses; const UserStatusPredefinedStatuses._(); factory UserStatusPredefinedStatuses.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusPredefinedStatuses_Ocs get ocs; static Serializer get serializer => _$userStatusPredefinedStatusesSerializer; } abstract class UserStatusHeartbeat_Ocs_Data implements Built { factory UserStatusHeartbeat_Ocs_Data([final void Function(UserStatusHeartbeat_Ocs_DataBuilder)? b]) = _$UserStatusHeartbeat_Ocs_Data; const UserStatusHeartbeat_Ocs_Data._(); JsonObject get data; BuiltList? get builtListJsonObject; UserStatusStatus? get status; static UserStatusHeartbeat_Ocs_Data fromJson(final Object json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$UserStatusHeartbeat_Ocs_DataSerializer(); } class _$UserStatusHeartbeat_Ocs_DataSerializer implements PrimitiveSerializer { @override final Iterable types = const [UserStatusHeartbeat_Ocs_Data, _$UserStatusHeartbeat_Ocs_Data]; @override final String wireName = 'UserStatusHeartbeat_Ocs_Data'; @override Object serialize( final Serializers serializers, final UserStatusHeartbeat_Ocs_Data object, { final FullType specifiedType = FullType.unspecified, }) => object.data.value; @override UserStatusHeartbeat_Ocs_Data deserialize( final Serializers serializers, final Object data, { final FullType specifiedType = FullType.unspecified, }) { final result = UserStatusHeartbeat_Ocs_DataBuilder()..data = JsonObject(data); try { result._builtListJsonObject = (_jsonSerializers.deserialize( data, specifiedType: const FullType(BuiltList, [FullType(JsonObject)]), )! as BuiltList) .toBuilder(); } catch (_) {} try { result._status = (_jsonSerializers.deserialize(data, specifiedType: const FullType(UserStatusStatus))! as UserStatusStatus) .toBuilder(); } catch (_) {} assert( [result._builtListJsonObject, result._status].where((final x) => x != null).isNotEmpty, 'Need oneOf for ${result._data}', ); return result.build(); } } abstract class UserStatusHeartbeat_Ocs implements Built { factory UserStatusHeartbeat_Ocs([final void Function(UserStatusHeartbeat_OcsBuilder)? b]) = _$UserStatusHeartbeat_Ocs; const UserStatusHeartbeat_Ocs._(); factory UserStatusHeartbeat_Ocs.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusOCSMeta get meta; UserStatusHeartbeat_Ocs_Data get data; static Serializer get serializer => _$userStatusHeartbeatOcsSerializer; } abstract class UserStatusHeartbeat implements Built { factory UserStatusHeartbeat([final void Function(UserStatusHeartbeatBuilder)? b]) = _$UserStatusHeartbeat; const UserStatusHeartbeat._(); factory UserStatusHeartbeat.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusHeartbeat_Ocs get ocs; static Serializer get serializer => _$userStatusHeartbeatSerializer; } abstract class UserStatusEmptyOCS_Ocs implements Built { factory UserStatusEmptyOCS_Ocs([final void Function(UserStatusEmptyOCS_OcsBuilder)? b]) = _$UserStatusEmptyOCS_Ocs; const UserStatusEmptyOCS_Ocs._(); factory UserStatusEmptyOCS_Ocs.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusOCSMeta get meta; BuiltList get data; static Serializer get serializer => _$userStatusEmptyOCSOcsSerializer; } abstract class UserStatusEmptyOCS implements Built { factory UserStatusEmptyOCS([final void Function(UserStatusEmptyOCSBuilder)? b]) = _$UserStatusEmptyOCS; const UserStatusEmptyOCS._(); factory UserStatusEmptyOCS.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; UserStatusEmptyOCS_Ocs get ocs; static Serializer get serializer => _$userStatusEmptyOCSSerializer; } @SerializersFor([ UserStatusGetPublicStatuses, UserStatusGetPublicStatuses_Ocs, UserStatusOCSMeta, UserStatusPublicStatus, UserStatusClearAt, UserStatusGetPublicStatus, UserStatusGetPublicStatus_Ocs, UserStatusGetStatus, UserStatusGetStatus_Ocs, UserStatusStatus1, UserStatusPredefinedStatuses, UserStatusPredefinedStatuses_Ocs, UserStatusPredefinedStatus, UserStatusHeartbeat, UserStatusHeartbeat_Ocs, UserStatusEmptyOCS, UserStatusEmptyOCS_Ocs, ]) final Serializers _serializers = (_$_serializers.toBuilder() ..addBuilderFactory(const FullType(UserStatusGetPublicStatuses), UserStatusGetPublicStatuses.new) ..addBuilderFactory(const FullType(UserStatusGetPublicStatus), UserStatusGetPublicStatus.new) ..addBuilderFactory(const FullType(UserStatusGetStatus), UserStatusGetStatus.new) ..addBuilderFactory(const FullType(UserStatusPredefinedStatuses), UserStatusPredefinedStatuses.new) ..addBuilderFactory(const FullType(UserStatusHeartbeat), UserStatusHeartbeat.new)) .build(); Serializers get userStatusSerializers => _serializers; final Serializers _jsonSerializers = (_serializers.toBuilder() ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); // coverage:ignore-start T deserializeUserStatus(final Object data) => _serializers.deserialize(data, specifiedType: FullType(T))! as T; Object? serializeUserStatus(final T data) => _serializers.serialize(data, specifiedType: FullType(T)); // coverage:ignore-end