Skip to content

Commit e4a5ff3

Browse files
committed
Add hardLimit property for Quota object
1 parent 63d4794 commit e4a5ff3

File tree

3 files changed

+27
-19
lines changed

3 files changed

+27
-19
lines changed

lib/jmap/quotas/quota.dart

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,30 @@ part 'quota.g.dart';
1313
@DataTypeConverter()
1414
@IdConverter()
1515
@UnsignedIntNullableConverter()
16-
@JsonSerializable(explicitToJson: true)
16+
@JsonSerializable(explicitToJson: true, includeIfNull: false)
1717
class Quota with EquatableMixin {
1818
final Id id;
1919
final ResourceType resourceType;
2020
final UnsignedInt? used;
21+
final UnsignedInt? hardLimit;
2122
final UnsignedInt? limit;
2223
final Scope scope;
2324
final String name;
2425
final List<DataType> dataTypes;
25-
26-
@JsonKey(includeIfNull: false)
2726
final UnsignedInt? warnLimit;
28-
29-
@JsonKey(includeIfNull: false)
3027
final UnsignedInt? softLimit;
31-
32-
@JsonKey(includeIfNull: false)
3328
final String? description;
3429

3530
Quota(
3631
this.id,
3732
this.resourceType,
3833
this.used,
39-
this.limit,
4034
this.scope,
4135
this.name,
4236
this.dataTypes,
4337
{
38+
this.hardLimit,
39+
this.limit,
4440
this.warnLimit,
4541
this.softLimit,
4642
this.description
@@ -56,10 +52,11 @@ class Quota with EquatableMixin {
5652
id,
5753
resourceType,
5854
used,
59-
limit,
6055
scope,
6156
name,
6257
dataTypes,
58+
hardLimit,
59+
limit,
6360
warnLimit,
6461
softLimit,
6562
description

lib/jmap/quotas/quota.g.dart

Lines changed: 14 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/jmap/quotas/get_quota_method_test.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@ void main() {
1717
Id('382312d0-fa5c-11eb-b647-2fef1ee78d9e'),
1818
ResourceType.count,
1919
UnsignedInt(20000),
20-
UnsignedInt(50000),
2120
Scope.account,
2221
23-
[DataType.mail]
22+
[DataType.mail],
23+
limit: UnsignedInt(50000),
24+
hardLimit: UnsignedInt(50000),
2425
);
2526

2627
final expectQuota2 = Quota(
2728
Id('382312d0-fa5c-11eb-b647-2fef1ee876hd'),
2829
ResourceType.count,
2930
UnsignedInt(10000),
30-
UnsignedInt(70000),
3131
Scope.account,
3232
3333
[DataType.mail, DataType.calendar, DataType.contact],
34+
limit: UnsignedInt(70000),
35+
hardLimit: UnsignedInt(70000),
3436
description: 'Personal account usage',
3537
softLimit: UnsignedInt(30000),
3638
warnLimit: UnsignedInt(12000)
@@ -58,6 +60,7 @@ void main() {
5860
"resourceType": "count",
5961
"used": 20000,
6062
"limit": 50000,
63+
"hardLimit": 50000,
6164
"scope": "account",
6265
"name": "[email protected]",
6366
"dataTypes" : ["Mail"]
@@ -69,6 +72,7 @@ void main() {
6972
"warnLimit": 12000,
7073
"softLimit": 30000,
7174
"limit": 70000,
75+
"hardLimit": 70000,
7276
"scope": "account",
7377
"name": "[email protected]",
7478
"description": "Personal account usage",

0 commit comments

Comments
 (0)