Skip to content

Commit

Permalink
Reduced public visibility of interfaced implementations (#117)
Browse files Browse the repository at this point in the history
* Reduced public visibility of interfaced implementations
* Also sealed most of the internal classes where applicable

Closes #71
  • Loading branch information
pyrocumulus authored Mar 17, 2022
1 parent 559377f commit 86d2514
Show file tree
Hide file tree
Showing 95 changed files with 101 additions and 100 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed

- **BREAKING**: Removed add batch output from API. Please use the `AddOutputsAsync` method from now on. This is donation only. [#78](https://github.com/pyrocumulus/pvoutput.net/pull/78)
- **BREAKING**: Some implementations which have been properly interfaced, are reduced to internal visibility from now on. LINK HERE [#117](https://github.com/pyrocumulus/pvoutput.net/pull/117)

### Updated

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// Options used to create a PVOutputClient through Microsoft's Dependency Injection.
/// </summary>
public class PVOutputClientOptions
public sealed class PVOutputClientOptions
{
/// <summary>ApiKey to use with authenticating.</summary>
public string ApiKey { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/BaseService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// Base that all the PVOutput services derive from
/// </summary>
public abstract class BaseService
internal abstract class BaseService
{
internal PVOutputClient Client { get; }

Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/ExtendedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="IExtendedService"/>
public sealed class ExtendedService : BaseService, IExtendedService
internal sealed class ExtendedService : BaseService, IExtendedService
{
internal ExtendedService(PVOutputClient client) : base(client)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/FavouriteService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="IFavouriteService"/>
public sealed class FavouriteService : BaseService, IFavouriteService
internal sealed class FavouriteService : BaseService, IFavouriteService
{
internal FavouriteService(PVOutputClient client) : base(client)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/InsolationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="IInsolationService"/>
public sealed class InsolationService : BaseService, IInsolationService
internal sealed class InsolationService : BaseService, IInsolationService
{
internal InsolationService(PVOutputClient client) : base(client)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/MissingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="IMissingService"/>
public sealed class MissingService : BaseService, IMissingService
internal sealed class MissingService : BaseService, IMissingService
{
internal MissingService(PVOutputClient client) : base(client)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/NotificationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="INotificationService" />
public sealed class NotificationService : BaseService, INotificationService
internal sealed class NotificationService : BaseService, INotificationService
{
/// <summary>
/// Alert for a new private message.
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/OutputService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="IOutputService"/>
public sealed class OutputService : BaseService, IOutputService
internal sealed class OutputService : BaseService, IOutputService
{
internal OutputService(PVOutputClient client) : base(client)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/SearchService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="ISearchService"/>
public sealed class SearchService : BaseService, ISearchService
internal sealed class SearchService : BaseService, ISearchService
{
internal SearchService(PVOutputClient client) : base(client)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/StatisticsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="IStatisticsService"/>
public sealed class StatisticsService : BaseService, IStatisticsService
internal sealed class StatisticsService : BaseService, IStatisticsService
{
internal StatisticsService(PVOutputClient client) : base(client)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/StatusService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="IStatusService"/>
public sealed class StatusService : BaseService, IStatusService
internal sealed class StatusService : BaseService, IStatusService
{
internal StatusService(PVOutputClient client) : base(client)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/SupplyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="ISupplyService"/>
public sealed class SupplyService : BaseService, ISupplyService
internal sealed class SupplyService : BaseService, ISupplyService
{
internal SupplyService(PVOutputClient client) : base(client)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/SystemService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="ISystemService"/>>
public sealed class SystemService : BaseService, ISystemService
internal sealed class SystemService : BaseService, ISystemService
{
internal SystemService(PVOutputClient client) : base(client)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Modules/TeamService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace PVOutput.Net.Modules
{
/// <inheritdoc cref="ITeamService"/>
public sealed class TeamService : BaseService, ITeamService
internal sealed class TeamService : BaseService, ITeamService
{
internal TeamService(PVOutputClient client) : base(client)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace PVOutput.Net.Objects.Core
{
internal class CharacterDelimitedArrayStringReader<TObjectType> : BaseArrayStringReader<TObjectType>
internal sealed class CharacterDelimitedArrayStringReader<TObjectType> : BaseArrayStringReader<TObjectType>
{
public char Delimiter { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace PVOutput.Net.Objects.Core
{
internal class LineDelimitedArrayStringReader<TObjectType> : BaseArrayStringReader<TObjectType>
internal sealed class LineDelimitedArrayStringReader<TObjectType> : BaseArrayStringReader<TObjectType>
{
public LineDelimitedArrayStringReader()
{
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Core/LoggingEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PVOutput.Net.Objects.Core
{
internal class LoggingEvents
internal static class LoggingEvents
{
/*
* Logging scope (parameter) keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class AggregatedOutputFactory : IArrayStringFactory<IAggregatedOutput>
internal sealed class AggregatedOutputFactory : IArrayStringFactory<IAggregatedOutput>
{
public IArrayStringReader<IAggregatedOutput> CreateArrayReader() => new CharacterDelimitedArrayStringReader<IAggregatedOutput>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class BatchStatusPostResultFactory : IArrayStringFactory<IBatchStatusPostResult>
internal sealed class BatchStatusPostResultFactory : IArrayStringFactory<IBatchStatusPostResult>
{
public IArrayStringReader<IBatchStatusPostResult> CreateArrayReader() => new CharacterDelimitedArrayStringReader<IBatchStatusPostResult>();

Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/DayStatisticsFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class DayStatisticsFactory : IObjectStringFactory<IDayStatistics>
internal sealed class DayStatisticsFactory : IObjectStringFactory<IDayStatistics>
{
public IObjectStringReader<IDayStatistics> CreateObjectReader() => new DayStatisticsObjectStringReader();
}
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/ExtendedFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class ExtendedFactory : IArrayStringFactory<IExtended>
internal sealed class ExtendedFactory : IArrayStringFactory<IExtended>
{
public IArrayStringReader<IExtended> CreateArrayReader() => new CharacterDelimitedArrayStringReader<IExtended>();

Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/FavouriteFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class FavouriteFactory : IArrayStringFactory<IFavourite>
internal sealed class FavouriteFactory : IArrayStringFactory<IFavourite>
{
public IArrayStringReader<IFavourite> CreateArrayReader() => new CharacterDelimitedArrayStringReader<IFavourite>('\n');

Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/InsolationFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class InsolationFactory : IArrayStringFactory<IInsolation>
internal sealed class InsolationFactory : IArrayStringFactory<IInsolation>
{
public IArrayStringReader<IInsolation> CreateArrayReader() => new CharacterDelimitedArrayStringReader<IInsolation>();

Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/MissingFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class MissingFactory : IObjectStringFactory<IMissing>
internal sealed class MissingFactory : IObjectStringFactory<IMissing>
{
public IObjectStringReader<IMissing> CreateObjectReader() => new MissingObjectStringReader();
}
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/OutputFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class OutputFactory : IArrayStringFactory<IOutput>
internal sealed class OutputFactory : IArrayStringFactory<IOutput>
{
public IArrayStringReader<IOutput> CreateArrayReader() => new CharacterDelimitedArrayStringReader<IOutput>();

Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/StatisticFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class StatisticFactory : IObjectStringFactory<IStatistic>
internal sealed class StatisticFactory : IObjectStringFactory<IStatistic>
{
public IObjectStringReader<IStatistic> CreateObjectReader() => new StatisticObjectStringReader();
}
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/StatusFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class StatusFactory : IObjectStringFactory<IStatus>
internal sealed class StatusFactory : IObjectStringFactory<IStatus>
{
public IObjectStringReader<IStatus> CreateObjectReader() => new StatusObjectStringReader();
}
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/StatusHistoryFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class StatusHistoryFactory : IArrayStringFactory<IStatusHistory>
internal sealed class StatusHistoryFactory : IArrayStringFactory<IStatusHistory>
{
public IArrayStringReader<IStatusHistory> CreateArrayReader() => new CharacterDelimitedArrayStringReader<IStatusHistory>();

Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/SupplyFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class SupplyFactory : IArrayStringFactory<ISupply>
internal sealed class SupplyFactory : IArrayStringFactory<ISupply>
{
public IArrayStringReader<ISupply> CreateArrayReader() => new CharacterDelimitedArrayStringReader<ISupply>();

Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/SystemFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class SystemFactory : IObjectStringFactory<ISystem>
internal sealed class SystemFactory : IObjectStringFactory<ISystem>
{
public IObjectStringReader<ISystem> CreateObjectReader() => new SystemObjectStringReader();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class SystemSearchResultFactory : IArrayStringFactory<ISystemSearchResult>
internal sealed class SystemSearchResultFactory : IArrayStringFactory<ISystemSearchResult>
{
public IArrayStringReader<ISystemSearchResult> CreateArrayReader() => new LineDelimitedArrayStringReader<ISystemSearchResult>();

Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/TeamFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class TeamFactory : IObjectStringFactory<ITeam>
internal sealed class TeamFactory : IObjectStringFactory<ITeam>
{
public IObjectStringReader<ITeam> CreateObjectReader() => new TeamObjectStringReader();
}
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Factories/TeamOutputFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Factories
{
internal class TeamOutputFactory : IArrayStringFactory<ITeamOutput>
internal sealed class TeamOutputFactory : IArrayStringFactory<ITeamOutput>
{
public IArrayStringReader<ITeamOutput> CreateArrayReader() => new CharacterDelimitedArrayStringReader<ITeamOutput>();

Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Modules/BatchNetStatusPost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace PVOutput.Net.Objects.Modules
{
internal class BatchNetStatusPost : IBatchNetStatusPost
internal sealed class BatchNetStatusPost : IBatchNetStatusPost
{
public DateTime Timestamp { get; set; }
public int? PowerExported { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System;

namespace PVOutput.Net.Objects.Modules.Implementations
{
internal class AggregatedOutput : IAggregatedOutput
internal sealed class AggregatedOutput : IAggregatedOutput
{
public DateTime AggregatedDate { get; set; }
public int Outputs { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace PVOutput.Net.Objects.Modules.Implementations
{
internal class DayStatistics : IDayStatistics
internal sealed class DayStatistics : IDayStatistics
{
public int EnergyGeneration { get; set; }
public int PowerGeneration { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Modules.Implementations
{
internal class Extended : IExtended
internal sealed class Extended : IExtended
{
public DateTime ExtendedDate { get; set; }
public decimal? ExtendedValue1 { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PVOutput.Net.Objects.Modules.Implementations
{
internal class ExtendedDataDefinition : IExtendedDataDefinition
internal sealed class ExtendedDataDefinition : IExtendedDataDefinition
{
public ExtendedDataIndex Index { get; set; }
public string Label { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PVOutput.Net.Objects.Modules.Implementations
{
internal class Favourite : IFavourite
internal sealed class Favourite : IFavourite
{
public int SystemId { get; set; }
public string SystemName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PVOutput.Net.Objects.Modules.Implementations
{
internal class Insolation : IInsolation
internal sealed class Insolation : IInsolation
{
public TimeSpan Time { get; set; }
public int Power { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/PVOutput.Net/Objects/Modules/Implementations/Missing.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System;
using System.Collections.Generic;

namespace PVOutput.Net.Objects.Modules.Implementations
{
internal class Missing : IMissing
internal sealed class Missing : IMissing
{
public IEnumerable<DateTime> Dates { get; set; }
}
Expand Down
2 changes: 1 addition & 1 deletion src/PVOutput.Net/Objects/Modules/Implementations/Output.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace PVOutput.Net.Objects.Modules.Implementations
{
internal class Output : IOutput
internal sealed class Output : IOutput
{
public DateTime OutputDate { get; set; }
public int EnergyGenerated { get; set; }
Expand Down
Loading

0 comments on commit 86d2514

Please sign in to comment.