Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update XML comments #88

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CiT.CLI/Commands/DomainBlocks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class DomainBlocks
/// Constructs a DomainBlocks object.
/// </summary>
/// <param name="configManager">The ConfigManager.</param>
/// <param name="client">The HttpClient.</param>
public DomainBlocks(IConfigManager configManager, HttpClient client)
{
_apiClient = new DomainBlocksApi(configManager, client);
Expand Down
1 change: 1 addition & 0 deletions src/CiT.CLI/Commands/Domains.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class Domains
/// Constructs a Domains object.
/// </summary>
/// <param name="configManager">The ConfigManager.</param>
/// <param name="client">The HttpClient.</param>
public Domains(IConfigManager configManager, HttpClient client)
{
_apiClient = new MeasuresApi(configManager, client);
Expand Down
1 change: 1 addition & 0 deletions src/CiT.CLI/Commands/EmailDomainBlocks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class EmailDomainBlocks
/// Constructs an EmailDomainBlocks object.
/// </summary>
/// <param name="configManager">The ConfigManager.</param>
/// <param name="client">The HttpClient.</param>
public EmailDomainBlocks(IConfigManager configManager, HttpClient client)
{
_apiClient = new EmailDomainBlocksApi(configManager, client);
Expand Down
1 change: 1 addition & 0 deletions src/CiT.CLI/Commands/IpAddressBlocks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class IpAddressBlocks
/// Constructs an IpAddressBlocks object.
/// </summary>
/// <param name="configManager">The ConfigManager.</param>
/// <param name="client">The HttpClient.</param>
public IpAddressBlocks(IConfigManager configManager, HttpClient client)
{
_apiClient = new IpAddressBlocksApi(configManager, client);
Expand Down
1 change: 0 additions & 1 deletion src/CiT.Core/Configuration/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class ConfigManager : IConfigManager
/// Constructs a ConfigManager with all Configuration objects.
/// </summary>
/// <param name="configuration">The main program Configuration</param>
/// <param name="instance">The instance configuration.</param>
/// <exception cref="InvalidConfigurationException">Thrown if any of the provided configurations objects are invalid.</exception>
public ConfigManager(
IConfiguration configuration)
Expand Down
3 changes: 2 additions & 1 deletion src/CiT.Core/Mastodon/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
/// <summary>
/// The HttpClient object.
/// </summary>
protected static HttpClient Client;

Check warning on line 11 in src/CiT.Core/Mastodon/ApiClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'Client' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
/// <summary>
/// ApiClient constructor to initialize the Authorization, Accept, and User-Agent headers.
/// </summary>
/// <param name="configManager"></param>
/// <param name="configManager">The config manager.</param>
/// <param name="client">The HttpClient.</param>
protected ApiClient(IConfigManager configManager, HttpClient client)
{
client.DefaultRequestHeaders.Authorization =
Expand Down
1 change: 1 addition & 0 deletions src/CiT.Core/Mastodon/DomainBlocksApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/// Constructs a DomainBlocksApi object using the ConfigManager to set the API URL.
/// </summary>
/// <param name="configManager">The ConfigManager.</param>
/// <param name="client">The HttpClient.</param>
public DomainBlocksApi(IConfigManager configManager, HttpClient client) : base(configManager, client)
{
_domainBlocksApiUrl = $"{configManager.Instance.Url}/api/v1/admin/domain_blocks";
Expand Down Expand Up @@ -69,7 +70,7 @@
result = await Client.GetAsync(linksFromHeaders.NextLink);
result.Headers.TryGetValues("Link", out linkHeaders);
if (linkHeaders != null) linksFromHeaders = LinkHeader.LinksFromHeader(linkHeaders.First());
else linksFromHeaders.NextLink = null;

Check warning on line 73 in src/CiT.Core/Mastodon/DomainBlocksApi.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.
responseContent = await result.Content.ReadAsStringAsync();
obj = JsonConvert.DeserializeObject<List<BlockedDomain>>(responseContent);
if (obj != null) rtnObj.AddRange(obj);
Expand Down
1 change: 1 addition & 0 deletions src/CiT.Core/Mastodon/EmailDomainBlocksApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/// Constructs an EmailDomainBlocksApi object using the ConfigManager to set the API URL.
/// </summary>
/// <param name="configManager">The ConfigManager.</param>
/// <param name="client">The HttpClient.</param>
public EmailDomainBlocksApi(IConfigManager configManager, HttpClient client) : base(configManager, client)
{
_emailDomainBlocksApiUrl = $"{configManager.Instance.Url}/api/v1/admin/email_domain_blocks";
Expand Down Expand Up @@ -49,7 +50,7 @@
result = await Client.GetAsync(linksFromHeaders.NextLink);
result.Headers.TryGetValues("Link", out linkHeaders);
if (linkHeaders != null) linksFromHeaders = LinkHeader.LinksFromHeader(linkHeaders.First());
else linksFromHeaders.NextLink = null;

Check warning on line 53 in src/CiT.Core/Mastodon/EmailDomainBlocksApi.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.
responseContent = await result.Content.ReadAsStringAsync();
obj = JsonConvert.DeserializeObject<List<BlockedEmailDomain>>(responseContent);
if (obj != null) rtnObj.AddRange(obj);
Expand Down
1 change: 1 addition & 0 deletions src/CiT.Core/Mastodon/IpAddressBlocksApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/// Constructs an IpAddressBlocksApi object using the ConfigManager to set the API URL.
/// </summary>
/// <param name="configManager">The ConfigManager.</param>
/// <param name="client">The HttpClient.</param>
public IpAddressBlocksApi(IConfigManager configManager, HttpClient client) : base(configManager, client)
{
_ipAddressBlocksApiUrl = $"{configManager.Instance.Url}/api/v1/admin/ip_blocks";
Expand Down Expand Up @@ -51,7 +52,7 @@
result = await Client.GetAsync(linksFromHeaders.NextLink);
result.Headers.TryGetValues("Link", out linkHeaders);
if (linkHeaders != null) linksFromHeaders = LinkHeader.LinksFromHeader(linkHeaders.First());
else linksFromHeaders.NextLink = null;

Check warning on line 55 in src/CiT.Core/Mastodon/IpAddressBlocksApi.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.
responseContent = await result.Content.ReadAsStringAsync();
obj = JsonConvert.DeserializeObject<List<BlockedIpAddress>>(responseContent);
if (obj != null) rtnObj.AddRange(obj);
Expand Down
1 change: 1 addition & 0 deletions src/CiT.Core/Mastodon/MeasuresApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class MeasuresApi : ApiClient
/// Constructs a MeasuresApi object using the ConfigManager to set the API URL.
/// </summary>
/// <param name="configManager">The ConfigManager.</param>
/// <param name="client">The HttpClient.</param>
public MeasuresApi(IConfigManager configManager, HttpClient client) : base(configManager, client)
{
_measuresApiUrl = $"{configManager.Instance.Url}/api/v1/admin/measures";
Expand Down
Loading