@@ -19,23 +19,29 @@ import 'package:ground_control_client/src/protocol/protocol.dart' as _i5;
1919abstract class Owner implements _i1.SerializableModel {
2020 Owner ._({
2121 _i1.UuidValue ? id,
22+ DateTime ? createdAt,
23+ DateTime ? updatedAt,
24+ this .archivedAt,
2225 required this .externalBillingId,
2326 required this .externalPaymentId,
2427 required this .billingPortalUrl,
2528 required this .billingEmails,
26- this .primarySubscriptionId,
2729 this .user,
2830 this .billingInfo,
2931 this .projects,
30- }) : id = id ?? const _i1.Uuid ().v4obj ();
32+ }) : id = id ?? const _i1.Uuid ().v4obj (),
33+ createdAt = createdAt ?? DateTime .now (),
34+ updatedAt = updatedAt ?? DateTime .now ();
3135
3236 factory Owner ({
3337 _i1.UuidValue ? id,
38+ DateTime ? createdAt,
39+ DateTime ? updatedAt,
40+ DateTime ? archivedAt,
3441 required String externalBillingId,
3542 required String externalPaymentId,
3643 required Uri billingPortalUrl,
3744 required List <String > billingEmails,
38- String ? primarySubscriptionId,
3945 _i2.User ? user,
4046 _i3.BillingInfo ? billingInfo,
4147 List <_i4.Project >? projects,
@@ -46,6 +52,15 @@ abstract class Owner implements _i1.SerializableModel {
4652 id: jsonSerialization['id' ] == null
4753 ? null
4854 : _i1.UuidValueJsonExtension .fromJson (jsonSerialization['id' ]),
55+ createdAt: jsonSerialization['createdAt' ] == null
56+ ? null
57+ : _i1.DateTimeJsonExtension .fromJson (jsonSerialization['createdAt' ]),
58+ updatedAt: jsonSerialization['updatedAt' ] == null
59+ ? null
60+ : _i1.DateTimeJsonExtension .fromJson (jsonSerialization['updatedAt' ]),
61+ archivedAt: jsonSerialization['archivedAt' ] == null
62+ ? null
63+ : _i1.DateTimeJsonExtension .fromJson (jsonSerialization['archivedAt' ]),
4964 externalBillingId: jsonSerialization['externalBillingId' ] as String ,
5065 externalPaymentId: jsonSerialization['externalPaymentId' ] as String ,
5166 billingPortalUrl: _i1.UriJsonExtension .fromJson (
@@ -54,8 +69,6 @@ abstract class Owner implements _i1.SerializableModel {
5469 billingEmails: _i5.Protocol ().deserialize <List <String >>(
5570 jsonSerialization['billingEmails' ],
5671 ),
57- primarySubscriptionId:
58- jsonSerialization['primarySubscriptionId' ] as String ? ,
5972 user: jsonSerialization['user' ] == null
6073 ? null
6174 : _i5.Protocol ().deserialize< _i2.User > (jsonSerialization['user' ]),
@@ -75,6 +88,13 @@ abstract class Owner implements _i1.SerializableModel {
7588 /// The id of the object.
7689 _i1.UuidValue id;
7790
91+ DateTime createdAt;
92+
93+ DateTime updatedAt;
94+
95+ /// If non-null this Owner is archived.
96+ DateTime ? archivedAt;
97+
7898 String externalBillingId;
7999
80100 String externalPaymentId;
@@ -83,10 +103,6 @@ abstract class Owner implements _i1.SerializableModel {
83103
84104 List <String > billingEmails;
85105
86- /// The id of the primary (default) subscription of this owner.
87- /// Null if the owner has no subscription.
88- String ? primarySubscriptionId;
89-
90106 _i2.User ? user;
91107
92108 _i3.BillingInfo ? billingInfo;
@@ -98,11 +114,13 @@ abstract class Owner implements _i1.SerializableModel {
98114 @_i1.useResult
99115 Owner copyWith ({
100116 _i1.UuidValue ? id,
117+ DateTime ? createdAt,
118+ DateTime ? updatedAt,
119+ DateTime ? archivedAt,
101120 String ? externalBillingId,
102121 String ? externalPaymentId,
103122 Uri ? billingPortalUrl,
104123 List <String >? billingEmails,
105- String ? primarySubscriptionId,
106124 _i2.User ? user,
107125 _i3.BillingInfo ? billingInfo,
108126 List <_i4.Project >? projects,
@@ -112,12 +130,13 @@ abstract class Owner implements _i1.SerializableModel {
112130 return {
113131 '__className__' : 'Owner' ,
114132 'id' : id.toJson (),
133+ 'createdAt' : createdAt.toJson (),
134+ 'updatedAt' : updatedAt.toJson (),
135+ if (archivedAt != null ) 'archivedAt' : archivedAt? .toJson (),
115136 'externalBillingId' : externalBillingId,
116137 'externalPaymentId' : externalPaymentId,
117138 'billingPortalUrl' : billingPortalUrl.toJson (),
118139 'billingEmails' : billingEmails.toJson (),
119- if (primarySubscriptionId != null )
120- 'primarySubscriptionId' : primarySubscriptionId,
121140 if (user != null ) 'user' : user? .toJson (),
122141 if (billingInfo != null ) 'billingInfo' : billingInfo? .toJson (),
123142 if (projects != null )
@@ -136,21 +155,25 @@ class _Undefined {}
136155class _OwnerImpl extends Owner {
137156 _OwnerImpl ({
138157 _i1.UuidValue ? id,
158+ DateTime ? createdAt,
159+ DateTime ? updatedAt,
160+ DateTime ? archivedAt,
139161 required String externalBillingId,
140162 required String externalPaymentId,
141163 required Uri billingPortalUrl,
142164 required List <String > billingEmails,
143- String ? primarySubscriptionId,
144165 _i2.User ? user,
145166 _i3.BillingInfo ? billingInfo,
146167 List <_i4.Project >? projects,
147168 }) : super ._(
148169 id: id,
170+ createdAt: createdAt,
171+ updatedAt: updatedAt,
172+ archivedAt: archivedAt,
149173 externalBillingId: externalBillingId,
150174 externalPaymentId: externalPaymentId,
151175 billingPortalUrl: billingPortalUrl,
152176 billingEmails: billingEmails,
153- primarySubscriptionId: primarySubscriptionId,
154177 user: user,
155178 billingInfo: billingInfo,
156179 projects: projects,
@@ -162,25 +185,27 @@ class _OwnerImpl extends Owner {
162185 @override
163186 Owner copyWith ({
164187 _i1.UuidValue ? id,
188+ DateTime ? createdAt,
189+ DateTime ? updatedAt,
190+ Object ? archivedAt = _Undefined ,
165191 String ? externalBillingId,
166192 String ? externalPaymentId,
167193 Uri ? billingPortalUrl,
168194 List <String >? billingEmails,
169- Object ? primarySubscriptionId = _Undefined ,
170195 Object ? user = _Undefined ,
171196 Object ? billingInfo = _Undefined ,
172197 Object ? projects = _Undefined ,
173198 }) {
174199 return Owner (
175200 id: id ?? this .id,
201+ createdAt: createdAt ?? this .createdAt,
202+ updatedAt: updatedAt ?? this .updatedAt,
203+ archivedAt: archivedAt is DateTime ? ? archivedAt : this .archivedAt,
176204 externalBillingId: externalBillingId ?? this .externalBillingId,
177205 externalPaymentId: externalPaymentId ?? this .externalPaymentId,
178206 billingPortalUrl: billingPortalUrl ?? this .billingPortalUrl,
179207 billingEmails:
180208 billingEmails ?? this .billingEmails.map ((e0) => e0).toList (),
181- primarySubscriptionId: primarySubscriptionId is String ?
182- ? primarySubscriptionId
183- : this .primarySubscriptionId,
184209 user: user is _i2.User ? ? user : this .user? .copyWith (),
185210 billingInfo: billingInfo is _i3.BillingInfo ?
186211 ? billingInfo
0 commit comments