feat: Add features param to code_push_protocol (#3609)

This commit is contained in:
Mac
2026-02-11 10:34:43 -07:00
committed by GitHub
parent 9ffe18737a
commit 6489ad283c
3 changed files with 11 additions and 0 deletions
@@ -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;
@@ -43,6 +43,10 @@ Plan _$PlanFromJson(Map<String, dynamic> 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<String, dynamic> 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<String, dynamic> _$PlanToJson(Plan instance) => <String, dynamic>{
'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),
@@ -17,6 +17,7 @@ void main() {
maxTeamSize: 42,
pricePerOverageInstall: Decimal.fromInt(10),
isTrial: true,
mauInsightEnabled: true,
availableRoles: {
Role.admin: [
'apps.view',