diff --git a/lib/src/v3/api/community.dart b/lib/src/v3/api/community.dart index d81fd3f..533e67a 100644 --- a/lib/src/v3/api/community.dart +++ b/lib/src/v3/api/community.dart @@ -48,6 +48,7 @@ class CreateCommunity String? icon, String? banner, bool? nsfw, + bool? postingRestrictedToMods, required String auth, }) = _CreateCommunity; @@ -163,6 +164,7 @@ class EditCommunity String? icon, String? banner, bool? nsfw, + bool? postingRestrictedToMods, required String auth, }) = _EditCommunity; diff --git a/lib/src/v3/api/community.freezed.dart b/lib/src/v3/api/community.freezed.dart index e2df3f5..bb7cda5 100644 --- a/lib/src/v3/api/community.freezed.dart +++ b/lib/src/v3/api/community.freezed.dart @@ -199,6 +199,7 @@ mixin _$CreateCommunity { String? get icon => throw _privateConstructorUsedError; String? get banner => throw _privateConstructorUsedError; bool? get nsfw => throw _privateConstructorUsedError; + bool? get postingRestrictedToMods => throw _privateConstructorUsedError; String get auth => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @@ -219,6 +220,7 @@ abstract class $CreateCommunityCopyWith<$Res> { String? icon, String? banner, bool? nsfw, + bool? postingRestrictedToMods, String auth}); } @@ -239,6 +241,7 @@ class _$CreateCommunityCopyWithImpl<$Res> Object? icon = freezed, Object? banner = freezed, Object? nsfw = freezed, + Object? postingRestrictedToMods = freezed, Object? auth = freezed, }) { return _then(_value.copyWith( @@ -266,6 +269,10 @@ class _$CreateCommunityCopyWithImpl<$Res> ? _value.nsfw : nsfw // ignore: cast_nullable_to_non_nullable as bool?, + postingRestrictedToMods: postingRestrictedToMods == freezed + ? _value.postingRestrictedToMods + : postingRestrictedToMods // ignore: cast_nullable_to_non_nullable + as bool?, auth: auth == freezed ? _value.auth : auth // ignore: cast_nullable_to_non_nullable @@ -288,6 +295,7 @@ abstract class _$$_CreateCommunityCopyWith<$Res> String? icon, String? banner, bool? nsfw, + bool? postingRestrictedToMods, String auth}); } @@ -310,6 +318,7 @@ class __$$_CreateCommunityCopyWithImpl<$Res> Object? icon = freezed, Object? banner = freezed, Object? nsfw = freezed, + Object? postingRestrictedToMods = freezed, Object? auth = freezed, }) { return _then(_$_CreateCommunity( @@ -337,6 +346,10 @@ class __$$_CreateCommunityCopyWithImpl<$Res> ? _value.nsfw : nsfw // ignore: cast_nullable_to_non_nullable as bool?, + postingRestrictedToMods: postingRestrictedToMods == freezed + ? _value.postingRestrictedToMods + : postingRestrictedToMods // ignore: cast_nullable_to_non_nullable + as bool?, auth: auth == freezed ? _value.auth : auth // ignore: cast_nullable_to_non_nullable @@ -356,6 +369,7 @@ class _$_CreateCommunity extends _CreateCommunity { this.icon, this.banner, this.nsfw, + this.postingRestrictedToMods, required this.auth}) : super._(); @@ -375,11 +389,13 @@ class _$_CreateCommunity extends _CreateCommunity { @override final bool? nsfw; @override + final bool? postingRestrictedToMods; + @override final String auth; @override String toString() { - return 'CreateCommunity(name: $name, title: $title, description: $description, icon: $icon, banner: $banner, nsfw: $nsfw, auth: $auth)'; + return 'CreateCommunity(name: $name, title: $title, description: $description, icon: $icon, banner: $banner, nsfw: $nsfw, postingRestrictedToMods: $postingRestrictedToMods, auth: $auth)'; } @override @@ -394,6 +410,8 @@ class _$_CreateCommunity extends _CreateCommunity { const DeepCollectionEquality().equals(other.icon, icon) && const DeepCollectionEquality().equals(other.banner, banner) && const DeepCollectionEquality().equals(other.nsfw, nsfw) && + const DeepCollectionEquality().equals( + other.postingRestrictedToMods, postingRestrictedToMods) && const DeepCollectionEquality().equals(other.auth, auth)); } @@ -407,6 +425,7 @@ class _$_CreateCommunity extends _CreateCommunity { const DeepCollectionEquality().hash(icon), const DeepCollectionEquality().hash(banner), const DeepCollectionEquality().hash(nsfw), + const DeepCollectionEquality().hash(postingRestrictedToMods), const DeepCollectionEquality().hash(auth)); @JsonKey(ignore: true) @@ -430,6 +449,7 @@ abstract class _CreateCommunity extends CreateCommunity { final String? icon, final String? banner, final bool? nsfw, + final bool? postingRestrictedToMods, required final String auth}) = _$_CreateCommunity; const _CreateCommunity._() : super._(); @@ -449,6 +469,8 @@ abstract class _CreateCommunity extends CreateCommunity { @override bool? get nsfw; @override + bool? get postingRestrictedToMods; + @override String get auth; @override @JsonKey(ignore: true) @@ -1166,6 +1188,7 @@ mixin _$EditCommunity { String? get icon => throw _privateConstructorUsedError; String? get banner => throw _privateConstructorUsedError; bool? get nsfw => throw _privateConstructorUsedError; + bool? get postingRestrictedToMods => throw _privateConstructorUsedError; String get auth => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @@ -1186,6 +1209,7 @@ abstract class $EditCommunityCopyWith<$Res> { String? icon, String? banner, bool? nsfw, + bool? postingRestrictedToMods, String auth}); } @@ -1206,6 +1230,7 @@ class _$EditCommunityCopyWithImpl<$Res> Object? icon = freezed, Object? banner = freezed, Object? nsfw = freezed, + Object? postingRestrictedToMods = freezed, Object? auth = freezed, }) { return _then(_value.copyWith( @@ -1233,6 +1258,10 @@ class _$EditCommunityCopyWithImpl<$Res> ? _value.nsfw : nsfw // ignore: cast_nullable_to_non_nullable as bool?, + postingRestrictedToMods: postingRestrictedToMods == freezed + ? _value.postingRestrictedToMods + : postingRestrictedToMods // ignore: cast_nullable_to_non_nullable + as bool?, auth: auth == freezed ? _value.auth : auth // ignore: cast_nullable_to_non_nullable @@ -1255,6 +1284,7 @@ abstract class _$$_EditCommunityCopyWith<$Res> String? icon, String? banner, bool? nsfw, + bool? postingRestrictedToMods, String auth}); } @@ -1277,6 +1307,7 @@ class __$$_EditCommunityCopyWithImpl<$Res> Object? icon = freezed, Object? banner = freezed, Object? nsfw = freezed, + Object? postingRestrictedToMods = freezed, Object? auth = freezed, }) { return _then(_$_EditCommunity( @@ -1304,6 +1335,10 @@ class __$$_EditCommunityCopyWithImpl<$Res> ? _value.nsfw : nsfw // ignore: cast_nullable_to_non_nullable as bool?, + postingRestrictedToMods: postingRestrictedToMods == freezed + ? _value.postingRestrictedToMods + : postingRestrictedToMods // ignore: cast_nullable_to_non_nullable + as bool?, auth: auth == freezed ? _value.auth : auth // ignore: cast_nullable_to_non_nullable @@ -1323,6 +1358,7 @@ class _$_EditCommunity extends _EditCommunity { this.icon, this.banner, this.nsfw, + this.postingRestrictedToMods, required this.auth}) : super._(); @@ -1342,11 +1378,13 @@ class _$_EditCommunity extends _EditCommunity { @override final bool? nsfw; @override + final bool? postingRestrictedToMods; + @override final String auth; @override String toString() { - return 'EditCommunity(communityId: $communityId, title: $title, description: $description, icon: $icon, banner: $banner, nsfw: $nsfw, auth: $auth)'; + return 'EditCommunity(communityId: $communityId, title: $title, description: $description, icon: $icon, banner: $banner, nsfw: $nsfw, postingRestrictedToMods: $postingRestrictedToMods, auth: $auth)'; } @override @@ -1362,6 +1400,8 @@ class _$_EditCommunity extends _EditCommunity { const DeepCollectionEquality().equals(other.icon, icon) && const DeepCollectionEquality().equals(other.banner, banner) && const DeepCollectionEquality().equals(other.nsfw, nsfw) && + const DeepCollectionEquality().equals( + other.postingRestrictedToMods, postingRestrictedToMods) && const DeepCollectionEquality().equals(other.auth, auth)); } @@ -1375,6 +1415,7 @@ class _$_EditCommunity extends _EditCommunity { const DeepCollectionEquality().hash(icon), const DeepCollectionEquality().hash(banner), const DeepCollectionEquality().hash(nsfw), + const DeepCollectionEquality().hash(postingRestrictedToMods), const DeepCollectionEquality().hash(auth)); @JsonKey(ignore: true) @@ -1398,6 +1439,7 @@ abstract class _EditCommunity extends EditCommunity { final String? icon, final String? banner, final bool? nsfw, + final bool? postingRestrictedToMods, required final String auth}) = _$_EditCommunity; const _EditCommunity._() : super._(); @@ -1417,6 +1459,8 @@ abstract class _EditCommunity extends EditCommunity { @override bool? get nsfw; @override + bool? get postingRestrictedToMods; + @override String get auth; @override @JsonKey(ignore: true) diff --git a/lib/src/v3/api/community.g.dart b/lib/src/v3/api/community.g.dart index 185a2a5..1c67cde 100644 --- a/lib/src/v3/api/community.g.dart +++ b/lib/src/v3/api/community.g.dart @@ -36,6 +36,7 @@ _$_CreateCommunity _$$_CreateCommunityFromJson(Map json) => icon: json['icon'] as String?, banner: json['banner'] as String?, nsfw: json['nsfw'] as bool?, + postingRestrictedToMods: json['posting_restricted_to_mods'] as bool?, auth: json['auth'] as String, ); @@ -55,6 +56,7 @@ Map _$$_CreateCommunityToJson(_$_CreateCommunity instance) { writeNotNull('icon', instance.icon); writeNotNull('banner', instance.banner); writeNotNull('nsfw', instance.nsfw); + writeNotNull('posting_restricted_to_mods', instance.postingRestrictedToMods); val['auth'] = instance.auth; return val; } @@ -145,6 +147,7 @@ _$_EditCommunity _$$_EditCommunityFromJson(Map json) => icon: json['icon'] as String?, banner: json['banner'] as String?, nsfw: json['nsfw'] as bool?, + postingRestrictedToMods: json['posting_restricted_to_mods'] as bool?, auth: json['auth'] as String, ); @@ -164,6 +167,7 @@ Map _$$_EditCommunityToJson(_$_EditCommunity instance) { writeNotNull('icon', instance.icon); writeNotNull('banner', instance.banner); writeNotNull('nsfw', instance.nsfw); + writeNotNull('posting_restricted_to_mods', instance.postingRestrictedToMods); val['auth'] = instance.auth; return val; } diff --git a/lib/src/v3/models/source.dart b/lib/src/v3/models/source.dart index 2b36178..6c5afc1 100644 --- a/lib/src/v3/models/source.dart +++ b/lib/src/v3/models/source.dart @@ -1,7 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import '../../enums.dart'; -import '../../utils/force_utc_datetime.dart'; import '../../utils/serde.dart'; import '../../utils/workaround_settings_index.dart'; @@ -387,6 +386,7 @@ class CommunitySafe with _$CommunitySafe { required bool local, String? icon, String? banner, + required bool postingRestrictedToMods, required String instanceHost, }) = _CommunitySafe; diff --git a/lib/src/v3/models/source.freezed.dart b/lib/src/v3/models/source.freezed.dart index e5f6795..5facfdc 100644 --- a/lib/src/v3/models/source.freezed.dart +++ b/lib/src/v3/models/source.freezed.dart @@ -5890,6 +5890,7 @@ mixin _$CommunitySafe { bool get local => throw _privateConstructorUsedError; String? get icon => throw _privateConstructorUsedError; String? get banner => throw _privateConstructorUsedError; + bool get postingRestrictedToMods => throw _privateConstructorUsedError; String get instanceHost => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @@ -5917,6 +5918,7 @@ abstract class $CommunitySafeCopyWith<$Res> { bool local, String? icon, String? banner, + bool postingRestrictedToMods, String instanceHost}); } @@ -5944,6 +5946,7 @@ class _$CommunitySafeCopyWithImpl<$Res> Object? local = freezed, Object? icon = freezed, Object? banner = freezed, + Object? postingRestrictedToMods = freezed, Object? instanceHost = freezed, }) { return _then(_value.copyWith( @@ -5999,6 +6002,10 @@ class _$CommunitySafeCopyWithImpl<$Res> ? _value.banner : banner // ignore: cast_nullable_to_non_nullable as String?, + postingRestrictedToMods: postingRestrictedToMods == freezed + ? _value.postingRestrictedToMods + : postingRestrictedToMods // ignore: cast_nullable_to_non_nullable + as bool, instanceHost: instanceHost == freezed ? _value.instanceHost : instanceHost // ignore: cast_nullable_to_non_nullable @@ -6028,6 +6035,7 @@ abstract class _$$_CommunitySafeCopyWith<$Res> bool local, String? icon, String? banner, + bool postingRestrictedToMods, String instanceHost}); } @@ -6057,6 +6065,7 @@ class __$$_CommunitySafeCopyWithImpl<$Res> Object? local = freezed, Object? icon = freezed, Object? banner = freezed, + Object? postingRestrictedToMods = freezed, Object? instanceHost = freezed, }) { return _then(_$_CommunitySafe( @@ -6112,6 +6121,10 @@ class __$$_CommunitySafeCopyWithImpl<$Res> ? _value.banner : banner // ignore: cast_nullable_to_non_nullable as String?, + postingRestrictedToMods: postingRestrictedToMods == freezed + ? _value.postingRestrictedToMods + : postingRestrictedToMods // ignore: cast_nullable_to_non_nullable + as bool, instanceHost: instanceHost == freezed ? _value.instanceHost : instanceHost // ignore: cast_nullable_to_non_nullable @@ -6138,6 +6151,7 @@ class _$_CommunitySafe extends _CommunitySafe { required this.local, this.icon, this.banner, + required this.postingRestrictedToMods, required this.instanceHost}) : super._(); @@ -6171,11 +6185,13 @@ class _$_CommunitySafe extends _CommunitySafe { @override final String? banner; @override + final bool postingRestrictedToMods; + @override final String instanceHost; @override String toString() { - return 'CommunitySafe(id: $id, name: $name, title: $title, description: $description, removed: $removed, published: $published, updated: $updated, deleted: $deleted, nsfw: $nsfw, actorId: $actorId, local: $local, icon: $icon, banner: $banner, instanceHost: $instanceHost)'; + return 'CommunitySafe(id: $id, name: $name, title: $title, description: $description, removed: $removed, published: $published, updated: $updated, deleted: $deleted, nsfw: $nsfw, actorId: $actorId, local: $local, icon: $icon, banner: $banner, postingRestrictedToMods: $postingRestrictedToMods, instanceHost: $instanceHost)'; } @override @@ -6197,6 +6213,8 @@ class _$_CommunitySafe extends _CommunitySafe { const DeepCollectionEquality().equals(other.local, local) && const DeepCollectionEquality().equals(other.icon, icon) && const DeepCollectionEquality().equals(other.banner, banner) && + const DeepCollectionEquality().equals( + other.postingRestrictedToMods, postingRestrictedToMods) && const DeepCollectionEquality() .equals(other.instanceHost, instanceHost)); } @@ -6218,6 +6236,7 @@ class _$_CommunitySafe extends _CommunitySafe { const DeepCollectionEquality().hash(local), const DeepCollectionEquality().hash(icon), const DeepCollectionEquality().hash(banner), + const DeepCollectionEquality().hash(postingRestrictedToMods), const DeepCollectionEquality().hash(instanceHost)); @JsonKey(ignore: true) @@ -6248,6 +6267,7 @@ abstract class _CommunitySafe extends CommunitySafe { required final bool local, final String? icon, final String? banner, + required final bool postingRestrictedToMods, required final String instanceHost}) = _$_CommunitySafe; const _CommunitySafe._() : super._(); @@ -6281,6 +6301,8 @@ abstract class _CommunitySafe extends CommunitySafe { @override String? get banner; @override + bool get postingRestrictedToMods; + @override String get instanceHost; @override @JsonKey(ignore: true) diff --git a/lib/src/v3/models/source.g.dart b/lib/src/v3/models/source.g.dart index 15b1afa..5e9d27d 100644 --- a/lib/src/v3/models/source.g.dart +++ b/lib/src/v3/models/source.g.dart @@ -545,6 +545,7 @@ _$_CommunitySafe _$$_CommunitySafeFromJson(Map json) => local: json['local'] as bool, icon: json['icon'] as String?, banner: json['banner'] as String?, + postingRestrictedToMods: json['posting_restricted_to_mods'] as bool, instanceHost: json['instance_host'] as String, ); @@ -564,6 +565,7 @@ Map _$$_CommunitySafeToJson(_$_CommunitySafe instance) => 'local': instance.local, 'icon': instance.icon, 'banner': instance.banner, + 'posting_restricted_to_mods': instance.postingRestrictedToMods, 'instance_host': instance.instanceHost, };