Skip to content

Commit 8fe1d00

Browse files
author
serverpod_cloud
committed
feat: cc78a07d82fa5fcae8bfef058ae79880bd63ad97
1 parent 37e23dc commit 8fe1d00

1 file changed

Lines changed: 86 additions & 66 deletions

File tree

ground_control_client/lib/src/protocol/client.dart

Lines changed: 86 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -40,41 +40,43 @@ import 'package:ground_control_client/src/protocol/domains/billing/models/paymen
4040
as _i15;
4141
import 'package:ground_control_client/src/protocol/features/capsules/models/compute_info.dart'
4242
as _i16;
43-
import 'package:ground_control_client/src/protocol/features/custom_domains/models/view_models/custom_domain_name_with_default_domains.dart'
43+
import 'package:ground_control_client/src/protocol/domains/capsules/models/compute_size_option.dart'
4444
as _i17;
45-
import 'package:ground_control_client/src/protocol/features/custom_domains/models/domain_name_target.dart'
45+
import 'package:ground_control_client/src/protocol/features/custom_domains/models/view_models/custom_domain_name_with_default_domains.dart'
4646
as _i18;
47-
import 'package:ground_control_client/src/protocol/features/custom_domains/models/custom_domain_name_list.dart'
47+
import 'package:ground_control_client/src/protocol/features/custom_domains/models/domain_name_target.dart'
4848
as _i19;
49-
import 'package:ground_control_client/src/protocol/features/custom_domains/models/domain_name_status.dart'
49+
import 'package:ground_control_client/src/protocol/features/custom_domains/models/custom_domain_name_list.dart'
5050
as _i20;
51-
import 'package:ground_control_client/src/protocol/features/databases/models/database_connection.dart'
51+
import 'package:ground_control_client/src/protocol/features/custom_domains/models/domain_name_status.dart'
5252
as _i21;
53-
import 'package:ground_control_client/src/protocol/features/databases/models/database_info.dart'
53+
import 'package:ground_control_client/src/protocol/features/databases/models/database_connection.dart'
5454
as _i22;
55-
import 'package:ground_control_client/src/protocol/features/databases/models/database_resource.dart'
55+
import 'package:ground_control_client/src/protocol/features/databases/models/database_info.dart'
5656
as _i23;
57-
import 'package:ground_control_client/src/protocol/features/databases/models/database_size.dart'
57+
import 'package:ground_control_client/src/protocol/features/databases/models/database_resource.dart'
5858
as _i24;
59-
import 'package:ground_control_client/src/protocol/domains/environment_variables/models/variable.dart'
59+
import 'package:ground_control_client/src/protocol/features/databases/models/database_size.dart'
6060
as _i25;
61-
import 'package:ground_control_client/src/protocol/features/insights/models/insights_connection_detail.dart'
61+
import 'package:ground_control_client/src/protocol/domains/environment_variables/models/variable.dart'
6262
as _i26;
63-
import 'package:ground_control_client/src/protocol/domains/logs/models/log_record.dart'
63+
import 'package:ground_control_client/src/protocol/features/insights/models/insights_connection_detail.dart'
6464
as _i27;
65-
import 'package:ground_control_client/src/protocol/domains/products/models/subscription_info.dart'
65+
import 'package:ground_control_client/src/protocol/domains/logs/models/log_record.dart'
6666
as _i28;
67-
import 'package:ground_control_client/src/protocol/domains/products/models/plan_info.dart'
67+
import 'package:ground_control_client/src/protocol/domains/products/models/subscription_info.dart'
6868
as _i29;
69-
import 'package:ground_control_client/src/protocol/features/projects/models/project_config.dart'
69+
import 'package:ground_control_client/src/protocol/domains/products/models/plan_info.dart'
7070
as _i30;
71-
import 'package:ground_control_client/src/protocol/domains/projects/models/role.dart'
71+
import 'package:ground_control_client/src/protocol/features/projects/models/project_config.dart'
7272
as _i31;
73-
import 'package:ground_control_client/src/protocol/domains/status/models/deploy_attempt_stage.dart'
73+
import 'package:ground_control_client/src/protocol/domains/projects/models/role.dart'
7474
as _i32;
75-
import 'package:serverpod_auth_idp_client/serverpod_auth_idp_client.dart'
75+
import 'package:ground_control_client/src/protocol/domains/status/models/deploy_attempt_stage.dart'
7676
as _i33;
77-
import 'protocol.dart' as _i34;
77+
import 'package:serverpod_auth_idp_client/serverpod_auth_idp_client.dart'
78+
as _i34;
79+
import 'protocol.dart' as _i35;
7880

7981
/// {@category Endpoint}
8082
class EndpointAdminMigration extends _i1.EndpointRef {
@@ -573,7 +575,7 @@ class EndpointBilling extends _i1.EndpointRef {
573575
caller.callServerEndpoint<bool>('billing', 'ownerIsInGoodStanding', {});
574576
}
575577

576-
/// Endpoint for reading capsule compute configuration.
578+
/// Endpoint for reading and updating capsule compute configuration.
577579
/// {@category Endpoint}
578580
class EndpointCompute extends _i1.EndpointRef {
579581
EndpointCompute(_i1.EndpointCaller caller) : super(caller);
@@ -586,6 +588,24 @@ class EndpointCompute extends _i1.EndpointRef {
586588
caller.callServerEndpoint<_i16.ComputeInfo>('compute', 'readCompute', {
587589
'cloudCapsuleId': cloudCapsuleId,
588590
});
591+
592+
/// Updates the compute configuration for a capsule.
593+
///
594+
/// Validates the requested size and replica counts against the capsule's
595+
/// product constraints, persists the new configuration, and triggers an
596+
/// infrastructure update for any existing deployment.
597+
_i2.Future<_i16.ComputeInfo> updateCompute({
598+
required String cloudCapsuleId,
599+
required _i17.ComputeSizeOption size,
600+
required int minInstances,
601+
required int maxInstances,
602+
}) =>
603+
caller.callServerEndpoint<_i16.ComputeInfo>('compute', 'updateCompute', {
604+
'cloudCapsuleId': cloudCapsuleId,
605+
'size': size,
606+
'minInstances': minInstances,
607+
'maxInstances': maxInstances,
608+
});
589609
}
590610

591611
/// {@category Endpoint}
@@ -595,11 +615,11 @@ class EndpointCustomDomainName extends _i1.EndpointRef {
595615
@override
596616
String get name => 'customDomainName';
597617

598-
_i2.Future<_i17.CustomDomainNameWithDefaultDomains> add({
618+
_i2.Future<_i18.CustomDomainNameWithDefaultDomains> add({
599619
required String domainName,
600-
required _i18.DomainNameTarget target,
620+
required _i19.DomainNameTarget target,
601621
required String cloudCapsuleId,
602-
}) => caller.callServerEndpoint<_i17.CustomDomainNameWithDefaultDomains>(
622+
}) => caller.callServerEndpoint<_i18.CustomDomainNameWithDefaultDomains>(
603623
'customDomainName',
604624
'add',
605625
{
@@ -617,18 +637,18 @@ class EndpointCustomDomainName extends _i1.EndpointRef {
617637
'cloudCapsuleId': cloudCapsuleId,
618638
});
619639

620-
_i2.Future<_i19.CustomDomainNameList> list({
640+
_i2.Future<_i20.CustomDomainNameList> list({
621641
required String cloudCapsuleId,
622-
}) => caller.callServerEndpoint<_i19.CustomDomainNameList>(
642+
}) => caller.callServerEndpoint<_i20.CustomDomainNameList>(
623643
'customDomainName',
624644
'list',
625645
{'cloudCapsuleId': cloudCapsuleId},
626646
);
627647

628-
_i2.Future<_i20.DomainNameStatus> refreshRecord({
648+
_i2.Future<_i21.DomainNameStatus> refreshRecord({
629649
required String domainName,
630650
required String cloudCapsuleId,
631-
}) => caller.callServerEndpoint<_i20.DomainNameStatus>(
651+
}) => caller.callServerEndpoint<_i21.DomainNameStatus>(
632652
'customDomainName',
633653
'refreshRecord',
634654
{'domainName': domainName, 'cloudCapsuleId': cloudCapsuleId},
@@ -649,17 +669,17 @@ class EndpointDatabase extends _i1.EndpointRef {
649669
'cloudCapsuleId': cloudCapsuleId,
650670
});
651671

652-
_i2.Future<_i21.DatabaseConnection> getConnectionDetails({
672+
_i2.Future<_i22.DatabaseConnection> getConnectionDetails({
653673
required String cloudCapsuleId,
654-
}) => caller.callServerEndpoint<_i21.DatabaseConnection>(
674+
}) => caller.callServerEndpoint<_i22.DatabaseConnection>(
655675
'database',
656676
'getConnectionDetails',
657677
{'cloudCapsuleId': cloudCapsuleId},
658678
);
659679

660-
_i2.Future<_i22.DatabaseInfo> readDatabase({
680+
_i2.Future<_i23.DatabaseInfo> readDatabase({
661681
required String cloudCapsuleId,
662-
}) => caller.callServerEndpoint<_i22.DatabaseInfo>(
682+
}) => caller.callServerEndpoint<_i23.DatabaseInfo>(
663683
'database',
664684
'readDatabase',
665685
{'cloudCapsuleId': cloudCapsuleId},
@@ -693,12 +713,12 @@ class EndpointDatabase extends _i1.EndpointRef {
693713
'cloudCapsuleId': cloudCapsuleId,
694714
});
695715

696-
_i2.Future<_i23.DatabaseResource> updateDatabaseSize({
716+
_i2.Future<_i24.DatabaseResource> updateDatabaseSize({
697717
required String cloudCapsuleId,
698-
required _i24.DatabaseSizeOption size,
718+
required _i25.DatabaseSizeOption size,
699719
double? minCu,
700720
double? maxCu,
701-
}) => caller.callServerEndpoint<_i23.DatabaseResource>(
721+
}) => caller.callServerEndpoint<_i24.DatabaseResource>(
702722
'database',
703723
'updateDatabaseSize',
704724
{
@@ -749,53 +769,53 @@ class EndpointEnvironmentVariables extends _i1.EndpointRef {
749769

750770
/// Creates a new [EnvironmentVariable] with the specified [name] and [value].
751771
/// Throws a [DuplicateEntryException] if an environment variable with the same name already exists.
752-
_i2.Future<_i25.EnvironmentVariable> create(
772+
_i2.Future<_i26.EnvironmentVariable> create(
753773
String name,
754774
String value,
755775
String cloudCapsuleId,
756-
) => caller.callServerEndpoint<_i25.EnvironmentVariable>(
776+
) => caller.callServerEndpoint<_i26.EnvironmentVariable>(
757777
'environmentVariables',
758778
'create',
759779
{'name': name, 'value': value, 'cloudCapsuleId': cloudCapsuleId},
760780
);
761781

762782
/// Fetches the specified environment variable.
763783
/// Throws a [NotFoundException] if the environment variable is not found.
764-
_i2.Future<_i25.EnvironmentVariable> read({
784+
_i2.Future<_i26.EnvironmentVariable> read({
765785
required String name,
766786
required String cloudCapsuleId,
767-
}) => caller.callServerEndpoint<_i25.EnvironmentVariable>(
787+
}) => caller.callServerEndpoint<_i26.EnvironmentVariable>(
768788
'environmentVariables',
769789
'read',
770790
{'name': name, 'cloudCapsuleId': cloudCapsuleId},
771791
);
772792

773793
/// Gets the list of environment variables for the given [cloudCapsuleId].
774-
_i2.Future<List<_i25.EnvironmentVariable>> list(String cloudCapsuleId) =>
775-
caller.callServerEndpoint<List<_i25.EnvironmentVariable>>(
794+
_i2.Future<List<_i26.EnvironmentVariable>> list(String cloudCapsuleId) =>
795+
caller.callServerEndpoint<List<_i26.EnvironmentVariable>>(
776796
'environmentVariables',
777797
'list',
778798
{'cloudCapsuleId': cloudCapsuleId},
779799
);
780800

781801
/// Creates a new [EnvironmentVariable] with the specified [name] and [value].
782802
/// Throws a [NotFoundException] if the environment variable is not found.
783-
_i2.Future<_i25.EnvironmentVariable> update({
803+
_i2.Future<_i26.EnvironmentVariable> update({
784804
required String name,
785805
required String value,
786806
required String cloudCapsuleId,
787-
}) => caller.callServerEndpoint<_i25.EnvironmentVariable>(
807+
}) => caller.callServerEndpoint<_i26.EnvironmentVariable>(
788808
'environmentVariables',
789809
'update',
790810
{'name': name, 'value': value, 'cloudCapsuleId': cloudCapsuleId},
791811
);
792812

793813
/// Permanently deletes an environment variable.
794814
/// Throws a [NotFoundException] if the environment variable is not found.
795-
_i2.Future<_i25.EnvironmentVariable> delete({
815+
_i2.Future<_i26.EnvironmentVariable> delete({
796816
required String cloudCapsuleId,
797817
required String name,
798-
}) => caller.callServerEndpoint<_i25.EnvironmentVariable>(
818+
}) => caller.callServerEndpoint<_i26.EnvironmentVariable>(
799819
'environmentVariables',
800820
'delete',
801821
{'cloudCapsuleId': cloudCapsuleId, 'name': name},
@@ -815,9 +835,9 @@ class EndpointInsights extends _i1.EndpointRef {
815835
///
816836
/// Throws [UnauthorizedException] if the user is not authorized.
817837
/// Throws [NotFoundException] if insights service secret is not found.
818-
_i2.Future<_i26.InsightsConnectionDetail> getConnectionDetails({
838+
_i2.Future<_i27.InsightsConnectionDetail> getConnectionDetails({
819839
required String cloudProjectId,
820-
}) => caller.callServerEndpoint<_i26.InsightsConnectionDetail>(
840+
}) => caller.callServerEndpoint<_i27.InsightsConnectionDetail>(
821841
'insights',
822842
'getConnectionDetails',
823843
{'cloudProjectId': cloudProjectId},
@@ -833,14 +853,14 @@ class EndpointLogs extends _i1.EndpointRef {
833853
String get name => 'logs';
834854

835855
/// Fetches log records from the specified capsule.
836-
_i2.Stream<_i27.LogRecord> fetchRecords({
856+
_i2.Stream<_i28.LogRecord> fetchRecords({
837857
String? cloudProjectId,
838858
String? cloudCapsuleId,
839859
DateTime? beforeTime,
840860
DateTime? afterTime,
841861
int? limit,
842862
}) => caller
843-
.callStreamingServerEndpoint<_i2.Stream<_i27.LogRecord>, _i27.LogRecord>(
863+
.callStreamingServerEndpoint<_i2.Stream<_i28.LogRecord>, _i28.LogRecord>(
844864
'logs',
845865
'fetchRecords',
846866
{
@@ -858,11 +878,11 @@ class EndpointLogs extends _i1.EndpointRef {
858878
/// Records are returned in ascending time order.
859879
///
860880
/// This call will hold until all the records are fetched in order to sort them.
861-
_i2.Stream<_i27.LogRecord> fetchRecentRecords({
881+
_i2.Stream<_i28.LogRecord> fetchRecentRecords({
862882
required String cloudCapsuleId,
863883
int? limit,
864884
}) => caller
865-
.callStreamingServerEndpoint<_i2.Stream<_i27.LogRecord>, _i27.LogRecord>(
885+
.callStreamingServerEndpoint<_i2.Stream<_i28.LogRecord>, _i28.LogRecord>(
866886
'logs',
867887
'fetchRecentRecords',
868888
{'cloudCapsuleId': cloudCapsuleId, 'limit': limit},
@@ -872,12 +892,12 @@ class EndpointLogs extends _i1.EndpointRef {
872892
/// Tails log records from the specified capsule.
873893
/// Continues until the client unsubscribes, [limit] is reached,
874894
/// or the internal max limit is reached.
875-
_i2.Stream<_i27.LogRecord> tailRecords({
895+
_i2.Stream<_i28.LogRecord> tailRecords({
876896
String? cloudProjectId,
877897
String? cloudCapsuleId,
878898
int? limit,
879899
}) => caller
880-
.callStreamingServerEndpoint<_i2.Stream<_i27.LogRecord>, _i27.LogRecord>(
900+
.callStreamingServerEndpoint<_i2.Stream<_i28.LogRecord>, _i28.LogRecord>(
881901
'logs',
882902
'tailRecords',
883903
{
@@ -889,13 +909,13 @@ class EndpointLogs extends _i1.EndpointRef {
889909
);
890910

891911
/// Fetches the build log records for the specified deploy attempt.
892-
_i2.Stream<_i27.LogRecord> fetchBuildLog({
912+
_i2.Stream<_i28.LogRecord> fetchBuildLog({
893913
String? cloudProjectId,
894914
String? cloudCapsuleId,
895915
required String attemptId,
896916
int? limit,
897917
}) => caller
898-
.callStreamingServerEndpoint<_i2.Stream<_i27.LogRecord>, _i27.LogRecord>(
918+
.callStreamingServerEndpoint<_i2.Stream<_i28.LogRecord>, _i28.LogRecord>(
899919
'logs',
900920
'fetchBuildLog',
901921
{
@@ -935,8 +955,8 @@ class EndpointPlans extends _i1.EndpointRef {
935955
_i2.Future<List<String>> listProcuredPlanNames() => caller
936956
.callServerEndpoint<List<String>>('plans', 'listProcuredPlanNames', {});
937957

938-
_i2.Future<_i28.SubscriptionInfo> getSubscriptionInfo() =>
939-
caller.callServerEndpoint<_i28.SubscriptionInfo>(
958+
_i2.Future<_i29.SubscriptionInfo> getSubscriptionInfo() =>
959+
caller.callServerEndpoint<_i29.SubscriptionInfo>(
940960
'plans',
941961
'getSubscriptionInfo',
942962
{},
@@ -954,8 +974,8 @@ class EndpointPlans extends _i1.EndpointRef {
954974
'planName': planName,
955975
});
956976

957-
_i2.Future<_i29.PlanInfo> getPlanInfo({required String planProductName}) =>
958-
caller.callServerEndpoint<_i29.PlanInfo>('plans', 'getPlanInfo', {
977+
_i2.Future<_i30.PlanInfo> getPlanInfo({required String planProductName}) =>
978+
caller.callServerEndpoint<_i30.PlanInfo>('plans', 'getPlanInfo', {
959979
'planProductName': planProductName,
960980
});
961981

@@ -1039,9 +1059,9 @@ class EndpointProjects extends _i1.EndpointRef {
10391059
'cloudProjectId': cloudProjectId,
10401060
});
10411061

1042-
_i2.Future<_i30.ProjectConfig> fetchProjectConfig({
1062+
_i2.Future<_i31.ProjectConfig> fetchProjectConfig({
10431063
required String cloudProjectId,
1044-
}) => caller.callServerEndpoint<_i30.ProjectConfig>(
1064+
}) => caller.callServerEndpoint<_i31.ProjectConfig>(
10451065
'projects',
10461066
'fetchProjectConfig',
10471067
{'cloudProjectId': cloudProjectId},
@@ -1092,9 +1112,9 @@ class EndpointRoles extends _i1.EndpointRef {
10921112
String get name => 'roles';
10931113

10941114
/// Fetches the user roles for a project.
1095-
_i2.Future<List<_i31.Role>> fetchRolesForProject({
1115+
_i2.Future<List<_i32.Role>> fetchRolesForProject({
10961116
required String cloudProjectId,
1097-
}) => caller.callServerEndpoint<List<_i31.Role>>(
1117+
}) => caller.callServerEndpoint<List<_i32.Role>>(
10981118
'roles',
10991119
'fetchRolesForProject',
11001120
{'cloudProjectId': cloudProjectId},
@@ -1181,10 +1201,10 @@ class EndpointStatus extends _i1.EndpointRef {
11811201
);
11821202

11831203
/// Gets the specified deploy attempt status of the a capsule.
1184-
_i2.Future<List<_i32.DeployAttemptStage>> getDeployAttemptStatus({
1204+
_i2.Future<List<_i33.DeployAttemptStage>> getDeployAttemptStatus({
11851205
required String cloudCapsuleId,
11861206
required String attemptId,
1187-
}) => caller.callServerEndpoint<List<_i32.DeployAttemptStage>>(
1207+
}) => caller.callServerEndpoint<List<_i33.DeployAttemptStage>>(
11881208
'status',
11891209
'getDeployAttemptStatus',
11901210
{'cloudCapsuleId': cloudCapsuleId, 'attemptId': attemptId},
@@ -1225,11 +1245,11 @@ class EndpointUsers extends _i1.EndpointRef {
12251245

12261246
class Modules {
12271247
Modules(Client client) {
1228-
serverpod_auth_idp = _i33.Caller(client);
1248+
serverpod_auth_idp = _i34.Caller(client);
12291249
serverpod_auth_core = _i10.Caller(client);
12301250
}
12311251

1232-
late final _i33.Caller serverpod_auth_idp;
1252+
late final _i34.Caller serverpod_auth_idp;
12331253

12341254
late final _i10.Caller serverpod_auth_core;
12351255
}
@@ -1249,7 +1269,7 @@ class Client extends _i1.ServerpodClientShared {
12491269
bool? disconnectStreamsOnLostInternetConnection,
12501270
}) : super(
12511271
host,
1252-
_i34.Protocol(),
1272+
_i35.Protocol(),
12531273
securityContext: securityContext,
12541274
streamingConnectionTimeout: streamingConnectionTimeout,
12551275
connectionTimeout: connectionTimeout,

0 commit comments

Comments
 (0)