Browse Source

feat(dynamite): support optimizing someOfs

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/1178/head
Nikolas Rimikis 1 year ago
parent
commit
1aba772f1d
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 33
      packages/dynamite/dynamite/lib/src/models/type_result/some_of.dart
  2. 1
      packages/dynamite/dynamite/lib/src/models/type_result/type_result.dart
  3. 79
      packages/dynamite/dynamite_end_to_end_test/lib/any_of.openapi.dart
  4. 15
      packages/dynamite/dynamite_end_to_end_test/lib/any_of.openapi.json
  5. 79
      packages/dynamite/dynamite_end_to_end_test/lib/one_of.openapi.dart
  6. 15
      packages/dynamite/dynamite_end_to_end_test/lib/one_of.openapi.json
  7. 44
      packages/dynamite/dynamite_end_to_end_test/lib/some_of.openapi.dart
  8. 35
      packages/dynamite/dynamite_end_to_end_test/test/any_of_test.dart
  9. 33
      packages/dynamite/dynamite_end_to_end_test/test/one_of_test.dart
  10. 7
      packages/neon/neon/lib/src/pages/account_settings.dart
  11. 114
      packages/nextcloud/lib/src/api/files_sharing.openapi.dart
  12. 40
      packages/nextcloud/lib/src/api/files_sharing.openapi.g.dart
  13. 250
      packages/nextcloud/lib/src/api/provisioning_api.openapi.dart
  14. 76
      packages/nextcloud/lib/src/api/provisioning_api.openapi.g.dart

33
packages/dynamite/dynamite/lib/src/models/type_result/some_of.dart

@ -22,10 +22,14 @@ abstract class TypeResultSomeOf extends TypeResult {
return '..add(${className}Extension.serializer)'; return '..add(${className}Extension.serializer)';
} }
late final List<TypeResult> optimizedSubTypes = subTypes.toList(); late final BuiltSet<TypeResult> optimizedSubTypes = _optimizedSubTypes.toBuiltSet();
@override @override
TypeResult get dartType { TypeResult get dartType {
if (optimizedSubTypes.isEmpty) {
throw StateError('SomeOf must have at least one sub type.');
}
if (optimizedSubTypes.length == 1) { if (optimizedSubTypes.length == 1) {
return optimizedSubTypes.single; return optimizedSubTypes.single;
} }
@ -41,6 +45,33 @@ abstract class TypeResultSomeOf extends TypeResult {
return TypeResultBase('({${record.join(',')}})'); return TypeResultBase('({${record.join(',')}})');
} }
Iterable<TypeResult> get _optimizedSubTypes sync* {
var optimizedNum = false;
final numbers = subTypes.where(
(final type) => switch (type.className) {
'int' || 'double' || 'num' => true,
_ => false,
},
);
if (numbers.length >= 2) {
yield TypeResultBase('num', nullable: true);
optimizedNum = true;
}
yield* subTypes.where((final type) {
if (!optimizedNum) {
return true;
}
return switch (type.className) {
'int' || 'double' || 'num' => false,
_ => true,
};
});
}
@override @override
bool operator ==(final Object other) => bool operator ==(final Object other) =>
other is TypeResultSomeOf && other is TypeResultSomeOf &&

1
packages/dynamite/dynamite/lib/src/models/type_result/type_result.dart

@ -1,3 +1,4 @@
import 'package:built_collection/built_collection.dart';
import 'package:dynamite/src/helpers/dart_helpers.dart'; import 'package:dynamite/src/helpers/dart_helpers.dart';
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';

79
packages/dynamite/dynamite_end_to_end_test/lib/any_of.openapi.dart

@ -220,66 +220,14 @@ typedef OneObjectAnyOf = OneObjectAnyOf0;
typedef OneValueAnyOf = String; typedef OneValueAnyOf = String;
typedef AnyOfIntDouble = ({int? $int, double? $double}); typedef AnyOfIntDouble = num;
extension AnyOfIntDoubleExtension on AnyOfIntDouble { typedef AnyOfIntDoubleNum = num;
List<dynamic> get _values => [$int, $double];
void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<AnyOfIntDouble> get serializer => const _$AnyOfIntDoubleSerializer();
static AnyOfIntDouble fromJson(final Object? json) => _jsonSerializers.deserializeWith(serializer, json)!;
Object? toJson() => _jsonSerializers.serializeWith(serializer, this);
}
class _$AnyOfIntDoubleSerializer implements PrimitiveSerializer<AnyOfIntDouble> {
const _$AnyOfIntDoubleSerializer();
@override
Iterable<Type> get types => const [AnyOfIntDouble];
@override
String get wireName => 'AnyOfIntDouble';
@override
Object serialize(
final Serializers serializers,
final AnyOfIntDouble object, {
final FullType specifiedType = FullType.unspecified,
}) {
dynamic value;
value = object.$int;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!;
}
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
} // Should not be possible after validation.
throw StateError('Tried to serialize without any value.');
}
@override typedef AnyOfIntDoubleOther = ({num? $num, String? string});
AnyOfIntDouble deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
}) {
int? $int;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
double? $double;
try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double;
} catch (_) {}
return ($int: $int, $double: $double);
}
}
typedef AnyOfIntDoubleOther = ({int? $int, double? $double, String? string});
extension AnyOfIntDoubleOtherExtension on AnyOfIntDoubleOther { extension AnyOfIntDoubleOtherExtension on AnyOfIntDoubleOther {
List<dynamic> get _values => [$int, $double, string]; List<dynamic> get _values => [$num, string];
void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<AnyOfIntDoubleOther> get serializer => const _$AnyOfIntDoubleOtherSerializer(); static Serializer<AnyOfIntDoubleOther> get serializer => const _$AnyOfIntDoubleOtherSerializer();
@ -303,13 +251,9 @@ class _$AnyOfIntDoubleOtherSerializer implements PrimitiveSerializer<AnyOfIntDou
final FullType specifiedType = FullType.unspecified, final FullType specifiedType = FullType.unspecified,
}) { }) {
dynamic value; dynamic value;
value = object.$int; value = object.$num;
if (value != null) { if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!; return _jsonSerializers.serialize(value, specifiedType: const FullType(num))!;
}
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
} }
value = object.string; value = object.string;
if (value != null) { if (value != null) {
@ -324,19 +268,15 @@ class _$AnyOfIntDoubleOtherSerializer implements PrimitiveSerializer<AnyOfIntDou
final Object data, { final Object data, {
final FullType specifiedType = FullType.unspecified, final FullType specifiedType = FullType.unspecified,
}) { }) {
int? $int; num? $num;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
double? $double;
try { try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double; $num = _jsonSerializers.deserialize(data, specifiedType: const FullType(num))! as num;
} catch (_) {} } catch (_) {}
String? string; String? string;
try { try {
string = _jsonSerializers.deserialize(data, specifiedType: const FullType(String))! as String; string = _jsonSerializers.deserialize(data, specifiedType: const FullType(String))! as String;
} catch (_) {} } catch (_) {}
return ($int: $int, $double: $double, string: string); return ($num: $num, string: string);
} }
} }
@ -352,7 +292,6 @@ final Serializers _serializers = (Serializers().toBuilder()
..add(MixedAnyOfExtension.serializer) ..add(MixedAnyOfExtension.serializer)
..addBuilderFactory(const FullType(OneObjectAnyOf0), OneObjectAnyOf0.new) ..addBuilderFactory(const FullType(OneObjectAnyOf0), OneObjectAnyOf0.new)
..add(OneObjectAnyOf0.serializer) ..add(OneObjectAnyOf0.serializer)
..add(AnyOfIntDoubleExtension.serializer)
..add(AnyOfIntDoubleOtherExtension.serializer)) ..add(AnyOfIntDoubleOtherExtension.serializer))
.build(); .build();

15
packages/dynamite/dynamite_end_to_end_test/lib/any_of.openapi.json

@ -88,6 +88,21 @@
} }
] ]
}, },
"AnyOfIntDoubleNum": {
"description": "Any of with an integer, double and number.",
"oneOf": [
{
"type": "integer"
},
{
"type": "number",
"format": "float"
},
{
"type": "number"
}
]
},
"AnyOfIntDoubleOther": { "AnyOfIntDoubleOther": {
"description": "Any of with an integer, double and other value.", "description": "Any of with an integer, double and other value.",
"anyOf": [ "anyOf": [

79
packages/dynamite/dynamite_end_to_end_test/lib/one_of.openapi.dart

@ -220,66 +220,14 @@ typedef OneObjectOneOf = OneObjectOneOf0;
typedef OneValueOneOf = String; typedef OneValueOneOf = String;
typedef OneOfIntDouble = ({int? $int, double? $double}); typedef OneOfIntDouble = num;
extension OneOfIntDoubleExtension on OneOfIntDouble { typedef OneOfIntDoubleNum = num;
List<dynamic> get _values => [$int, $double];
void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<OneOfIntDouble> get serializer => const _$OneOfIntDoubleSerializer();
static OneOfIntDouble fromJson(final Object? json) => _jsonSerializers.deserializeWith(serializer, json)!;
Object? toJson() => _jsonSerializers.serializeWith(serializer, this);
}
class _$OneOfIntDoubleSerializer implements PrimitiveSerializer<OneOfIntDouble> {
const _$OneOfIntDoubleSerializer();
@override
Iterable<Type> get types => const [OneOfIntDouble];
@override
String get wireName => 'OneOfIntDouble';
@override
Object serialize(
final Serializers serializers,
final OneOfIntDouble object, {
final FullType specifiedType = FullType.unspecified,
}) {
dynamic value;
value = object.$int;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!;
}
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
} // Should not be possible after validation.
throw StateError('Tried to serialize without any value.');
}
@override typedef OneOfIntDoubleOther = ({num? $num, String? string});
OneOfIntDouble deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
}) {
int? $int;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
double? $double;
try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double;
} catch (_) {}
return ($int: $int, $double: $double);
}
}
typedef OneOfIntDoubleOther = ({int? $int, double? $double, String? string});
extension OneOfIntDoubleOtherExtension on OneOfIntDoubleOther { extension OneOfIntDoubleOtherExtension on OneOfIntDoubleOther {
List<dynamic> get _values => [$int, $double, string]; List<dynamic> get _values => [$num, string];
void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<OneOfIntDoubleOther> get serializer => const _$OneOfIntDoubleOtherSerializer(); static Serializer<OneOfIntDoubleOther> get serializer => const _$OneOfIntDoubleOtherSerializer();
@ -303,13 +251,9 @@ class _$OneOfIntDoubleOtherSerializer implements PrimitiveSerializer<OneOfIntDou
final FullType specifiedType = FullType.unspecified, final FullType specifiedType = FullType.unspecified,
}) { }) {
dynamic value; dynamic value;
value = object.$int; value = object.$num;
if (value != null) { if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!; return _jsonSerializers.serialize(value, specifiedType: const FullType(num))!;
}
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
} }
value = object.string; value = object.string;
if (value != null) { if (value != null) {
@ -324,19 +268,15 @@ class _$OneOfIntDoubleOtherSerializer implements PrimitiveSerializer<OneOfIntDou
final Object data, { final Object data, {
final FullType specifiedType = FullType.unspecified, final FullType specifiedType = FullType.unspecified,
}) { }) {
int? $int; num? $num;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
double? $double;
try { try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double; $num = _jsonSerializers.deserialize(data, specifiedType: const FullType(num))! as num;
} catch (_) {} } catch (_) {}
String? string; String? string;
try { try {
string = _jsonSerializers.deserialize(data, specifiedType: const FullType(String))! as String; string = _jsonSerializers.deserialize(data, specifiedType: const FullType(String))! as String;
} catch (_) {} } catch (_) {}
return ($int: $int, $double: $double, string: string); return ($num: $num, string: string);
} }
} }
@ -352,7 +292,6 @@ final Serializers _serializers = (Serializers().toBuilder()
..add(MixedOneOfExtension.serializer) ..add(MixedOneOfExtension.serializer)
..addBuilderFactory(const FullType(OneObjectOneOf0), OneObjectOneOf0.new) ..addBuilderFactory(const FullType(OneObjectOneOf0), OneObjectOneOf0.new)
..add(OneObjectOneOf0.serializer) ..add(OneObjectOneOf0.serializer)
..add(OneOfIntDoubleExtension.serializer)
..add(OneOfIntDoubleOtherExtension.serializer)) ..add(OneOfIntDoubleOtherExtension.serializer))
.build(); .build();

15
packages/dynamite/dynamite_end_to_end_test/lib/one_of.openapi.json

@ -88,6 +88,21 @@
} }
] ]
}, },
"OneOfIntDoubleNum": {
"description": "One of with an integer, double and number.",
"oneOf": [
{
"type": "integer"
},
{
"type": "number",
"format": "float"
},
{
"type": "number"
}
]
},
"OneOfIntDoubleOther": { "OneOfIntDoubleOther": {
"description": "One of with an integer, double and other value.", "description": "One of with an integer, double and other value.",
"oneOf": [ "oneOf": [

44
packages/dynamite/dynamite_end_to_end_test/lib/some_of.openapi.dart

@ -28,10 +28,10 @@ class Client extends DynamiteClient {
); );
} }
typedef OneOfIntDoubleOther = ({int? $int, double? $double, String? string}); typedef OneOfIntDoubleOther = ({num? $num, String? string});
extension OneOfIntDoubleOtherExtension on OneOfIntDoubleOther { extension OneOfIntDoubleOtherExtension on OneOfIntDoubleOther {
List<dynamic> get _values => [$int, $double, string]; List<dynamic> get _values => [$num, string];
void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<OneOfIntDoubleOther> get serializer => const _$OneOfIntDoubleOtherSerializer(); static Serializer<OneOfIntDoubleOther> get serializer => const _$OneOfIntDoubleOtherSerializer();
@ -55,13 +55,9 @@ class _$OneOfIntDoubleOtherSerializer implements PrimitiveSerializer<OneOfIntDou
final FullType specifiedType = FullType.unspecified, final FullType specifiedType = FullType.unspecified,
}) { }) {
dynamic value; dynamic value;
value = object.$int; value = object.$num;
if (value != null) { if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!; return _jsonSerializers.serialize(value, specifiedType: const FullType(num))!;
}
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
} }
value = object.string; value = object.string;
if (value != null) { if (value != null) {
@ -76,26 +72,22 @@ class _$OneOfIntDoubleOtherSerializer implements PrimitiveSerializer<OneOfIntDou
final Object data, { final Object data, {
final FullType specifiedType = FullType.unspecified, final FullType specifiedType = FullType.unspecified,
}) { }) {
int? $int; num? $num;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
double? $double;
try { try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double; $num = _jsonSerializers.deserialize(data, specifiedType: const FullType(num))! as num;
} catch (_) {} } catch (_) {}
String? string; String? string;
try { try {
string = _jsonSerializers.deserialize(data, specifiedType: const FullType(String))! as String; string = _jsonSerializers.deserialize(data, specifiedType: const FullType(String))! as String;
} catch (_) {} } catch (_) {}
return ($int: $int, $double: $double, string: string); return ($num: $num, string: string);
} }
} }
typedef AnyOfIntDoubleOther = ({int? $int, double? $double, String? string}); typedef AnyOfIntDoubleOther = ({num? $num, String? string});
extension AnyOfIntDoubleOtherExtension on AnyOfIntDoubleOther { extension AnyOfIntDoubleOtherExtension on AnyOfIntDoubleOther {
List<dynamic> get _values => [$int, $double, string]; List<dynamic> get _values => [$num, string];
void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<AnyOfIntDoubleOther> get serializer => const _$AnyOfIntDoubleOtherSerializer(); static Serializer<AnyOfIntDoubleOther> get serializer => const _$AnyOfIntDoubleOtherSerializer();
@ -119,13 +111,9 @@ class _$AnyOfIntDoubleOtherSerializer implements PrimitiveSerializer<AnyOfIntDou
final FullType specifiedType = FullType.unspecified, final FullType specifiedType = FullType.unspecified,
}) { }) {
dynamic value; dynamic value;
value = object.$int; value = object.$num;
if (value != null) { if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!; return _jsonSerializers.serialize(value, specifiedType: const FullType(num))!;
}
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
} }
value = object.string; value = object.string;
if (value != null) { if (value != null) {
@ -140,19 +128,15 @@ class _$AnyOfIntDoubleOtherSerializer implements PrimitiveSerializer<AnyOfIntDou
final Object data, { final Object data, {
final FullType specifiedType = FullType.unspecified, final FullType specifiedType = FullType.unspecified,
}) { }) {
int? $int; num? $num;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
double? $double;
try { try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double; $num = _jsonSerializers.deserialize(data, specifiedType: const FullType(num))! as num;
} catch (_) {} } catch (_) {}
String? string; String? string;
try { try {
string = _jsonSerializers.deserialize(data, specifiedType: const FullType(String))! as String; string = _jsonSerializers.deserialize(data, specifiedType: const FullType(String))! as String;
} catch (_) {} } catch (_) {}
return ($int: $int, $double: $double, string: string); return ($num: $num, string: string);
} }
} }

35
packages/dynamite/dynamite_end_to_end_test/test/any_of_test.dart

@ -62,31 +62,24 @@ void main() {
}); });
test('AnyOfIntDouble', () { test('AnyOfIntDouble', () {
AnyOfIntDouble object = ( Object? object = 0.5971645863260784;
$double: 0.5971645863260784, expect(object, isA<AnyOfIntDouble>());
$int: null,
);
Object? json = 0.5971645863260784;
expect(object.toJson(), equals(json));
expect(AnyOfIntDoubleExtension.fromJson(json), equals(object));
object = ( object = 361;
$double: null, expect(object, isA<AnyOfIntDouble>());
$int: 361, });
);
json = 361; test('AnyOfIntDoubleNum', () {
Object? object = 0.5213515036646204;
expect(object, isA<AnyOfIntDoubleNum>());
expect(object.toJson(), equals(json)); object = 620;
expect(AnyOfIntDoubleExtension.fromJson(json), equals(object)); expect(object, isA<AnyOfIntDoubleNum>());
}); });
test('AnyOfIntDoubleOther', () { test('AnyOfIntDoubleOther', () {
AnyOfIntDoubleOther object = ( AnyOfIntDoubleOther object = (
$double: 0.5971645863260784, $num: 0.5971645863260784,
$int: null,
string: null, string: null,
); );
@ -96,8 +89,7 @@ void main() {
expect(AnyOfIntDoubleOtherExtension.fromJson(json), equals(object)); expect(AnyOfIntDoubleOtherExtension.fromJson(json), equals(object));
object = ( object = (
$double: null, $num: 361,
$int: 361,
string: null, string: null,
); );
@ -107,8 +99,7 @@ void main() {
expect(AnyOfIntDoubleOtherExtension.fromJson(json)..validateAnyOf(), equals(object)); expect(AnyOfIntDoubleOtherExtension.fromJson(json)..validateAnyOf(), equals(object));
object = ( object = (
$double: null, $num: null,
$int: null,
string: 'string', string: 'string',
); );

33
packages/dynamite/dynamite_end_to_end_test/test/one_of_test.dart

@ -62,31 +62,26 @@ void main() {
}); });
test('OneOfIntDouble', () { test('OneOfIntDouble', () {
OneOfIntDouble object = ( Object? object = 0.5971645863260784;
$double: 0.5971645863260784,
$int: null,
);
Object? json = 0.5971645863260784; expect(object, isA<OneOfIntDouble>());
expect(object.toJson(), equals(json)); object = 361;
expect(OneOfIntDoubleExtension.fromJson(json), equals(object)); expect(object, isA<OneOfIntDouble>());
});
object = ( test('OneOfIntDoubleNum', () {
$double: null, Object? object = 0.6748612915546136;
$int: 361,
);
json = 361; expect(object, isA<OneOfIntDoubleNum>());
expect(object.toJson(), equals(json)); object = 769;
expect(OneOfIntDoubleExtension.fromJson(json), equals(object)); expect(object, isA<OneOfIntDoubleNum>());
}); });
test('OneOfIntDoubleOther', () { test('OneOfIntDoubleOther', () {
OneOfIntDoubleOther object = ( OneOfIntDoubleOther object = (
$double: 0.5971645863260784, $num: 0.5971645863260784,
$int: null,
string: null, string: null,
); );
@ -96,8 +91,7 @@ void main() {
expect(OneOfIntDoubleOtherExtension.fromJson(json), equals(object)); expect(OneOfIntDoubleOtherExtension.fromJson(json), equals(object));
object = ( object = (
$double: null, $num: 361,
$int: 361,
string: null, string: null,
); );
@ -107,8 +101,7 @@ void main() {
expect(OneOfIntDoubleOtherExtension.fromJson(json), equals(object)); expect(OneOfIntDoubleOtherExtension.fromJson(json), equals(object));
object = ( object = (
$double: null, $num: null,
$int: null,
string: 'string', string: 'string',
); );

7
packages/neon/neon/lib/src/pages/account_settings.dart

@ -103,10 +103,9 @@ class AccountSettingsPage extends StatelessWidget {
double? value; double? value;
Widget? subtitle; Widget? subtitle;
if (userDetails.hasData) { if (userDetails.hasData) {
final quotaRelative = final quotaRelative = userDetails.data?.quota.relative ?? 0;
userDetails.data?.quota.relative?.$int ?? userDetails.data?.quota.relative?.$double ?? 0; final quotaTotal = userDetails.data?.quota.total ?? 0;
final quotaTotal = userDetails.data?.quota.total?.$int ?? userDetails.data?.quota.total?.$double ?? 0; final quotaUsed = userDetails.data?.quota.used ?? 0;
final quotaUsed = userDetails.data?.quota.used?.$int ?? userDetails.data?.quota.used?.$double ?? 0;
value = quotaRelative / 100; value = quotaRelative / 100;
subtitle = Text( subtitle = Text(

114
packages/nextcloud/lib/src/api/files_sharing.openapi.dart

@ -4851,117 +4851,9 @@ abstract class Capabilities implements CapabilitiesInterface, Built<Capabilities
static Serializer<Capabilities> get serializer => _$capabilitiesSerializer; static Serializer<Capabilities> get serializer => _$capabilitiesSerializer;
} }
typedef ShareInfo_Size = ({int? $int, double? $double}); typedef ShareInfo_Size = num;
extension ShareInfo_SizeExtension on ShareInfo_Size { typedef Share_ItemSize = num;
List<dynamic> get _values => [$int, $double];
void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<ShareInfo_Size> get serializer => const _$ShareInfo_SizeSerializer();
static ShareInfo_Size fromJson(final Object? json) => _jsonSerializers.deserializeWith(serializer, json)!;
Object? toJson() => _jsonSerializers.serializeWith(serializer, this);
}
class _$ShareInfo_SizeSerializer implements PrimitiveSerializer<ShareInfo_Size> {
const _$ShareInfo_SizeSerializer();
@override
Iterable<Type> get types => const [ShareInfo_Size];
@override
String get wireName => 'ShareInfo_Size';
@override
Object serialize(
final Serializers serializers,
final ShareInfo_Size object, {
final FullType specifiedType = FullType.unspecified,
}) {
dynamic value;
value = object.$int;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!;
}
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
} // Should not be possible after validation.
throw StateError('Tried to serialize without any value.');
}
@override
ShareInfo_Size deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
}) {
int? $int;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
double? $double;
try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double;
} catch (_) {}
return ($int: $int, $double: $double);
}
}
typedef Share_ItemSize = ({double? $double, int? $int});
extension Share_ItemSizeExtension on Share_ItemSize {
List<dynamic> get _values => [$double, $int];
void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<Share_ItemSize> get serializer => const _$Share_ItemSizeSerializer();
static Share_ItemSize fromJson(final Object? json) => _jsonSerializers.deserializeWith(serializer, json)!;
Object? toJson() => _jsonSerializers.serializeWith(serializer, this);
}
class _$Share_ItemSizeSerializer implements PrimitiveSerializer<Share_ItemSize> {
const _$Share_ItemSizeSerializer();
@override
Iterable<Type> get types => const [Share_ItemSize];
@override
String get wireName => 'Share_ItemSize';
@override
Object serialize(
final Serializers serializers,
final Share_ItemSize object, {
final FullType specifiedType = FullType.unspecified,
}) {
dynamic value;
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
}
value = object.$int;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!;
} // Should not be possible after validation.
throw StateError('Tried to serialize without any value.');
}
@override
Share_ItemSize deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
}) {
double? $double;
try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double;
} catch (_) {}
int? $int;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
return ($double: $double, $int: $int);
}
}
typedef ShareesapiSearchShareType = ({int? $int, BuiltList<int>? builtListInt}); typedef ShareesapiSearchShareType = ({int? $int, BuiltList<int>? builtListInt});
@ -5172,7 +5064,6 @@ final Serializers _serializers = (Serializers().toBuilder()
..add(RemoteUnshareResponseApplicationJson_Ocs.serializer) ..add(RemoteUnshareResponseApplicationJson_Ocs.serializer)
..addBuilderFactory(const FullType(ShareInfo), ShareInfo.new) ..addBuilderFactory(const FullType(ShareInfo), ShareInfo.new)
..add(ShareInfo.serializer) ..add(ShareInfo.serializer)
..add(ShareInfo_SizeExtension.serializer)
..addBuilderFactory( ..addBuilderFactory(
const FullType(BuiltMap, [FullType(String), FullType(JsonObject)]), const FullType(BuiltMap, [FullType(String), FullType(JsonObject)]),
MapBuilder<String, JsonObject>.new, MapBuilder<String, JsonObject>.new,
@ -5195,7 +5086,6 @@ final Serializers _serializers = (Serializers().toBuilder()
..add(ShareapiGetSharesResponseApplicationJson_Ocs.serializer) ..add(ShareapiGetSharesResponseApplicationJson_Ocs.serializer)
..addBuilderFactory(const FullType(Share), Share.new) ..addBuilderFactory(const FullType(Share), Share.new)
..add(Share.serializer) ..add(Share.serializer)
..add(Share_ItemSizeExtension.serializer)
..add(Share_ItemType.serializer) ..add(Share_ItemType.serializer)
..addBuilderFactory(const FullType(Share_Status), Share_Status.new) ..addBuilderFactory(const FullType(Share_Status), Share_Status.new)
..add(Share_Status.serializer) ..add(Share_Status.serializer)

40
packages/nextcloud/lib/src/api/files_sharing.openapi.g.dart

@ -1267,7 +1267,7 @@ class _$ShareInfoSerializer implements StructuredSerializer<ShareInfo> {
'mimetype', 'mimetype',
serializers.serialize(object.mimetype, specifiedType: const FullType(String)), serializers.serialize(object.mimetype, specifiedType: const FullType(String)),
'size', 'size',
serializers.serialize(object.size, specifiedType: const FullType(ShareInfo_Size)), serializers.serialize(object.size, specifiedType: const FullType(num)),
'type', 'type',
serializers.serialize(object.type, specifiedType: const FullType(String)), serializers.serialize(object.type, specifiedType: const FullType(String)),
'etag', 'etag',
@ -1316,8 +1316,7 @@ class _$ShareInfoSerializer implements StructuredSerializer<ShareInfo> {
result.mimetype = serializers.deserialize(value, specifiedType: const FullType(String))! as String; result.mimetype = serializers.deserialize(value, specifiedType: const FullType(String))! as String;
break; break;
case 'size': case 'size':
result.size = result.size = serializers.deserialize(value, specifiedType: const FullType(num))! as num;
serializers.deserialize(value, specifiedType: const FullType(ShareInfo_Size))! as ShareInfo_Size;
break; break;
case 'type': case 'type':
result.type = serializers.deserialize(value, specifiedType: const FullType(String))! as String; result.type = serializers.deserialize(value, specifiedType: const FullType(String))! as String;
@ -1454,7 +1453,7 @@ class _$ShareSerializer implements StructuredSerializer<Share> {
'item_mtime', 'item_mtime',
serializers.serialize(object.itemMtime, specifiedType: const FullType(int)), serializers.serialize(object.itemMtime, specifiedType: const FullType(int)),
'item_size', 'item_size',
serializers.serialize(object.itemSize, specifiedType: const FullType(Share_ItemSize)), serializers.serialize(object.itemSize, specifiedType: const FullType(num)),
'item_source', 'item_source',
serializers.serialize(object.itemSource, specifiedType: const FullType(int)), serializers.serialize(object.itemSource, specifiedType: const FullType(int)),
'item_type', 'item_type',
@ -1637,8 +1636,7 @@ class _$ShareSerializer implements StructuredSerializer<Share> {
result.itemPermissions = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; result.itemPermissions = serializers.deserialize(value, specifiedType: const FullType(int)) as int?;
break; break;
case 'item_size': case 'item_size':
result.itemSize = result.itemSize = serializers.deserialize(value, specifiedType: const FullType(num))! as num;
serializers.deserialize(value, specifiedType: const FullType(Share_ItemSize))! as Share_ItemSize;
break; break;
case 'item_source': case 'item_source':
result.itemSource = serializers.deserialize(value, specifiedType: const FullType(int))! as int; result.itemSource = serializers.deserialize(value, specifiedType: const FullType(int))! as int;
@ -7374,8 +7372,8 @@ abstract mixin class ShareInfoInterfaceBuilder {
String? get mimetype; String? get mimetype;
set mimetype(String? mimetype); set mimetype(String? mimetype);
ShareInfo_Size? get size; num? get size;
set size(ShareInfo_Size? size); set size(num? size);
String? get type; String? get type;
set type(String? type); set type(String? type);
@ -7401,7 +7399,7 @@ class _$ShareInfo extends ShareInfo {
@override @override
final String mimetype; final String mimetype;
@override @override
final ShareInfo_Size size; final num size;
@override @override
final String type; final String type;
@override @override
@ -7443,7 +7441,6 @@ class _$ShareInfo extends ShareInfo {
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if (identical(other, this)) return true; if (identical(other, this)) return true;
final dynamic _$dynamicOther = other;
return other is ShareInfo && return other is ShareInfo &&
id == other.id && id == other.id &&
parentId == other.parentId && parentId == other.parentId &&
@ -7451,7 +7448,7 @@ class _$ShareInfo extends ShareInfo {
name == other.name && name == other.name &&
permissions == other.permissions && permissions == other.permissions &&
mimetype == other.mimetype && mimetype == other.mimetype &&
size == _$dynamicOther.size && size == other.size &&
type == other.type && type == other.type &&
etag == other.etag && etag == other.etag &&
children == other.children; children == other.children;
@ -7518,9 +7515,9 @@ class ShareInfoBuilder implements Builder<ShareInfo, ShareInfoBuilder>, ShareInf
String? get mimetype => _$this._mimetype; String? get mimetype => _$this._mimetype;
set mimetype(covariant String? mimetype) => _$this._mimetype = mimetype; set mimetype(covariant String? mimetype) => _$this._mimetype = mimetype;
ShareInfo_Size? _size; num? _size;
ShareInfo_Size? get size => _$this._size; num? get size => _$this._size;
set size(covariant ShareInfo_Size? size) => _$this._size = size; set size(covariant num? size) => _$this._size = size;
String? _type; String? _type;
String? get type => _$this._type; String? get type => _$this._type;
@ -7767,8 +7764,8 @@ abstract mixin class ShareInterfaceBuilder {
int? get itemPermissions; int? get itemPermissions;
set itemPermissions(int? itemPermissions); set itemPermissions(int? itemPermissions);
Share_ItemSize? get itemSize; num? get itemSize;
set itemSize(Share_ItemSize? itemSize); set itemSize(num? itemSize);
int? get itemSource; int? get itemSource;
set itemSource(int? itemSource); set itemSource(int? itemSource);
@ -7879,7 +7876,7 @@ class _$Share extends Share {
@override @override
final int? itemPermissions; final int? itemPermissions;
@override @override
final Share_ItemSize itemSize; final num itemSize;
@override @override
final int itemSource; final int itemSource;
@override @override
@ -8014,7 +8011,6 @@ class _$Share extends Share {
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if (identical(other, this)) return true; if (identical(other, this)) return true;
final dynamic _$dynamicOther = other;
return other is Share && return other is Share &&
attributes == other.attributes && attributes == other.attributes &&
canDelete == other.canDelete && canDelete == other.canDelete &&
@ -8030,7 +8026,7 @@ class _$Share extends Share {
id == other.id && id == other.id &&
itemMtime == other.itemMtime && itemMtime == other.itemMtime &&
itemPermissions == other.itemPermissions && itemPermissions == other.itemPermissions &&
itemSize == _$dynamicOther.itemSize && itemSize == other.itemSize &&
itemSource == other.itemSource && itemSource == other.itemSource &&
itemType == other.itemType && itemType == other.itemType &&
label == other.label && label == other.label &&
@ -8215,9 +8211,9 @@ class ShareBuilder implements Builder<Share, ShareBuilder>, ShareInterfaceBuilde
int? get itemPermissions => _$this._itemPermissions; int? get itemPermissions => _$this._itemPermissions;
set itemPermissions(covariant int? itemPermissions) => _$this._itemPermissions = itemPermissions; set itemPermissions(covariant int? itemPermissions) => _$this._itemPermissions = itemPermissions;
Share_ItemSize? _itemSize; num? _itemSize;
Share_ItemSize? get itemSize => _$this._itemSize; num? get itemSize => _$this._itemSize;
set itemSize(covariant Share_ItemSize? itemSize) => _$this._itemSize = itemSize; set itemSize(covariant num? itemSize) => _$this._itemSize = itemSize;
int? _itemSource; int? _itemSource;
int? get itemSource => _$this._itemSource; int? get itemSource => _$this._itemSource;

250
packages/nextcloud/lib/src/api/provisioning_api.openapi.dart

@ -8184,66 +8184,12 @@ class _$GroupDetails_DisabledSerializer implements PrimitiveSerializer<GroupDeta
} }
} }
typedef UserDetailsQuota_Free = ({double? $double, int? $int}); typedef UserDetailsQuota_Free = num;
extension UserDetailsQuota_FreeExtension on UserDetailsQuota_Free { typedef UserDetailsQuota_Quota = ({num? $num, String? string});
List<dynamic> get _values => [$double, $int];
void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<UserDetailsQuota_Free> get serializer => const _$UserDetailsQuota_FreeSerializer();
static UserDetailsQuota_Free fromJson(final Object? json) => _jsonSerializers.deserializeWith(serializer, json)!;
Object? toJson() => _jsonSerializers.serializeWith(serializer, this);
}
class _$UserDetailsQuota_FreeSerializer implements PrimitiveSerializer<UserDetailsQuota_Free> {
const _$UserDetailsQuota_FreeSerializer();
@override
Iterable<Type> get types => const [UserDetailsQuota_Free];
@override
String get wireName => 'UserDetailsQuota_Free';
@override
Object serialize(
final Serializers serializers,
final UserDetailsQuota_Free object, {
final FullType specifiedType = FullType.unspecified,
}) {
dynamic value;
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
}
value = object.$int;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!;
} // Should not be possible after validation.
throw StateError('Tried to serialize without any value.');
}
@override
UserDetailsQuota_Free deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
}) {
double? $double;
try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double;
} catch (_) {}
int? $int;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
return ($double: $double, $int: $int);
}
}
typedef UserDetailsQuota_Quota = ({double? $double, int? $int, String? string});
extension UserDetailsQuota_QuotaExtension on UserDetailsQuota_Quota { extension UserDetailsQuota_QuotaExtension on UserDetailsQuota_Quota {
List<dynamic> get _values => [$double, $int, string]; List<dynamic> get _values => [$num, string];
void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<UserDetailsQuota_Quota> get serializer => const _$UserDetailsQuota_QuotaSerializer(); static Serializer<UserDetailsQuota_Quota> get serializer => const _$UserDetailsQuota_QuotaSerializer();
@ -8267,13 +8213,9 @@ class _$UserDetailsQuota_QuotaSerializer implements PrimitiveSerializer<UserDeta
final FullType specifiedType = FullType.unspecified, final FullType specifiedType = FullType.unspecified,
}) { }) {
dynamic value; dynamic value;
value = object.$double; value = object.$num;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
}
value = object.$int;
if (value != null) { if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!; return _jsonSerializers.serialize(value, specifiedType: const FullType(num))!;
} }
value = object.string; value = object.string;
if (value != null) { if (value != null) {
@ -8288,189 +8230,23 @@ class _$UserDetailsQuota_QuotaSerializer implements PrimitiveSerializer<UserDeta
final Object data, { final Object data, {
final FullType specifiedType = FullType.unspecified, final FullType specifiedType = FullType.unspecified,
}) { }) {
double? $double; num? $num;
try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double;
} catch (_) {}
int? $int;
try { try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int; $num = _jsonSerializers.deserialize(data, specifiedType: const FullType(num))! as num;
} catch (_) {} } catch (_) {}
String? string; String? string;
try { try {
string = _jsonSerializers.deserialize(data, specifiedType: const FullType(String))! as String; string = _jsonSerializers.deserialize(data, specifiedType: const FullType(String))! as String;
} catch (_) {} } catch (_) {}
return ($double: $double, $int: $int, string: string); return ($num: $num, string: string);
}
}
typedef UserDetailsQuota_Relative = ({double? $double, int? $int});
extension UserDetailsQuota_RelativeExtension on UserDetailsQuota_Relative {
List<dynamic> get _values => [$double, $int];
void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<UserDetailsQuota_Relative> get serializer => const _$UserDetailsQuota_RelativeSerializer();
static UserDetailsQuota_Relative fromJson(final Object? json) => _jsonSerializers.deserializeWith(serializer, json)!;
Object? toJson() => _jsonSerializers.serializeWith(serializer, this);
}
class _$UserDetailsQuota_RelativeSerializer implements PrimitiveSerializer<UserDetailsQuota_Relative> {
const _$UserDetailsQuota_RelativeSerializer();
@override
Iterable<Type> get types => const [UserDetailsQuota_Relative];
@override
String get wireName => 'UserDetailsQuota_Relative';
@override
Object serialize(
final Serializers serializers,
final UserDetailsQuota_Relative object, {
final FullType specifiedType = FullType.unspecified,
}) {
dynamic value;
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
}
value = object.$int;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!;
} // Should not be possible after validation.
throw StateError('Tried to serialize without any value.');
}
@override
UserDetailsQuota_Relative deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
}) {
double? $double;
try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double;
} catch (_) {}
int? $int;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
return ($double: $double, $int: $int);
}
}
typedef UserDetailsQuota_Total = ({double? $double, int? $int});
extension UserDetailsQuota_TotalExtension on UserDetailsQuota_Total {
List<dynamic> get _values => [$double, $int];
void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<UserDetailsQuota_Total> get serializer => const _$UserDetailsQuota_TotalSerializer();
static UserDetailsQuota_Total fromJson(final Object? json) => _jsonSerializers.deserializeWith(serializer, json)!;
Object? toJson() => _jsonSerializers.serializeWith(serializer, this);
}
class _$UserDetailsQuota_TotalSerializer implements PrimitiveSerializer<UserDetailsQuota_Total> {
const _$UserDetailsQuota_TotalSerializer();
@override
Iterable<Type> get types => const [UserDetailsQuota_Total];
@override
String get wireName => 'UserDetailsQuota_Total';
@override
Object serialize(
final Serializers serializers,
final UserDetailsQuota_Total object, {
final FullType specifiedType = FullType.unspecified,
}) {
dynamic value;
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
}
value = object.$int;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!;
} // Should not be possible after validation.
throw StateError('Tried to serialize without any value.');
}
@override
UserDetailsQuota_Total deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
}) {
double? $double;
try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double;
} catch (_) {}
int? $int;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
return ($double: $double, $int: $int);
} }
} }
typedef UserDetailsQuota_Used = ({double? $double, int? $int}); typedef UserDetailsQuota_Relative = num;
extension UserDetailsQuota_UsedExtension on UserDetailsQuota_Used { typedef UserDetailsQuota_Total = num;
List<dynamic> get _values => [$double, $int];
void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<UserDetailsQuota_Used> get serializer => const _$UserDetailsQuota_UsedSerializer();
static UserDetailsQuota_Used fromJson(final Object? json) => _jsonSerializers.deserializeWith(serializer, json)!;
Object? toJson() => _jsonSerializers.serializeWith(serializer, this);
}
class _$UserDetailsQuota_UsedSerializer implements PrimitiveSerializer<UserDetailsQuota_Used> {
const _$UserDetailsQuota_UsedSerializer();
@override
Iterable<Type> get types => const [UserDetailsQuota_Used];
@override typedef UserDetailsQuota_Used = num;
String get wireName => 'UserDetailsQuota_Used';
@override
Object serialize(
final Serializers serializers,
final UserDetailsQuota_Used object, {
final FullType specifiedType = FullType.unspecified,
}) {
dynamic value;
value = object.$double;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(double))!;
}
value = object.$int;
if (value != null) {
return _jsonSerializers.serialize(value, specifiedType: const FullType(int))!;
} // Should not be possible after validation.
throw StateError('Tried to serialize without any value.');
}
@override
UserDetailsQuota_Used deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
}) {
double? $double;
try {
$double = _jsonSerializers.deserialize(data, specifiedType: const FullType(double))! as double;
} catch (_) {}
int? $int;
try {
$int = _jsonSerializers.deserialize(data, specifiedType: const FullType(int))! as int;
} catch (_) {}
return ($double: $double, $int: $int);
}
}
typedef GroupsGetGroupUsersDetailsResponseApplicationJson_Ocs_Data_Users = ({ typedef GroupsGetGroupUsersDetailsResponseApplicationJson_Ocs_Data_Users = ({
UserDetails? userDetails, UserDetails? userDetails,
@ -8882,11 +8658,7 @@ final Serializers _serializers = (Serializers().toBuilder()
..add(UserDetails_BackendCapabilities.serializer) ..add(UserDetails_BackendCapabilities.serializer)
..addBuilderFactory(const FullType(UserDetailsQuota), UserDetailsQuota.new) ..addBuilderFactory(const FullType(UserDetailsQuota), UserDetailsQuota.new)
..add(UserDetailsQuota.serializer) ..add(UserDetailsQuota.serializer)
..add(UserDetailsQuota_FreeExtension.serializer)
..add(UserDetailsQuota_QuotaExtension.serializer) ..add(UserDetailsQuota_QuotaExtension.serializer)
..add(UserDetailsQuota_RelativeExtension.serializer)
..add(UserDetailsQuota_TotalExtension.serializer)
..add(UserDetailsQuota_UsedExtension.serializer)
..addBuilderFactory( ..addBuilderFactory(
const FullType(GroupsGetGroupUsersDetailsResponseApplicationJson_Ocs_Data_Users1), const FullType(GroupsGetGroupUsersDetailsResponseApplicationJson_Ocs_Data_Users1),
GroupsGetGroupUsersDetailsResponseApplicationJson_Ocs_Data_Users1.new, GroupsGetGroupUsersDetailsResponseApplicationJson_Ocs_Data_Users1.new,

76
packages/nextcloud/lib/src/api/provisioning_api.openapi.g.dart

@ -2304,7 +2304,7 @@ class _$UserDetailsQuotaSerializer implements StructuredSerializer<UserDetailsQu
if (value != null) { if (value != null) {
result result
..add('free') ..add('free')
..add(serializers.serialize(value, specifiedType: const FullType(UserDetailsQuota_Free))); ..add(serializers.serialize(value, specifiedType: const FullType(num)));
} }
value = object.quota; value = object.quota;
if (value != null) { if (value != null) {
@ -2316,19 +2316,19 @@ class _$UserDetailsQuotaSerializer implements StructuredSerializer<UserDetailsQu
if (value != null) { if (value != null) {
result result
..add('relative') ..add('relative')
..add(serializers.serialize(value, specifiedType: const FullType(UserDetailsQuota_Relative))); ..add(serializers.serialize(value, specifiedType: const FullType(num)));
} }
value = object.total; value = object.total;
if (value != null) { if (value != null) {
result result
..add('total') ..add('total')
..add(serializers.serialize(value, specifiedType: const FullType(UserDetailsQuota_Total))); ..add(serializers.serialize(value, specifiedType: const FullType(num)));
} }
value = object.used; value = object.used;
if (value != null) { if (value != null) {
result result
..add('used') ..add('used')
..add(serializers.serialize(value, specifiedType: const FullType(UserDetailsQuota_Used))); ..add(serializers.serialize(value, specifiedType: const FullType(num)));
} }
return result; return result;
} }
@ -2345,24 +2345,20 @@ class _$UserDetailsQuotaSerializer implements StructuredSerializer<UserDetailsQu
final Object? value = iterator.current; final Object? value = iterator.current;
switch (key) { switch (key) {
case 'free': case 'free':
result.free = serializers.deserialize(value, specifiedType: const FullType(UserDetailsQuota_Free)) result.free = serializers.deserialize(value, specifiedType: const FullType(num)) as num?;
as UserDetailsQuota_Free?;
break; break;
case 'quota': case 'quota':
result.quota = serializers.deserialize(value, specifiedType: const FullType(UserDetailsQuota_Quota)) result.quota = serializers.deserialize(value, specifiedType: const FullType(UserDetailsQuota_Quota))
as UserDetailsQuota_Quota?; as UserDetailsQuota_Quota?;
break; break;
case 'relative': case 'relative':
result.relative = serializers.deserialize(value, specifiedType: const FullType(UserDetailsQuota_Relative)) result.relative = serializers.deserialize(value, specifiedType: const FullType(num)) as num?;
as UserDetailsQuota_Relative?;
break; break;
case 'total': case 'total':
result.total = serializers.deserialize(value, specifiedType: const FullType(UserDetailsQuota_Total)) result.total = serializers.deserialize(value, specifiedType: const FullType(num)) as num?;
as UserDetailsQuota_Total?;
break; break;
case 'used': case 'used':
result.used = serializers.deserialize(value, specifiedType: const FullType(UserDetailsQuota_Used)) result.used = serializers.deserialize(value, specifiedType: const FullType(num)) as num?;
as UserDetailsQuota_Used?;
break; break;
} }
} }
@ -10786,33 +10782,33 @@ class UserDetails_BackendCapabilitiesBuilder
abstract mixin class UserDetailsQuotaInterfaceBuilder { abstract mixin class UserDetailsQuotaInterfaceBuilder {
void replace(UserDetailsQuotaInterface other); void replace(UserDetailsQuotaInterface other);
void update(void Function(UserDetailsQuotaInterfaceBuilder) updates); void update(void Function(UserDetailsQuotaInterfaceBuilder) updates);
UserDetailsQuota_Free? get free; num? get free;
set free(UserDetailsQuota_Free? free); set free(num? free);
UserDetailsQuota_Quota? get quota; UserDetailsQuota_Quota? get quota;
set quota(UserDetailsQuota_Quota? quota); set quota(UserDetailsQuota_Quota? quota);
UserDetailsQuota_Relative? get relative; num? get relative;
set relative(UserDetailsQuota_Relative? relative); set relative(num? relative);
UserDetailsQuota_Total? get total; num? get total;
set total(UserDetailsQuota_Total? total); set total(num? total);
UserDetailsQuota_Used? get used; num? get used;
set used(UserDetailsQuota_Used? used); set used(num? used);
} }
class _$UserDetailsQuota extends UserDetailsQuota { class _$UserDetailsQuota extends UserDetailsQuota {
@override @override
final UserDetailsQuota_Free? free; final num? free;
@override @override
final UserDetailsQuota_Quota? quota; final UserDetailsQuota_Quota? quota;
@override @override
final UserDetailsQuota_Relative? relative; final num? relative;
@override @override
final UserDetailsQuota_Total? total; final num? total;
@override @override
final UserDetailsQuota_Used? used; final num? used;
factory _$UserDetailsQuota([void Function(UserDetailsQuotaBuilder)? updates]) => factory _$UserDetailsQuota([void Function(UserDetailsQuotaBuilder)? updates]) =>
(UserDetailsQuotaBuilder()..update(updates))._build(); (UserDetailsQuotaBuilder()..update(updates))._build();
@ -10830,11 +10826,11 @@ class _$UserDetailsQuota extends UserDetailsQuota {
if (identical(other, this)) return true; if (identical(other, this)) return true;
final dynamic _$dynamicOther = other; final dynamic _$dynamicOther = other;
return other is UserDetailsQuota && return other is UserDetailsQuota &&
free == _$dynamicOther.free && free == other.free &&
quota == _$dynamicOther.quota && quota == _$dynamicOther.quota &&
relative == _$dynamicOther.relative && relative == other.relative &&
total == _$dynamicOther.total && total == other.total &&
used == _$dynamicOther.used; used == other.used;
} }
@override @override
@ -10865,25 +10861,25 @@ class UserDetailsQuotaBuilder
implements Builder<UserDetailsQuota, UserDetailsQuotaBuilder>, UserDetailsQuotaInterfaceBuilder { implements Builder<UserDetailsQuota, UserDetailsQuotaBuilder>, UserDetailsQuotaInterfaceBuilder {
_$UserDetailsQuota? _$v; _$UserDetailsQuota? _$v;
UserDetailsQuota_Free? _free; num? _free;
UserDetailsQuota_Free? get free => _$this._free; num? get free => _$this._free;
set free(covariant UserDetailsQuota_Free? free) => _$this._free = free; set free(covariant num? free) => _$this._free = free;
UserDetailsQuota_Quota? _quota; UserDetailsQuota_Quota? _quota;
UserDetailsQuota_Quota? get quota => _$this._quota; UserDetailsQuota_Quota? get quota => _$this._quota;
set quota(covariant UserDetailsQuota_Quota? quota) => _$this._quota = quota; set quota(covariant UserDetailsQuota_Quota? quota) => _$this._quota = quota;
UserDetailsQuota_Relative? _relative; num? _relative;
UserDetailsQuota_Relative? get relative => _$this._relative; num? get relative => _$this._relative;
set relative(covariant UserDetailsQuota_Relative? relative) => _$this._relative = relative; set relative(covariant num? relative) => _$this._relative = relative;
UserDetailsQuota_Total? _total; num? _total;
UserDetailsQuota_Total? get total => _$this._total; num? get total => _$this._total;
set total(covariant UserDetailsQuota_Total? total) => _$this._total = total; set total(covariant num? total) => _$this._total = total;
UserDetailsQuota_Used? _used; num? _used;
UserDetailsQuota_Used? get used => _$this._used; num? get used => _$this._used;
set used(covariant UserDetailsQuota_Used? used) => _$this._used = used; set used(covariant num? used) => _$this._used = used;
UserDetailsQuotaBuilder(); UserDetailsQuotaBuilder();

Loading…
Cancel
Save