Skip to content

Commit 0946210

Browse files
author
serverpod_cloud
committed
refactor: 2ad1820ffd1264dcb0938e3a111bc27d20fcc9df
1 parent 92c9a9d commit 0946210

6 files changed

Lines changed: 381 additions & 471 deletions

File tree

ground_control_client/lib/src/protocol/domains/products/models/plan_info.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import 'package:ground_control_client/src/protocol/protocol.dart' as _i3;
1919
abstract class PlanInfo implements _i1.SerializableModel {
2020
PlanInfo._({
2121
required this.productId,
22-
required this.name,
22+
this.name,
2323
required this.displayName,
2424
this.description,
2525
this.trialLength,
@@ -30,7 +30,7 @@ abstract class PlanInfo implements _i1.SerializableModel {
3030

3131
factory PlanInfo({
3232
required String productId,
33-
required String name,
33+
String? name,
3434
required String displayName,
3535
String? description,
3636
int? trialLength,
@@ -42,7 +42,7 @@ abstract class PlanInfo implements _i1.SerializableModel {
4242
factory PlanInfo.fromJson(Map<String, dynamic> jsonSerialization) {
4343
return PlanInfo(
4444
productId: jsonSerialization['productId'] as String,
45-
name: jsonSerialization['name'] as String,
45+
name: jsonSerialization['name'] as String?,
4646
displayName: jsonSerialization['displayName'] as String,
4747
description: jsonSerialization['description'] as String?,
4848
trialLength: jsonSerialization['trialLength'] as int?,
@@ -63,7 +63,7 @@ abstract class PlanInfo implements _i1.SerializableModel {
6363
String productId;
6464

6565
/// Deprecated: Use displayName instead.
66-
String name;
66+
String? name;
6767

6868
/// The user-friendly name of the product.
6969
/// (This is not the same as the technical product ID name.)
@@ -104,7 +104,7 @@ abstract class PlanInfo implements _i1.SerializableModel {
104104
return {
105105
'__className__': 'PlanInfo',
106106
'productId': productId,
107-
'name': name,
107+
if (name != null) 'name': name,
108108
'displayName': displayName,
109109
if (description != null) 'description': description,
110110
if (trialLength != null) 'trialLength': trialLength,
@@ -127,7 +127,7 @@ class _Undefined {}
127127
class _PlanInfoImpl extends PlanInfo {
128128
_PlanInfoImpl({
129129
required String productId,
130-
required String name,
130+
String? name,
131131
required String displayName,
132132
String? description,
133133
int? trialLength,
@@ -151,7 +151,7 @@ class _PlanInfoImpl extends PlanInfo {
151151
@override
152152
PlanInfo copyWith({
153153
String? productId,
154-
String? name,
154+
Object? name = _Undefined,
155155
String? displayName,
156156
Object? description = _Undefined,
157157
Object? trialLength = _Undefined,
@@ -161,7 +161,7 @@ class _PlanInfoImpl extends PlanInfo {
161161
}) {
162162
return PlanInfo(
163163
productId: productId ?? this.productId,
164-
name: name ?? this.name,
164+
name: name is String? ? name : this.name,
165165
displayName: displayName ?? this.displayName,
166166
description: description is String? ? description : this.description,
167167
trialLength: trialLength is int? ? trialLength : this.trialLength,

ground_control_client/lib/src/protocol/domains/products/models/subscription_info.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ abstract class SubscriptionInfo implements _i1.SerializableModel {
2323
required this.cancelled,
2424
required this.subscriptionId,
2525
required this.planProductId,
26-
required this.planName,
26+
this.planName,
2727
required this.planDisplayName,
2828
this.planDescription,
2929
this.projectsLimit,
@@ -37,7 +37,7 @@ abstract class SubscriptionInfo implements _i1.SerializableModel {
3737
required bool cancelled,
3838
required String subscriptionId,
3939
required String planProductId,
40-
required String planName,
40+
String? planName,
4141
required String planDisplayName,
4242
String? planDescription,
4343
int? projectsLimit,
@@ -62,7 +62,7 @@ abstract class SubscriptionInfo implements _i1.SerializableModel {
6262
cancelled: _i1.BoolJsonExtension.fromJson(jsonSerialization['cancelled']),
6363
subscriptionId: jsonSerialization['subscriptionId'] as String,
6464
planProductId: jsonSerialization['planProductId'] as String,
65-
planName: jsonSerialization['planName'] as String,
65+
planName: jsonSerialization['planName'] as String?,
6666
planDisplayName: jsonSerialization['planDisplayName'] as String,
6767
planDescription: jsonSerialization['planDescription'] as String?,
6868
projectsLimit: jsonSerialization['projectsLimit'] as int?,
@@ -91,7 +91,7 @@ abstract class SubscriptionInfo implements _i1.SerializableModel {
9191
String planProductId;
9292

9393
/// Deprecated: Use planDisplayName instead.
94-
String planName;
94+
String? planName;
9595

9696
/// The display name of the plan.
9797
String planDisplayName;
@@ -129,7 +129,7 @@ abstract class SubscriptionInfo implements _i1.SerializableModel {
129129
'cancelled': cancelled,
130130
'subscriptionId': subscriptionId,
131131
'planProductId': planProductId,
132-
'planName': planName,
132+
if (planName != null) 'planName': planName,
133133
'planDisplayName': planDisplayName,
134134
if (planDescription != null) 'planDescription': planDescription,
135135
if (projectsLimit != null) 'projectsLimit': projectsLimit,
@@ -153,7 +153,7 @@ class _SubscriptionInfoImpl extends SubscriptionInfo {
153153
required bool cancelled,
154154
required String subscriptionId,
155155
required String planProductId,
156-
required String planName,
156+
String? planName,
157157
required String planDisplayName,
158158
String? planDescription,
159159
int? projectsLimit,
@@ -183,7 +183,7 @@ class _SubscriptionInfoImpl extends SubscriptionInfo {
183183
bool? cancelled,
184184
String? subscriptionId,
185185
String? planProductId,
186-
String? planName,
186+
Object? planName = _Undefined,
187187
String? planDisplayName,
188188
Object? planDescription = _Undefined,
189189
Object? projectsLimit = _Undefined,
@@ -198,7 +198,7 @@ class _SubscriptionInfoImpl extends SubscriptionInfo {
198198
cancelled: cancelled ?? this.cancelled,
199199
subscriptionId: subscriptionId ?? this.subscriptionId,
200200
planProductId: planProductId ?? this.planProductId,
201-
planName: planName ?? this.planName,
201+
planName: planName is String? ? planName : this.planName,
202202
planDisplayName: planDisplayName ?? this.planDisplayName,
203203
planDescription: planDescription is String?
204204
? planDescription

ground_control_client/lib/src/protocol/domains/users/models/account_authorization.dart

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)