Skip to content

Commit 9f530d7

Browse files
author
serverpod_cloud
committed
feat: 6d435ff0dd736d01cbd76fc6ccbf6cf39931da4e
1 parent d3a6cc3 commit 9f530d7

4 files changed

Lines changed: 726 additions & 451 deletions

File tree

ground_control_client/lib/src/protocol/client.dart

Lines changed: 80 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -31,36 +31,38 @@ import 'package:ground_control_client/src/protocol/domains/billing/models/billin
3131
as _i11;
3232
import 'package:ground_control_client/src/protocol/domains/billing/models/payment_setup_intent.dart'
3333
as _i12;
34-
import 'package:ground_control_client/src/protocol/features/custom_domain_name/models/view_models/custom_domain_name_with_default_domains.dart'
34+
import 'package:ground_control_client/src/protocol/domains/billing/models/payment_method.dart'
3535
as _i13;
36-
import 'package:ground_control_client/src/protocol/features/custom_domain_name/models/domain_name_target.dart'
36+
import 'package:ground_control_client/src/protocol/features/custom_domain_name/models/view_models/custom_domain_name_with_default_domains.dart'
3737
as _i14;
38-
import 'package:ground_control_client/src/protocol/features/custom_domain_name/models/custom_domain_name_list.dart'
38+
import 'package:ground_control_client/src/protocol/features/custom_domain_name/models/domain_name_target.dart'
3939
as _i15;
40-
import 'package:ground_control_client/src/protocol/features/custom_domain_name/models/domain_name_status.dart'
40+
import 'package:ground_control_client/src/protocol/features/custom_domain_name/models/custom_domain_name_list.dart'
4141
as _i16;
42-
import 'package:ground_control_client/src/protocol/features/environment_variables/models/environment_variable.dart'
42+
import 'package:ground_control_client/src/protocol/features/custom_domain_name/models/domain_name_status.dart'
4343
as _i17;
44-
import 'package:ground_control_client/src/protocol/domains/logs/models/log_record.dart'
44+
import 'package:ground_control_client/src/protocol/features/environment_variables/models/environment_variable.dart'
4545
as _i18;
46-
import 'package:ground_control_client/src/protocol/features/database/models/database_connection.dart'
46+
import 'package:ground_control_client/src/protocol/domains/logs/models/log_record.dart'
4747
as _i19;
48-
import 'package:ground_control_client/src/protocol/features/project/models/project_config.dart'
48+
import 'package:ground_control_client/src/protocol/features/database/models/database_connection.dart'
4949
as _i20;
50-
import 'package:ground_control_client/src/protocol/features/project/models/role.dart'
50+
import 'package:ground_control_client/src/protocol/features/project/models/project_config.dart'
5151
as _i21;
52-
import 'package:ground_control_client/src/protocol/domains/status/models/deploy_attempt.dart'
52+
import 'package:ground_control_client/src/protocol/features/project/models/role.dart'
5353
as _i22;
54-
import 'package:ground_control_client/src/protocol/domains/status/models/deploy_attempt_stage.dart'
54+
import 'package:ground_control_client/src/protocol/domains/status/models/deploy_attempt.dart'
5555
as _i23;
56-
import 'package:serverpod_auth_idp_client/serverpod_auth_idp_client.dart'
56+
import 'package:ground_control_client/src/protocol/domains/status/models/deploy_attempt_stage.dart'
5757
as _i24;
58-
import 'package:serverpod_auth_migration_client/serverpod_auth_migration_client.dart'
58+
import 'package:serverpod_auth_idp_client/serverpod_auth_idp_client.dart'
5959
as _i25;
60-
import 'package:serverpod_auth_bridge_client/serverpod_auth_bridge_client.dart'
60+
import 'package:serverpod_auth_migration_client/serverpod_auth_migration_client.dart'
6161
as _i26;
62-
import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i27;
63-
import 'protocol.dart' as _i28;
62+
import 'package:serverpod_auth_bridge_client/serverpod_auth_bridge_client.dart'
63+
as _i27;
64+
import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i28;
65+
import 'protocol.dart' as _i29;
6466

6567
/// Endpoint for global administrator to handle procurement for users.
6668
/// {@category Endpoint}
@@ -381,6 +383,23 @@ class EndpointBilling extends _i1.EndpointRef {
381383
'createSetupIntent',
382384
{},
383385
);
386+
387+
/// Lists all payment methods for the authenticated user.
388+
///
389+
/// This endpoint retrieves all payment methods (currently cards) that have been
390+
/// saved by the user through the payment provider. Each payment method includes
391+
/// details such as card brand, last 4 digits, expiry date, etc.
392+
///
393+
/// Returns a list of [PaymentMethod] objects, which may be empty if no payment
394+
/// methods have been set up.
395+
///
396+
/// Throws [NotFoundException] if the user is not found or has no payment customer.
397+
_i2.Future<List<_i13.PaymentMethod>> listPaymentMethods() =>
398+
caller.callServerEndpoint<List<_i13.PaymentMethod>>(
399+
'billing',
400+
'listPaymentMethods',
401+
{},
402+
);
384403
}
385404

386405
/// {@category Endpoint}
@@ -390,12 +409,12 @@ class EndpointCustomDomainName extends _i1.EndpointRef {
390409
@override
391410
String get name => 'customDomainName';
392411

393-
_i2.Future<_i13.CustomDomainNameWithDefaultDomains> add({
412+
_i2.Future<_i14.CustomDomainNameWithDefaultDomains> add({
394413
required String domainName,
395-
required _i14.DomainNameTarget target,
414+
required _i15.DomainNameTarget target,
396415
required String cloudCapsuleId,
397416
}) =>
398-
caller.callServerEndpoint<_i13.CustomDomainNameWithDefaultDomains>(
417+
caller.callServerEndpoint<_i14.CustomDomainNameWithDefaultDomains>(
399418
'customDomainName',
400419
'add',
401420
{
@@ -418,19 +437,19 @@ class EndpointCustomDomainName extends _i1.EndpointRef {
418437
},
419438
);
420439

421-
_i2.Future<_i15.CustomDomainNameList> list(
440+
_i2.Future<_i16.CustomDomainNameList> list(
422441
{required String cloudCapsuleId}) =>
423-
caller.callServerEndpoint<_i15.CustomDomainNameList>(
442+
caller.callServerEndpoint<_i16.CustomDomainNameList>(
424443
'customDomainName',
425444
'list',
426445
{'cloudCapsuleId': cloudCapsuleId},
427446
);
428447

429-
_i2.Future<_i16.DomainNameStatus> refreshRecord({
448+
_i2.Future<_i17.DomainNameStatus> refreshRecord({
430449
required String domainName,
431450
required String cloudCapsuleId,
432451
}) =>
433-
caller.callServerEndpoint<_i16.DomainNameStatus>(
452+
caller.callServerEndpoint<_i17.DomainNameStatus>(
434453
'customDomainName',
435454
'refreshRecord',
436455
{
@@ -465,12 +484,12 @@ class EndpointEnvironmentVariables extends _i1.EndpointRef {
465484

466485
/// Creates a new [EnvironmentVariable] with the specified [name] and [value].
467486
/// Throws a [DuplicateEntryException] if an environment variable with the same name already exists.
468-
_i2.Future<_i17.EnvironmentVariable> create(
487+
_i2.Future<_i18.EnvironmentVariable> create(
469488
String name,
470489
String value,
471490
String cloudCapsuleId,
472491
) =>
473-
caller.callServerEndpoint<_i17.EnvironmentVariable>(
492+
caller.callServerEndpoint<_i18.EnvironmentVariable>(
474493
'environmentVariables',
475494
'create',
476495
{
@@ -482,11 +501,11 @@ class EndpointEnvironmentVariables extends _i1.EndpointRef {
482501

483502
/// Fetches the specified environment variable.
484503
/// Throws a [NotFoundException] if the environment variable is not found.
485-
_i2.Future<_i17.EnvironmentVariable> read({
504+
_i2.Future<_i18.EnvironmentVariable> read({
486505
required String name,
487506
required String cloudCapsuleId,
488507
}) =>
489-
caller.callServerEndpoint<_i17.EnvironmentVariable>(
508+
caller.callServerEndpoint<_i18.EnvironmentVariable>(
490509
'environmentVariables',
491510
'read',
492511
{
@@ -496,21 +515,21 @@ class EndpointEnvironmentVariables extends _i1.EndpointRef {
496515
);
497516

498517
/// Gets the list of environment variables for the given [cloudCapsuleId].
499-
_i2.Future<List<_i17.EnvironmentVariable>> list(String cloudCapsuleId) =>
500-
caller.callServerEndpoint<List<_i17.EnvironmentVariable>>(
518+
_i2.Future<List<_i18.EnvironmentVariable>> list(String cloudCapsuleId) =>
519+
caller.callServerEndpoint<List<_i18.EnvironmentVariable>>(
501520
'environmentVariables',
502521
'list',
503522
{'cloudCapsuleId': cloudCapsuleId},
504523
);
505524

506525
/// Creates a new [EnvironmentVariable] with the specified [name] and [value].
507526
/// Throws a [NotFoundException] if the environment variable is not found.
508-
_i2.Future<_i17.EnvironmentVariable> update({
527+
_i2.Future<_i18.EnvironmentVariable> update({
509528
required String name,
510529
required String value,
511530
required String cloudCapsuleId,
512531
}) =>
513-
caller.callServerEndpoint<_i17.EnvironmentVariable>(
532+
caller.callServerEndpoint<_i18.EnvironmentVariable>(
514533
'environmentVariables',
515534
'update',
516535
{
@@ -522,11 +541,11 @@ class EndpointEnvironmentVariables extends _i1.EndpointRef {
522541

523542
/// Permanently deletes an environment variable.
524543
/// Throws a [NotFoundException] if the environment variable is not found.
525-
_i2.Future<_i17.EnvironmentVariable> delete({
544+
_i2.Future<_i18.EnvironmentVariable> delete({
526545
required String cloudCapsuleId,
527546
required String name,
528547
}) =>
529-
caller.callServerEndpoint<_i17.EnvironmentVariable>(
548+
caller.callServerEndpoint<_i18.EnvironmentVariable>(
530549
'environmentVariables',
531550
'delete',
532551
{
@@ -545,15 +564,15 @@ class EndpointLogs extends _i1.EndpointRef {
545564
String get name => 'logs';
546565

547566
/// Fetches log records from the specified project.
548-
_i2.Stream<_i18.LogRecord> fetchRecords({
567+
_i2.Stream<_i19.LogRecord> fetchRecords({
549568
String? cloudProjectId,
550569
String? cloudCapsuleId,
551570
DateTime? beforeTime,
552571
DateTime? afterTime,
553572
int? limit,
554573
}) =>
555-
caller.callStreamingServerEndpoint<_i2.Stream<_i18.LogRecord>,
556-
_i18.LogRecord>(
574+
caller.callStreamingServerEndpoint<_i2.Stream<_i19.LogRecord>,
575+
_i19.LogRecord>(
557576
'logs',
558577
'fetchRecords',
559578
{
@@ -569,13 +588,13 @@ class EndpointLogs extends _i1.EndpointRef {
569588
/// Tails log records from the specified project.
570589
/// Continues until the client unsubscribes, [limit] is reached,
571590
/// or the internal max limit is reached.
572-
_i2.Stream<_i18.LogRecord> tailRecords({
591+
_i2.Stream<_i19.LogRecord> tailRecords({
573592
String? cloudProjectId,
574593
String? cloudCapsuleId,
575594
int? limit,
576595
}) =>
577-
caller.callStreamingServerEndpoint<_i2.Stream<_i18.LogRecord>,
578-
_i18.LogRecord>(
596+
caller.callStreamingServerEndpoint<_i2.Stream<_i19.LogRecord>,
597+
_i19.LogRecord>(
579598
'logs',
580599
'tailRecords',
581600
{
@@ -587,14 +606,14 @@ class EndpointLogs extends _i1.EndpointRef {
587606
);
588607

589608
/// Fetches the build log records for the specified deploy attempt.
590-
_i2.Stream<_i18.LogRecord> fetchBuildLog({
609+
_i2.Stream<_i19.LogRecord> fetchBuildLog({
591610
String? cloudProjectId,
592611
String? cloudCapsuleId,
593612
required String attemptId,
594613
int? limit,
595614
}) =>
596-
caller.callStreamingServerEndpoint<_i2.Stream<_i18.LogRecord>,
597-
_i18.LogRecord>(
615+
caller.callStreamingServerEndpoint<_i2.Stream<_i19.LogRecord>,
616+
_i19.LogRecord>(
598617
'logs',
599618
'fetchBuildLog',
600619
{
@@ -648,9 +667,9 @@ class EndpointDatabase extends _i1.EndpointRef {
648667
@override
649668
String get name => 'database';
650669

651-
_i2.Future<_i19.DatabaseConnection> getConnectionDetails(
670+
_i2.Future<_i20.DatabaseConnection> getConnectionDetails(
652671
{required String cloudCapsuleId}) =>
653-
caller.callServerEndpoint<_i19.DatabaseConnection>(
672+
caller.callServerEndpoint<_i20.DatabaseConnection>(
654673
'database',
655674
'getConnectionDetails',
656675
{'cloudCapsuleId': cloudCapsuleId},
@@ -758,9 +777,9 @@ class EndpointProjects extends _i1.EndpointRef {
758777
{'cloudProjectId': cloudProjectId},
759778
);
760779

761-
_i2.Future<_i20.ProjectConfig> fetchProjectConfig(
780+
_i2.Future<_i21.ProjectConfig> fetchProjectConfig(
762781
{required String cloudProjectId}) =>
763-
caller.callServerEndpoint<_i20.ProjectConfig>(
782+
caller.callServerEndpoint<_i21.ProjectConfig>(
764783
'projects',
765784
'fetchProjectConfig',
766785
{'cloudProjectId': cloudProjectId},
@@ -861,9 +880,9 @@ class EndpointRoles extends _i1.EndpointRef {
861880
String get name => 'roles';
862881

863882
/// Fetches the user roles for a project.
864-
_i2.Future<List<_i21.Role>> fetchRolesForProject(
883+
_i2.Future<List<_i22.Role>> fetchRolesForProject(
865884
{required String cloudProjectId}) =>
866-
caller.callServerEndpoint<List<_i21.Role>>(
885+
caller.callServerEndpoint<List<_i22.Role>>(
867886
'roles',
868887
'fetchRolesForProject',
869888
{'cloudProjectId': cloudProjectId},
@@ -921,11 +940,11 @@ class EndpointStatus extends _i1.EndpointRef {
921940

922941
/// Gets deploy attempts of the specified capsule.
923942
/// Gets the recent-most attempts, up till [limit] if specified.
924-
_i2.Future<List<_i22.DeployAttempt>> getDeployAttempts({
943+
_i2.Future<List<_i23.DeployAttempt>> getDeployAttempts({
925944
required String cloudCapsuleId,
926945
int? limit,
927946
}) =>
928-
caller.callServerEndpoint<List<_i22.DeployAttempt>>(
947+
caller.callServerEndpoint<List<_i23.DeployAttempt>>(
929948
'status',
930949
'getDeployAttempts',
931950
{
@@ -935,11 +954,11 @@ class EndpointStatus extends _i1.EndpointRef {
935954
);
936955

937956
/// Gets the specified deploy attempt status of the a capsule.
938-
_i2.Future<List<_i23.DeployAttemptStage>> getDeployAttemptStatus({
957+
_i2.Future<List<_i24.DeployAttemptStage>> getDeployAttemptStatus({
939958
required String cloudCapsuleId,
940959
required String attemptId,
941960
}) =>
942-
caller.callServerEndpoint<List<_i23.DeployAttemptStage>>(
961+
caller.callServerEndpoint<List<_i24.DeployAttemptStage>>(
943962
'status',
944963
'getDeployAttemptStatus',
945964
{
@@ -991,20 +1010,20 @@ class EndpointUsers extends _i1.EndpointRef {
9911010

9921011
class Modules {
9931012
Modules(Client client) {
994-
serverpod_auth_idp = _i24.Caller(client);
995-
serverpod_auth_migration = _i25.Caller(client);
996-
serverpod_auth_bridge = _i26.Caller(client);
997-
auth = _i27.Caller(client);
1013+
serverpod_auth_idp = _i25.Caller(client);
1014+
serverpod_auth_migration = _i26.Caller(client);
1015+
serverpod_auth_bridge = _i27.Caller(client);
1016+
auth = _i28.Caller(client);
9981017
serverpod_auth_core = _i8.Caller(client);
9991018
}
10001019

1001-
late final _i24.Caller serverpod_auth_idp;
1020+
late final _i25.Caller serverpod_auth_idp;
10021021

1003-
late final _i25.Caller serverpod_auth_migration;
1022+
late final _i26.Caller serverpod_auth_migration;
10041023

1005-
late final _i26.Caller serverpod_auth_bridge;
1024+
late final _i27.Caller serverpod_auth_bridge;
10061025

1007-
late final _i27.Caller auth;
1026+
late final _i28.Caller auth;
10081027

10091028
late final _i8.Caller serverpod_auth_core;
10101029
}
@@ -1025,7 +1044,7 @@ class Client extends _i1.ServerpodClientShared {
10251044
bool? disconnectStreamsOnLostInternetConnection,
10261045
}) : super(
10271046
host,
1028-
_i28.Protocol(),
1047+
_i29.Protocol(),
10291048
securityContext: securityContext,
10301049
authenticationKeyManager: authenticationKeyManager,
10311050
streamingConnectionTimeout: streamingConnectionTimeout,

0 commit comments

Comments
 (0)