copyWith method
Creates a copy with selected fields replaced.
The clientId and createdAt values are always retained. Omitted
nullable fields retain their current values, so description cannot be
cleared through this method. List fields are reused by reference rather
than defensively copied.
Implementation
OAuthClient copyWith({
String? clientSecretHash,
String? name,
String? description,
List<String>? redirectUris,
List<String>? grantTypes,
List<String>? scopes,
String? tokenEndpointAuthMethod,
DateTime? updatedAt,
bool? enabled,
}) {
return OAuthClient(
clientId: clientId,
clientSecretHash: clientSecretHash ?? this.clientSecretHash,
name: name ?? this.name,
description: description ?? this.description,
redirectUris: redirectUris ?? this.redirectUris,
grantTypes: grantTypes ?? this.grantTypes,
scopes: scopes ?? this.scopes,
tokenEndpointAuthMethod:
tokenEndpointAuthMethod ?? this.tokenEndpointAuthMethod,
createdAt: createdAt,
updatedAt: updatedAt ?? this.updatedAt,
enabled: enabled ?? this.enabled,
);
}