@@ -60,6 +60,51 @@ import 'package:serverpod_auth_bridge_client/serverpod_auth_bridge_client.dart'
6060import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i26;
6161import 'protocol.dart' as _i27;
6262
63+ /// Endpoint for global administrator to handle procurement for users.
64+ /// {@category Endpoint}
65+ class EndpointAdminProcurement extends _i1.EndpointRef {
66+ EndpointAdminProcurement (_i1.EndpointCaller caller) : super (caller);
67+
68+ @override
69+ String get name => 'adminProcurement' ;
70+
71+ /// Procures a product for a user.
72+ /// If [productVersion] is not provided, the latest version is used.
73+ /// If [overrideChecks] is true, the product availability checks are overridden.
74+ ///
75+ /// Throws a [NotFoundException] if the user or product is not found.
76+ /// Throws a [InvalidValueException] if the user has no owner (not fully registered).
77+ _i2.Future <void > procureProduct ({
78+ required String userEmail,
79+ required String productName,
80+ int ? productVersion,
81+ bool ? overrideChecks,
82+ }) =>
83+ caller.callServerEndpoint <void >(
84+ 'adminProcurement' ,
85+ 'procureProduct' ,
86+ {
87+ 'userEmail' : userEmail,
88+ 'productName' : productName,
89+ 'productVersion' : productVersion,
90+ 'overrideChecks' : overrideChecks,
91+ },
92+ );
93+
94+ /// Fetches a user's procured products.
95+ /// Returns a list of `(String, String)` with the product ID and its type.
96+ ///
97+ /// Throws a [NotFoundException] if the user is not found.
98+ /// Throws a [InvalidValueException] if the user has no owner (not fully registered).
99+ _i2.Future <List <(String , String )>> listProcuredProducts (
100+ {required String userEmail}) =>
101+ caller.callServerEndpoint< List <(String , String )>> (
102+ 'adminProcurement' ,
103+ 'listProcuredProducts' ,
104+ {'userEmail' : userEmail},
105+ );
106+ }
107+
63108/// Endpoint for global administrator projects access.
64109/// {@category Endpoint}
65110class EndpointAdminProjects extends _i1.EndpointRef {
@@ -949,6 +994,7 @@ class Client extends _i1.ServerpodClientShared {
949994 disconnectStreamsOnLostInternetConnection:
950995 disconnectStreamsOnLostInternetConnection,
951996 ) {
997+ adminProcurement = EndpointAdminProcurement (this );
952998 adminProjects = EndpointAdminProjects (this );
953999 adminUsers = EndpointAdminUsers (this );
9541000 auth = EndpointAuth (this );
@@ -969,6 +1015,8 @@ class Client extends _i1.ServerpodClientShared {
9691015 modules = Modules (this );
9701016 }
9711017
1018+ late final EndpointAdminProcurement adminProcurement;
1019+
9721020 late final EndpointAdminProjects adminProjects;
9731021
9741022 late final EndpointAdminUsers adminUsers;
@@ -1007,6 +1055,7 @@ class Client extends _i1.ServerpodClientShared {
10071055
10081056 @override
10091057 Map <String , _i1.EndpointRef > get endpointRefLookup => {
1058+ 'adminProcurement' : adminProcurement,
10101059 'adminProjects' : adminProjects,
10111060 'adminUsers' : adminUsers,
10121061 'auth' : auth,
0 commit comments