copyWith method

OAuthClient copyWith({
  1. String? clientSecretHash,
  2. String? name,
  3. String? description,
  4. List<String>? redirectUris,
  5. List<String>? grantTypes,
  6. List<String>? scopes,
  7. String? tokenEndpointAuthMethod,
  8. DateTime? updatedAt,
  9. bool? enabled,
})

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,
  );
}