-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from CodeCasterNL/feature/interfaces
#64: interface ALL the (public) things
- Loading branch information
Showing
28 changed files
with
838 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
using PVOutput.Net.Modules; | ||
|
||
namespace PVOutput.Net | ||
{ | ||
/// <summary> | ||
/// The client used to communicate with the PVOutput service. | ||
/// </summary> | ||
public interface IPVOutputClient | ||
{ | ||
/// <summary>ApiKey to use with authenticating.</summary> | ||
string ApiKey { get; set; } | ||
|
||
/// <summary>Id of the currently owned system used for authenticating.</summary> | ||
int OwnedSystemId { get; set; } | ||
|
||
/// <summary>Indicates whether or not the client should throw exceptions when the api returns errors.</summary> | ||
bool ThrowResponseExceptions { get; set; } | ||
|
||
/// <summary> | ||
/// The output service. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getoutput">API information</see>.</para> | ||
/// </summary> | ||
IOutputService Output { get; } | ||
|
||
/// <summary> | ||
/// The system service. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getsystem">API information</see>.</para> | ||
/// </summary> | ||
ISystemService System { get; } | ||
|
||
/// <summary> | ||
/// The status service. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getstatus">API information</see>.</para> | ||
/// </summary> | ||
IStatusService Status { get; } | ||
|
||
/// <summary> | ||
/// The statistic service. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getstatistic">API information</see>.</para> | ||
/// </summary> | ||
IStatisticsService Statistics { get; } | ||
|
||
/// <summary> | ||
/// The missing service. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getmissing">API information</see>.</para> | ||
/// </summary> | ||
IMissingService Missing { get; } | ||
|
||
/// <summary> | ||
/// The team service. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getsupply">API information</see>.</para> | ||
/// </summary> | ||
ITeamService Team { get; } | ||
|
||
/// <summary> | ||
/// The extended service. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getextended">API information</see>.</para> | ||
/// </summary> | ||
IExtendedService Extended { get; } | ||
|
||
/// <summary> | ||
/// The favourite service. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getfavourite">API information</see>.</para> | ||
/// </summary> | ||
IFavouriteService Favourite { get; } | ||
|
||
/// <summary> | ||
/// The insolation service. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getinsolation">API information</see>.</para> | ||
/// </summary> | ||
IInsolationService Insolation { get; } | ||
|
||
/// <summary> | ||
/// The supply service. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getsupply">API information</see>.</para> | ||
/// </summary> | ||
ISupplyService Supply { get; } | ||
|
||
/// <summary> | ||
/// The search service | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-search">API information</see>.</para> | ||
/// </summary> | ||
ISearchService Search { get; } | ||
|
||
/// <summary> | ||
/// The notification service | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-registernotification">API information</see>.</para> | ||
/// </summary> | ||
INotificationService Notification { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using PVOutput.Net.Objects; | ||
using PVOutput.Net.Responses; | ||
|
||
namespace PVOutput.Net.Modules | ||
{ | ||
/// <summary> | ||
/// The Get Extended service retrieves system daily extended data. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getextended">API information</see>.</para> | ||
/// <para><strong>Note: this is a donation only service.</strong></para> | ||
/// </summary> | ||
public interface IExtendedService | ||
{ | ||
/// <summary> | ||
/// Retrieve most recently created extended data. | ||
/// <para><strong>Note: this is a donation only request.</strong></para> | ||
/// </summary> | ||
/// <param name="cancellationToken">A cancellation token for the request.</param> | ||
/// <returns>Most recent extended data.</returns> | ||
Task<PVOutputResponse<IExtended>> GetRecentExtendedDataAsync(CancellationToken cancellationToken = default); | ||
|
||
/// <summary> | ||
/// Retrieve extended data for a certain period. | ||
/// <para><strong>Note: this is a donation only request.</strong></para> | ||
/// </summary> | ||
/// <param name="fromDate">Minimum DateTime for the requested range.</param> | ||
/// <param name="toDate">Maximum DateTime for the requested range.</param> | ||
/// <param name="limit">Optional limit of number of items. <c>50 is the maximum.</c></param> | ||
/// <param name="cancellationToken">A cancellation token for the request.</param> | ||
/// <returns>List of extended data objects.</returns> | ||
Task<PVOutputArrayResponse<IExtended>> GetExtendedDataForPeriodAsync(DateTime fromDate, DateTime toDate, int? limit = null, CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using PVOutput.Net.Objects; | ||
using PVOutput.Net.Responses; | ||
|
||
namespace PVOutput.Net.Modules | ||
{ | ||
/// <summary> | ||
/// The Get Favourite service retrieves the systems in your favourites or another user's favourites. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getfavourite">API information</see>.</para> | ||
/// </summary> | ||
public interface IFavouriteService | ||
{ | ||
/// <summary> | ||
/// Retrieves the favourites for the owned system, or another. | ||
/// </summary> | ||
/// <param name="systemId">Optional SystemId to request the favourites for.</param> | ||
/// <param name="cancellationToken">A cancellation token for the request.</param> | ||
/// <returns>List of favourites.</returns> | ||
Task<PVOutputArrayResponse<IFavourite>> GetFavouritesAsync(int? systemId = null, CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using PVOutput.Net.Objects; | ||
using PVOutput.Net.Responses; | ||
|
||
namespace PVOutput.Net.Modules | ||
{ | ||
/// <summary> | ||
/// The Get Insolation service retrieves 5-minute insolation data (power and energy) under ideal weather conditions. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getinsolation">API information</see>.</para> | ||
/// <para><strong>Note: this is a donation only service.</strong></para> | ||
/// </summary> | ||
public interface IInsolationService | ||
{ | ||
/// <summary> | ||
/// Get insolation data for own system. | ||
/// <para><strong>Note: this is a donation only request.</strong></para> | ||
/// </summary> | ||
/// <param name="date">The DateTime to calculate the insolation for. If empty, the current date will be calculated.</param> | ||
/// <param name="cancellationToken">A cancellation token for the request.</param> | ||
/// <returns>Insolation data for the owned system.</returns> | ||
Task<PVOutputArrayResponse<IInsolation>> GetInsolationForOwnSystemAsync(DateTime? date = null, CancellationToken cancellationToken = default); | ||
|
||
/// <summary> | ||
/// Get insolation data for a system. | ||
/// <para><strong>Note: this is a donation only request.</strong></para> | ||
/// </summary> | ||
/// <param name="systemId">Id of the system to get insolation for.</param> | ||
/// <param name="date">The DateTime to calculate the insolation for. If empty, the current date will be calculated.</param> | ||
/// <param name="cancellationToken">A cancellation token for the request.</param> | ||
/// <returns>Insolation data for the requested system.</returns> | ||
Task<PVOutputArrayResponse<IInsolation>> GetInsolationForSystemAsync(int systemId, DateTime? date = null, CancellationToken cancellationToken = default); | ||
|
||
/// <summary> | ||
/// Get insolation data for a location. | ||
/// <para><strong>Note: this is a donation only request.</strong></para> | ||
/// </summary> | ||
/// <param name="coordinate">GPS coordinate, to request insolation for.</param> | ||
/// <param name="date">The DateTime to calculate the insolation for. If empty, the current date will be calculated.</param> | ||
/// <param name="cancellationToken">A cancellation token for the request.</param> | ||
/// <returns>Insolation data for the requested location.</returns> | ||
Task<PVOutputArrayResponse<IInsolation>> GetInsolationForLocationAsync(PVCoordinate coordinate, DateTime? date = null, CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using PVOutput.Net.Objects; | ||
using PVOutput.Net.Responses; | ||
|
||
namespace PVOutput.Net.Modules | ||
{ | ||
/// <summary> | ||
/// The Get Missing service retrieves a list of output dates missing from a system. | ||
/// <para>See the official <see href="https://pvoutput.org/help.html#api-getmissing">API information</see>.</para> | ||
/// </summary> | ||
public interface IMissingService | ||
{ | ||
/// <summary> | ||
/// Retrieves a list of output dates with no data | ||
/// </summary> | ||
/// <param name="fromDate">Minimum date for the requested range.</param> | ||
/// <param name="toDate">Maximum date for the requested range.</param> | ||
/// <param name="cancellationToken">A cancellation token for the request.</param> | ||
/// <returns>List of missing dates</returns> | ||
Task<PVOutputResponse<IMissing>> GetMissingDaysInPeriodAsync(DateTime fromDate, DateTime toDate, CancellationToken cancellationToken = default); | ||
} | ||
} |
Oops, something went wrong.