copyWith method
ServerpodConfig
copyWith({
- ServerConfig? apiServer,
- String? runMode,
- String? serverId,
- ServerpodRole? role,
- ServerpodLoggingMode? loggingMode,
- bool? applyMigrations,
- bool? applyRepairMigration,
- int? maxRequestSize,
- ServerConfig? insightsServer,
- bool? insightsDatabaseAccessEnabled,
- ServerConfig? webServer,
- DatabaseConfig? database,
- RedisConfig? redis,
- String? serviceSecret,
- SessionLogConfig? sessionLogs,
- Duration? healthCheckInterval,
- Duration? experimentalDiagnosticHandlerTimeout,
- FutureCallConfig? futureCall,
- bool? futureCallExecutionEnabled,
- bool? validateHeaders,
- Duration? websocketPingInterval,
- List<
String> ? allowedOrigins, - WebAuthCookieConfig? authCookie,
Creates a copy of this ServerpodConfig with the given fields replaced. All fields that are not specified will keep their original values.
Note that passing null for a field will not remove/nullify that field - the original value will be retained. To explicitly set a field to null, create a new ServerpodConfig instance instead of using copyWith.
Implementation
ServerpodConfig copyWith({
ServerConfig? apiServer,
String? runMode,
String? serverId,
ServerpodRole? role,
ServerpodLoggingMode? loggingMode,
bool? applyMigrations,
bool? applyRepairMigration,
int? maxRequestSize,
ServerConfig? insightsServer,
bool? insightsDatabaseAccessEnabled,
ServerConfig? webServer,
DatabaseConfig? database,
RedisConfig? redis,
String? serviceSecret,
SessionLogConfig? sessionLogs,
Duration? healthCheckInterval,
Duration? experimentalDiagnosticHandlerTimeout,
FutureCallConfig? futureCall,
bool? futureCallExecutionEnabled,
bool? validateHeaders,
Duration? websocketPingInterval,
List<String>? allowedOrigins,
WebAuthCookieConfig? authCookie,
}) {
return ServerpodConfig(
apiServer: apiServer ?? this.apiServer,
runMode: runMode ?? this.runMode,
serverId: serverId ?? this.serverId,
role: role ?? this.role,
loggingMode: loggingMode ?? this.loggingMode,
applyMigrations: applyMigrations ?? this.applyMigrations,
applyRepairMigration: applyRepairMigration ?? this.applyRepairMigration,
maxRequestSize: maxRequestSize ?? this.maxRequestSize,
insightsServer: insightsServer ?? this.insightsServer,
insightsDatabaseAccessEnabled:
insightsDatabaseAccessEnabled ?? this.insightsDatabaseAccessEnabled,
webServer: webServer ?? this.webServer,
database: database ?? this.database,
redis: redis ?? this.redis,
serviceSecret: serviceSecret ?? this.serviceSecret,
sessionLogs: sessionLogs ?? this.sessionLogs,
healthCheckInterval: healthCheckInterval ?? this.healthCheckInterval,
experimentalDiagnosticHandlerTimeout:
experimentalDiagnosticHandlerTimeout ??
this.experimentalDiagnosticHandlerTimeout,
futureCall: futureCall ?? this.futureCall,
futureCallExecutionEnabled:
futureCallExecutionEnabled ?? this.futureCallExecutionEnabled,
validateHeaders: validateHeaders ?? this.validateHeaders,
websocketPingInterval:
websocketPingInterval ?? this.websocketPingInterval,
allowedOrigins: allowedOrigins ?? this.allowedOrigins,
authCookie: authCookie ?? this.authCookie,
);
}