diff --git a/packages/shorebird_code_push_protocol/lib/src/models/plan.dart b/packages/shorebird_code_push_protocol/lib/src/models/plan.dart index 454a01a1..de0ed5e8 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/plan.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/plan.dart @@ -23,6 +23,7 @@ class Plan { required this.isTiered, required this.isTrial, required this.availableRoles, + required this.mauInsightEnabled, this.pricePerOverageInstall, this.maxTeamSize, }); @@ -72,6 +73,9 @@ class Plan { /// automatically at the end of the trial period. final bool isTrial; + /// Whether or not MAU insights are supported for the plan. + final bool mauInsightEnabled; + /// The maximum number of collaborators allowed per account. This will be null /// for accounts with unlimited collaborators. final int? maxTeamSize; diff --git a/packages/shorebird_code_push_protocol/lib/src/models/plan.g.dart b/packages/shorebird_code_push_protocol/lib/src/models/plan.g.dart index 3f6d1225..e1a7585f 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/plan.g.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/plan.g.dart @@ -43,6 +43,10 @@ Plan _$PlanFromJson(Map json) => $checkedCreate( ), ), ), + mauInsightEnabled: $checkedConvert( + 'mau_insight_enabled', + (v) => v as bool, + ), pricePerOverageInstall: $checkedConvert( 'price_per_overage_install', (v) => v == null ? null : Decimal.fromJson(v as String), @@ -63,6 +67,7 @@ Plan _$PlanFromJson(Map json) => $checkedCreate( 'isTiered': 'is_tiered', 'isTrial': 'is_trial', 'availableRoles': 'available_roles', + 'mauInsightEnabled': 'mau_insight_enabled', 'pricePerOverageInstall': 'price_per_overage_install', 'maxTeamSize': 'max_team_size', }, @@ -79,6 +84,7 @@ Map _$PlanToJson(Plan instance) => { 'cancel_at_period_end': instance.cancelAtPeriodEnd, 'is_tiered': instance.isTiered, 'is_trial': instance.isTrial, + 'mau_insight_enabled': instance.mauInsightEnabled, 'max_team_size': instance.maxTeamSize, 'available_roles': instance.availableRoles.map( (k, e) => MapEntry(_$RoleEnumMap[k]!, e), diff --git a/packages/shorebird_code_push_protocol/test/src/models/plan_test.dart b/packages/shorebird_code_push_protocol/test/src/models/plan_test.dart index a56a5b0a..c4f0af9e 100644 --- a/packages/shorebird_code_push_protocol/test/src/models/plan_test.dart +++ b/packages/shorebird_code_push_protocol/test/src/models/plan_test.dart @@ -17,6 +17,7 @@ void main() { maxTeamSize: 42, pricePerOverageInstall: Decimal.fromInt(10), isTrial: true, + mauInsightEnabled: true, availableRoles: { Role.admin: [ 'apps.view',