copyWith method

ServerpodConfig copyWith({
  1. ServerConfig? apiServer,
  2. String? runMode,
  3. String? serverId,
  4. ServerpodRole? role,
  5. ServerpodLoggingMode? loggingMode,
  6. bool? applyMigrations,
  7. bool? applyRepairMigration,
  8. int? maxRequestSize,
  9. ServerConfig? insightsServer,
  10. bool? insightsDatabaseAccessEnabled,
  11. ServerConfig? webServer,
  12. DatabaseConfig? database,
  13. RedisConfig? redis,
  14. String? serviceSecret,
  15. SessionLogConfig? sessionLogs,
  16. Duration? healthCheckInterval,
  17. Duration? experimentalDiagnosticHandlerTimeout,
  18. FutureCallConfig? futureCall,
  19. bool? futureCallExecutionEnabled,
  20. bool? validateHeaders,
  21. Duration? websocketPingInterval,
  22. List<String>? allowedOrigins,
  23. 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,
  );
}