@startuml title Trait Hierarchy abstract class BaseClient { abstract {abstract} &Config get_config() abstract {abstract} &HttpClient get_http() abstract {abstract} Arc>> get_token() abstract {abstract} &Credentials get_creds() abstract {abstract} ClientResult> refetch_token() --- ClientResult<()> auto_reauth() ClientResult<()> refresh_token() String api_url() String auth_url() ClientResult auth_headers() ClientResult<()> write_token_cache() ClientResult fetch_access_token() } abstract class OAuthClient extends BaseClient{ abstract {abstract} &OAuth get_oauth() abstract {abstract} ClientResult<()> request_token() --- Option read_token_cache() } class AuthCodeSpotify implements OAuthClient{ &Config get_config() &HttpClient get_http() RwLockReadGuard> get_token() RwLockWriteGuard> get_token_mut() &Credentials get_creds() ClientResult> refetch_token() --- &OAuth get_oauth() ClientResult<()> request_token() } class AuthCodePkceSpotify implements OAuthClient{ &Config get_config() &HttpClient get_http() RwLockReadGuard> get_token() RwLockWriteGuard> get_token_mut() &Credentials get_creds() ClientResult> refetch_token() --- &OAuth get_oauth() ClientResult<()> request_token() } class ClientCredsSpotify implements BaseClient{ &Config get_config() &HttpClient get_http() RwLockReadGuard> get_token() RwLockWriteGuard> get_token_mut() &Credentials get_creds() ClientResult> refetch_token() --- } @enduml