Skip to content

Commit 053402e

Browse files
author
serverpod_cloud
committed
feat(gc): 5120749b026abc6f18293ba72fadaea31d5a4772
1 parent 896ff9d commit 053402e

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

ground_control_client/lib/src/protocol/client.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,20 @@ class EndpointBilling extends _i1.EndpointRef {
368368
{},
369369
);
370370

371+
@Deprecated('Use updateOwnerBilling instead')
372+
_i2.Future<_i12.Owner> updateOwner({
373+
required List<String> billingEmails,
374+
required _i13.BillingInfo billingInfo,
375+
}) =>
376+
caller.callServerEndpoint<_i12.Owner>(
377+
'billing',
378+
'updateOwner',
379+
{
380+
'billingEmails': billingEmails,
381+
'billingInfo': billingInfo,
382+
},
383+
);
384+
371385
/// Updates the owner's billing information.
372386
///
373387
/// This endpoint updates the owner's billing information, including the
@@ -380,13 +394,13 @@ class EndpointBilling extends _i1.EndpointRef {
380394
/// All data is overwritten.
381395
///
382396
/// Returns the updated [Owner] object.
383-
_i2.Future<_i12.Owner> updateOwner({
397+
_i2.Future<_i12.Owner> updateOwnerBilling({
384398
required List<String> billingEmails,
385399
required _i13.BillingInfo billingInfo,
386400
}) =>
387401
caller.callServerEndpoint<_i12.Owner>(
388402
'billing',
389-
'updateOwner',
403+
'updateOwnerBilling',
390404
{
391405
'billingEmails': billingEmails,
392406
'billingInfo': billingInfo,

ground_control_client/lib/src/protocol/domains/billing/models/owner.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ abstract class Owner implements _i1.SerializableModel {
2222
required this.externalPaymentId,
2323
required this.billingPortalUrl,
2424
required this.billingEmails,
25+
this.primarySubscriptionId,
2526
this.user,
2627
this.billingInfo,
2728
this.projects,
@@ -33,6 +34,7 @@ abstract class Owner implements _i1.SerializableModel {
3334
required String externalPaymentId,
3435
required Uri billingPortalUrl,
3536
required List<String> billingEmails,
37+
String? primarySubscriptionId,
3638
_i2.User? user,
3739
_i3.BillingInfo? billingInfo,
3840
List<_i4.Project>? projects,
@@ -48,6 +50,8 @@ abstract class Owner implements _i1.SerializableModel {
4850
billingEmails: (jsonSerialization['billingEmails'] as List)
4951
.map((e) => e as String)
5052
.toList(),
53+
primarySubscriptionId:
54+
jsonSerialization['primarySubscriptionId'] as String?,
5155
user: jsonSerialization['user'] == null
5256
? null
5357
: _i2.User.fromJson(
@@ -75,6 +79,10 @@ abstract class Owner implements _i1.SerializableModel {
7579

7680
List<String> billingEmails;
7781

82+
/// The id of the primary (default) subscription of this owner.
83+
/// Null if the owner has no subscription.
84+
String? primarySubscriptionId;
85+
7886
_i2.User? user;
7987

8088
_i3.BillingInfo? billingInfo;
@@ -90,6 +98,7 @@ abstract class Owner implements _i1.SerializableModel {
9098
String? externalPaymentId,
9199
Uri? billingPortalUrl,
92100
List<String>? billingEmails,
101+
String? primarySubscriptionId,
93102
_i2.User? user,
94103
_i3.BillingInfo? billingInfo,
95104
List<_i4.Project>? projects,
@@ -102,6 +111,8 @@ abstract class Owner implements _i1.SerializableModel {
102111
'externalPaymentId': externalPaymentId,
103112
'billingPortalUrl': billingPortalUrl.toJson(),
104113
'billingEmails': billingEmails.toJson(),
114+
if (primarySubscriptionId != null)
115+
'primarySubscriptionId': primarySubscriptionId,
105116
if (user != null) 'user': user?.toJson(),
106117
if (billingInfo != null) 'billingInfo': billingInfo?.toJson(),
107118
if (projects != null)
@@ -124,6 +135,7 @@ class _OwnerImpl extends Owner {
124135
required String externalPaymentId,
125136
required Uri billingPortalUrl,
126137
required List<String> billingEmails,
138+
String? primarySubscriptionId,
127139
_i2.User? user,
128140
_i3.BillingInfo? billingInfo,
129141
List<_i4.Project>? projects,
@@ -133,6 +145,7 @@ class _OwnerImpl extends Owner {
133145
externalPaymentId: externalPaymentId,
134146
billingPortalUrl: billingPortalUrl,
135147
billingEmails: billingEmails,
148+
primarySubscriptionId: primarySubscriptionId,
136149
user: user,
137150
billingInfo: billingInfo,
138151
projects: projects,
@@ -148,6 +161,7 @@ class _OwnerImpl extends Owner {
148161
String? externalPaymentId,
149162
Uri? billingPortalUrl,
150163
List<String>? billingEmails,
164+
Object? primarySubscriptionId = _Undefined,
151165
Object? user = _Undefined,
152166
Object? billingInfo = _Undefined,
153167
Object? projects = _Undefined,
@@ -159,6 +173,9 @@ class _OwnerImpl extends Owner {
159173
billingPortalUrl: billingPortalUrl ?? this.billingPortalUrl,
160174
billingEmails:
161175
billingEmails ?? this.billingEmails.map((e0) => e0).toList(),
176+
primarySubscriptionId: primarySubscriptionId is String?
177+
? primarySubscriptionId
178+
: this.primarySubscriptionId,
162179
user: user is _i2.User? ? user : this.user?.copyWith(),
163180
billingInfo: billingInfo is _i3.BillingInfo?
164181
? billingInfo

0 commit comments

Comments
 (0)