1111
1212// ignore_for_file: no_leading_underscores_for_library_prefixes
1313import 'package:serverpod_client/serverpod_client.dart' as _i1;
14- import '../../../domains/billing/models/subscription.dart' as _i2;
15- import '../../../features/project/models/role.dart' as _i3;
16- import '../../../domains/capsules/models/capsule.dart' as _i4;
14+ import '../../../domains/billing/models/owner.dart' as _i2;
15+ import '../../../domains/billing/models/subscription.dart' as _i3;
16+ import '../../../features/project/models/role.dart' as _i4;
17+ import '../../../domains/capsules/models/capsule.dart' as _i5;
1718
1819/// Represents a project of a tenant.
1920/// Typically a serverpod project.
@@ -24,6 +25,8 @@ abstract class Project implements _i1.SerializableModel {
2425 DateTime ? updatedAt,
2526 this .archivedAt,
2627 required this .cloudProjectId,
28+ required this .ownerId,
29+ this .owner,
2730 this .subscription,
2831 this .roles,
2932 this .capsules,
@@ -36,9 +39,11 @@ abstract class Project implements _i1.SerializableModel {
3639 DateTime ? updatedAt,
3740 DateTime ? archivedAt,
3841 required String cloudProjectId,
39- _i2.Subscription ? subscription,
40- List <_i3.Role >? roles,
41- List <_i4.Capsule >? capsules,
42+ required _i1.UuidValue ownerId,
43+ _i2.Owner ? owner,
44+ _i3.Subscription ? subscription,
45+ List <_i4.Role >? roles,
46+ List <_i5.Capsule >? capsules,
4247 }) = _ProjectImpl ;
4348
4449 factory Project .fromJson (Map <String , dynamic > jsonSerialization) {
@@ -52,15 +57,21 @@ abstract class Project implements _i1.SerializableModel {
5257 ? null
5358 : _i1.DateTimeJsonExtension .fromJson (jsonSerialization['archivedAt' ]),
5459 cloudProjectId: jsonSerialization['cloudProjectId' ] as String ,
60+ ownerId:
61+ _i1.UuidValueJsonExtension .fromJson (jsonSerialization['ownerId' ]),
62+ owner: jsonSerialization['owner' ] == null
63+ ? null
64+ : _i2.Owner .fromJson (
65+ (jsonSerialization['owner' ] as Map <String , dynamic >)),
5566 subscription: jsonSerialization['subscription' ] == null
5667 ? null
57- : _i2 .Subscription .fromJson (
68+ : _i3 .Subscription .fromJson (
5869 (jsonSerialization['subscription' ] as Map <String , dynamic >)),
5970 roles: (jsonSerialization['roles' ] as List ? )
60- ? .map ((e) => _i3 .Role .fromJson ((e as Map <String , dynamic >)))
71+ ? .map ((e) => _i4 .Role .fromJson ((e as Map <String , dynamic >)))
6172 .toList (),
6273 capsules: (jsonSerialization['capsules' ] as List ? )
63- ? .map ((e) => _i4 .Capsule .fromJson ((e as Map <String , dynamic >)))
74+ ? .map ((e) => _i5 .Capsule .fromJson ((e as Map <String , dynamic >)))
6475 .toList (),
6576 );
6677 }
@@ -81,14 +92,20 @@ abstract class Project implements _i1.SerializableModel {
8192 /// This is the default production name of the project.
8293 String cloudProjectId;
8394
95+ /// The id of the owner of the project.
96+ _i1.UuidValue ownerId;
97+
98+ /// The owner of the project.
99+ _i2.Owner ? owner;
100+
84101 /// The subscription for this project.
85- _i2 .Subscription ? subscription;
102+ _i3 .Subscription ? subscription;
86103
87104 /// The roles for this project.
88- List <_i3 .Role >? roles;
105+ List <_i4 .Role >? roles;
89106
90107 /// The capsules belonging to this project.
91- List <_i4 .Capsule >? capsules;
108+ List <_i5 .Capsule >? capsules;
92109
93110 /// Returns a shallow copy of this [Project]
94111 /// with some or all fields replaced by the given arguments.
@@ -99,9 +116,11 @@ abstract class Project implements _i1.SerializableModel {
99116 DateTime ? updatedAt,
100117 DateTime ? archivedAt,
101118 String ? cloudProjectId,
102- _i2.Subscription ? subscription,
103- List <_i3.Role >? roles,
104- List <_i4.Capsule >? capsules,
119+ _i1.UuidValue ? ownerId,
120+ _i2.Owner ? owner,
121+ _i3.Subscription ? subscription,
122+ List <_i4.Role >? roles,
123+ List <_i5.Capsule >? capsules,
105124 });
106125 @override
107126 Map <String , dynamic > toJson () {
@@ -111,6 +130,8 @@ abstract class Project implements _i1.SerializableModel {
111130 'updatedAt' : updatedAt.toJson (),
112131 if (archivedAt != null ) 'archivedAt' : archivedAt? .toJson (),
113132 'cloudProjectId' : cloudProjectId,
133+ 'ownerId' : ownerId.toJson (),
134+ if (owner != null ) 'owner' : owner? .toJson (),
114135 if (subscription != null ) 'subscription' : subscription? .toJson (),
115136 if (roles != null ) 'roles' : roles? .toJson (valueToJson: (v) => v.toJson ()),
116137 if (capsules != null )
@@ -133,15 +154,19 @@ class _ProjectImpl extends Project {
133154 DateTime ? updatedAt,
134155 DateTime ? archivedAt,
135156 required String cloudProjectId,
136- _i2.Subscription ? subscription,
137- List <_i3.Role >? roles,
138- List <_i4.Capsule >? capsules,
157+ required _i1.UuidValue ownerId,
158+ _i2.Owner ? owner,
159+ _i3.Subscription ? subscription,
160+ List <_i4.Role >? roles,
161+ List <_i5.Capsule >? capsules,
139162 }) : super ._(
140163 id: id,
141164 createdAt: createdAt,
142165 updatedAt: updatedAt,
143166 archivedAt: archivedAt,
144167 cloudProjectId: cloudProjectId,
168+ ownerId: ownerId,
169+ owner: owner,
145170 subscription: subscription,
146171 roles: roles,
147172 capsules: capsules,
@@ -157,6 +182,8 @@ class _ProjectImpl extends Project {
157182 DateTime ? updatedAt,
158183 Object ? archivedAt = _Undefined ,
159184 String ? cloudProjectId,
185+ _i1.UuidValue ? ownerId,
186+ Object ? owner = _Undefined ,
160187 Object ? subscription = _Undefined ,
161188 Object ? roles = _Undefined ,
162189 Object ? capsules = _Undefined ,
@@ -167,13 +194,15 @@ class _ProjectImpl extends Project {
167194 updatedAt: updatedAt ?? this .updatedAt,
168195 archivedAt: archivedAt is DateTime ? ? archivedAt : this .archivedAt,
169196 cloudProjectId: cloudProjectId ?? this .cloudProjectId,
170- subscription: subscription is _i2.Subscription ?
197+ ownerId: ownerId ?? this .ownerId,
198+ owner: owner is _i2.Owner ? ? owner : this .owner? .copyWith (),
199+ subscription: subscription is _i3.Subscription ?
171200 ? subscription
172201 : this .subscription? .copyWith (),
173- roles: roles is List <_i3 .Role >?
202+ roles: roles is List <_i4 .Role >?
174203 ? roles
175204 : this .roles? .map ((e0) => e0.copyWith ()).toList (),
176- capsules: capsules is List <_i4 .Capsule >?
205+ capsules: capsules is List <_i5 .Capsule >?
177206 ? capsules
178207 : this .capsules? .map ((e0) => e0.copyWith ()).toList (),
179208 );
0 commit comments