diff --git a/src/Tribufu/TribufuApi.cs b/src/Tribufu/TribufuApi.cs index df38a47..5b3664e 100644 --- a/src/Tribufu/TribufuApi.cs +++ b/src/Tribufu/TribufuApi.cs @@ -22,22 +22,9 @@ namespace Tribufu public const string DefaultBaseUrl = "https://api.tribufu.com"; /// - /// Create a with the default options. + /// Create a instance. /// - /// instance with default configuration - public TribufuApi() : this(string.Empty) - { - } - - /// - /// Create a with the given API key. - /// - /// - /// A API key gives you public read only access to the Tribufu API. - /// - /// The API key for authentication - /// instance configured with the API key - public TribufuApi(string apiKey) : base(CreateConfiguration(apiKey)) + public TribufuApi(string? apiKey = null) : base(CreateConfiguration(apiKey)) { } @@ -118,7 +105,7 @@ namespace Tribufu /// /// Gets the user agent string for the Tribufu API client. /// - private static string GetUserAgent() + public static string GetUserAgent() { var version = GetVersion(); var frameworkDescription = RuntimeInformation.FrameworkDescription.Trim(); @@ -126,6 +113,19 @@ namespace Tribufu return $"Tribufu/{version} ({frameworkDescription}; {runtimeIdentifier})"; } + /// + /// Checks if debug mode is enabled. + /// + /// True if debug mode is enabled, otherwise false + public static bool DebugEnabled() + { +#if DEBUG + return true; +#else + return false; +#endif + } + /// /// Get the base URL for the Tribufu API. /// @@ -147,23 +147,10 @@ namespace Tribufu return DefaultBaseUrl; } - /// - /// Checks if debug mode is enabled. - /// - /// True if debug mode is enabled, otherwise false - private static bool DebugEnabled() - { -#if DEBUG - return true; -#else - return false; -#endif - } - /// /// Creates a configuration for the Tribufu API client. /// - private static Configuration CreateConfiguration(string apiKey) + private static Configuration CreateConfiguration(string? apiKey) { var config = new Configuration {